LoGin 471d65cf15
feat(riscv): riscv下能够运行hello world用户程序 (#770)
* feat(riscv): riscv下能够运行hello world用户程序
2024-04-26 11:59:47 +08:00

22 lines
527 B
Rust

use core::hint::spin_loop;
use crate::{
arch::CurrentIrqArch, exception::InterruptArch, kBUG, kdebug, process::ProcessManager,
};
impl ProcessManager {
/// 每个核的idle进程
pub fn arch_idle_func() -> ! {
loop {
if CurrentIrqArch::is_irq_enabled() {
riscv::asm::wfi();
} else {
kBUG!("Idle process should not be scheduled with IRQs disabled.");
spin_loop();
}
// kdebug!("idle loop");
}
}
}