chore: kernel: trap: print trace when page fault happens

This commit is contained in:
Paul Pan 2024-06-17 00:47:40 +08:00
parent d69e95721c
commit a9772cba54

View File

@ -93,6 +93,10 @@ impl TrapContextOps for TrapContext {
if from_kernel {
panic_fatal!("Page Fault in Kernel");
}
let stval = riscv::register::stval::read();
trace!("Page Fault: sepc: {:#x}, stval: {:#x}", self.sepc, stval);
// TODO: handle page fault
},
_ => panic_fatal!("Unhandled Trap"),