Fix safety reasoning about get_on_cpu

This commit is contained in:
Ruihan Li
2025-01-06 21:11:57 +08:00
committed by Tate, Hongliang Tian
parent c17a3eaa0b
commit 396ead6fbd
5 changed files with 120 additions and 73 deletions

View File

@ -88,11 +88,7 @@ unsafe fn init() {
// 1. They are only called once in the boot context of the BSP.
// 2. The number of CPUs are available because ACPI has been initialized.
// 3. No CPU-local objects have been accessed yet.
unsafe {
cpu::init_num_cpus();
cpu::local::copy_bsp_for_ap();
cpu::set_this_cpu_id(0);
}
unsafe { cpu::init_on_bsp() };
// SAFETY: We are on the BSP and APs are not yet started.
let meta_pages = unsafe { mm::frame::meta::init() };