1*2eab6dd7S曾俊 use log::info; 2*2eab6dd7S曾俊 38cb2e9b3SLoGin use crate::{ 48cb2e9b3SLoGin arch::{syscall::arch_syscall_init, CurrentIrqArch, CurrentSchedArch}, 58cb2e9b3SLoGin exception::InterruptArch, 68cb2e9b3SLoGin process::ProcessManager, 78cb2e9b3SLoGin sched::SchedArch, 88cb2e9b3SLoGin smp::{core::smp_get_processor_id, cpu::smp_cpu_manager}, 98cb2e9b3SLoGin }; 108cb2e9b3SLoGin 118cb2e9b3SLoGin #[inline(never)] smp_ap_start_stage2() -> !128cb2e9b3SLoGinpub fn smp_ap_start_stage2() -> ! { 13b5b571e0SLoGin assert!(!CurrentIrqArch::is_irq_enabled()); 148cb2e9b3SLoGin 158cb2e9b3SLoGin smp_cpu_manager().complete_ap_thread(true); 168cb2e9b3SLoGin 178cb2e9b3SLoGin do_ap_start_stage2(); 188cb2e9b3SLoGin 198cb2e9b3SLoGin CurrentSchedArch::initial_setup_sched_local(); 208cb2e9b3SLoGin 218cb2e9b3SLoGin CurrentSchedArch::enable_sched_local(); 228cb2e9b3SLoGin ProcessManager::arch_idle_func(); 238cb2e9b3SLoGin } 248cb2e9b3SLoGin 258cb2e9b3SLoGin #[inline(never)] do_ap_start_stage2()268cb2e9b3SLoGinfn do_ap_start_stage2() { 27*2eab6dd7S曾俊 info!("Successfully started AP {}", smp_get_processor_id().data()); 288cb2e9b3SLoGin arch_syscall_init().expect("AP core failed to initialize syscall"); 298cb2e9b3SLoGin } 30