riscv/nsbi: halt upon sbi_mexception

This avoids endless restart if NuttSBI fails to enter S-mode.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-07-10 16:47:31 +08:00 committed by Xiang Xiao
parent 5e551632dd
commit ab7bc90ebb
1 changed files with 7 additions and 3 deletions

View File

@ -24,6 +24,7 @@
#include <nuttx/config.h>
#include <debug.h>
#include <stdint.h>
/****************************************************************************
@ -32,7 +33,10 @@
void sbi_mexception(uintreg_t mcause, uintreg_t *mepc, uintreg_t tval)
{
UNUSED(mcause);
UNUSED(mepc);
UNUSED(tval);
sinfo("cauz=%"PRIxREG" epc=%p tval=0x%"PRIxREG"\n", mcause, mepc, tval);
while (1)
{
__asm__ __volatile__("wfi");
}
}