mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 17:03:23 +00:00
Refactor the this_cpu
API with PinCurrentCpu
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
9a94ba23aa
commit
f7a9510be0
@ -113,9 +113,11 @@ pub fn register_ap_entry(entry: fn() -> !) {
|
||||
fn ap_early_entry(local_apic_id: u32) -> ! {
|
||||
crate::arch::enable_cpu_features();
|
||||
|
||||
// SAFETY: we are on the AP.
|
||||
// SAFETY: we are on the AP and they are only called once with the correct
|
||||
// CPU ID.
|
||||
unsafe {
|
||||
cpu::local::init_on_ap(local_apic_id);
|
||||
cpu::set_this_cpu_id(local_apic_id);
|
||||
}
|
||||
|
||||
trap::init();
|
||||
|
Reference in New Issue
Block a user