put debug prints behind debug flags

This commit is contained in:
bunnie 2024-04-28 02:41:29 +08:00
parent ced0b09881
commit ecf2396d0c
2 changed files with 2 additions and 1 deletions

View file

@ -190,6 +190,7 @@ pub extern "C" fn trap_handler(
{
let pid = current_pid();
let ex = RiscvException::from_regs(sc.bits(), sepc::read(), stval::read());
#[cfg(feature = "debug-print")]
println!("IRQ -- KERNEL({}): RISC-V fault: {}", pid, ex);
}
match ex {

View file

@ -33,7 +33,7 @@ pub fn resume(supervisor: bool, thread: &Thread) -> ! {
// Return to the appropriate CPU mode
set_supervisor(supervisor);
#[cfg(feature = "debug-print")]
println!(
"Switching to PID {}, SP: {:08x}, PC: {:08x}",
crate::arch::current_pid(),