xref: /DragonOS/kernel/src/arch/x86_64/process/idle.rs (revision d14e28a8a9b023ee8df7c2e8eee43e523134dbb2)
1 use core::hint::spin_loop;
2 
3 use crate::{arch::CurrentIrqArch, exception::InterruptArch, kBUG, process::ProcessManager};
4 
5 impl ProcessManager {
6     /// 每个核的idle进程
7     pub fn arch_idle_func() -> ! {
8         loop {
9             if CurrentIrqArch::is_irq_enabled() {
10                 unsafe {
11                     x86::halt();
12                 }
13             } else {
14                 kBUG!("Idle process should not be scheduled with IRQs disabled.");
15                 spin_loop();
16             }
17         }
18     }
19 }
20