15b59005fSLoGin use core::hint::spin_loop; 25b59005fSLoGin 3*2eab6dd7S曾俊 use log::error; 4*2eab6dd7S曾俊 5*2eab6dd7S曾俊 use crate::{arch::CurrentIrqArch, exception::InterruptArch, process::ProcessManager}; 65b59005fSLoGin 75b59005fSLoGin impl ProcessManager { 85b59005fSLoGin /// 每个核的idle进程 arch_idle_func() -> !95b59005fSLoGin pub fn arch_idle_func() -> ! { 105b59005fSLoGin loop { 115b59005fSLoGin if CurrentIrqArch::is_irq_enabled() { 125b59005fSLoGin riscv::asm::wfi(); 135b59005fSLoGin } else { 14*2eab6dd7S曾俊 error!("Idle process should not be scheduled with IRQs disabled."); 155b59005fSLoGin spin_loop(); 165b59005fSLoGin } 17f049d1afSLoGin 18*2eab6dd7S曾俊 // debug!("idle loop"); 195b59005fSLoGin } 205b59005fSLoGin } 215b59005fSLoGin } 22