mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Turn GS.base
validity into a global invariant
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
b52d841ac1
commit
5651b93af0
@ -84,11 +84,13 @@ unsafe fn init() {
|
||||
|
||||
logger::init();
|
||||
|
||||
// SAFETY: They are only called once on BSP and ACPI has been initialized.
|
||||
// No CPU local objects have been accessed by this far.
|
||||
// SAFETY:
|
||||
// 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::init_on_bsp();
|
||||
cpu::local::copy_bsp_for_ap();
|
||||
cpu::set_this_cpu_id(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user