diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 8af51eb92..3f4c79964 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -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 { diff --git a/kernel/src/arch/riscv/syscall.rs b/kernel/src/arch/riscv/syscall.rs index 1265d4582..dd0e9187e 100644 --- a/kernel/src/arch/riscv/syscall.rs +++ b/kernel/src/arch/riscv/syscall.rs @@ -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(),