mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-10 12:16:48 +00:00
22 lines
523 B
Rust
22 lines
523 B
Rust
use core::hint::spin_loop;
|
|
|
|
use log::error;
|
|
|
|
use crate::{arch::CurrentIrqArch, exception::InterruptArch, process::ProcessManager};
|
|
|
|
impl ProcessManager {
|
|
/// 每个核的idle进程
|
|
pub fn arch_idle_func() -> ! {
|
|
loop {
|
|
if CurrentIrqArch::is_irq_enabled() {
|
|
riscv::asm::wfi();
|
|
} else {
|
|
error!("Idle process should not be scheduled with IRQs disabled.");
|
|
spin_loop();
|
|
}
|
|
|
|
// debug!("idle loop");
|
|
}
|
|
}
|
|
}
|