Make CPU-local and early ACPI initialization heap-less

This commit is contained in:
Zhang Junyang
2025-01-08 20:27:45 +08:00
committed by Tate, Hongliang Tian
parent 7496b24da1
commit 92bc8cbbf7
17 changed files with 188 additions and 157 deletions

View File

@ -22,23 +22,13 @@ pub(crate) fn init_cvm_guest() {
// Unimplemented, no-op
}
pub(crate) fn init_on_bsp() {
pub(crate) unsafe fn late_init_on_bsp() {
// SAFETY: this function is only called once on BSP.
unsafe {
trap::init(true);
}
irq::init();
// SAFETY: they are only called once on BSP and ACPI has been initialized.
unsafe {
crate::cpu::init_num_cpus();
crate::cpu::set_this_cpu_id(0);
}
// SAFETY: no CPU local objects have been accessed by this far. And
// we are on the BSP.
unsafe { crate::cpu::local::init_on_bsp() };
crate::boot::smp::boot_all_aps();
timer::init();