riscv: Call abort instead of assert on unhandled exceptions
We should call abort() instead of assert() on an unhandled
exception since assert() calls abort() anyway after a useless
"assert failed: 0" message. We can also skip dumping the
exception stack and just unwind from the stack frame where
the exception occurred.
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
diff --git a/lib/riscv/processor.c b/lib/riscv/processor.c
index e090420..6c868b8 100644
--- a/lib/riscv/processor.c
+++ b/lib/riscv/processor.c
@@ -43,7 +43,8 @@
}
show_regs(regs);
- assert(0);
+ dump_frame_stack((void *)regs->epc, (void *)regs->s0);
+ abort();
}
void install_exception_handler(unsigned long cause, void (*handler)(struct pt_regs *))