kernel: only print RISC-V exceptions when printing is enabled

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-10-30 20:42:25 +08:00
parent f46f7c6e81
commit e5003eee6d

View file

@ -121,6 +121,7 @@ pub extern "C" fn trap_handler(
// it with one if necessary.
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}", pid, ex, pc, addr);
let entry = crate::arch::mem::pagetable_entry(addr).unwrap_or_else(|x| {
// MemoryManagerHandle::get().print_ownership();