From b16ad82e565ee94f597406880e8c193a80197490 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 7 Jan 2021 18:50:48 +0800 Subject: [PATCH] kernel: riscv: print out allocated address This will aid in debugging. Signed-off-by: Sean Cross --- kernel/src/arch/riscv/irq.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 217e30058..70c16c95f 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -122,8 +122,8 @@ pub extern "C" fn trap_handler( match ex { RiscvException::StorePageFault(pc, addr) | RiscvException::LoadPageFault(pc, addr) => { #[cfg(any(feature = "debug-print", feature = "print-panics"))] - println!( - "KERNEL({}): RISC-V fault: {} @ {:08x}, addr {:08x}", + print!( + "KERNEL({}): RISC-V fault: {} @ {:08x}, addr {:08x} - ", pid, ex, pc, addr ); let virt = addr & !0xfff; @@ -164,6 +164,7 @@ pub extern "C" fn trap_handler( flush_mmu(); }; + println!("Handing page {:08x} to process", new_page); ArchProcess::with_current_mut(|process| { crate::arch::syscall::resume( current_pid().get() == 1, @@ -171,6 +172,7 @@ pub extern "C" fn trap_handler( ) }); } + println!("Page was not allocated"); } RiscvException::InstructionPageFault(RETURN_FROM_ISR, _offset) => { // If we hit this address, then an ISR has just returned. Since