1 use crate::{ 2 arch::{syscall::arch_syscall_init, CurrentIrqArch, CurrentSchedArch}, 3 exception::InterruptArch, 4 process::ProcessManager, 5 sched::SchedArch, 6 smp::{core::smp_get_processor_id, cpu::smp_cpu_manager}, 7 }; 8 9 #[inline(never)] 10 pub fn smp_ap_start_stage2() -> ! { 11 assert!(!CurrentIrqArch::is_irq_enabled()); 12 13 smp_cpu_manager().complete_ap_thread(true); 14 15 do_ap_start_stage2(); 16 17 CurrentSchedArch::initial_setup_sched_local(); 18 19 CurrentSchedArch::enable_sched_local(); 20 ProcessManager::arch_idle_func(); 21 } 22 23 #[inline(never)] 24 fn do_ap_start_stage2() { 25 kinfo!("Successfully started AP {}", smp_get_processor_id().data()); 26 arch_syscall_init().expect("AP core failed to initialize syscall"); 27 } 28