Skip to content

Commit

Permalink
riscv/nsbi: halt upon sbi_mexception
Browse files Browse the repository at this point in the history
This avoids endless restart if NuttSBI fails to enter S-mode.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 committed Aug 1, 2024
1 parent 846581f commit d5854b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch/risc-v/src/nuttsbi/sbi_mexception.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <nuttx/config.h>

#include <debug.h>
#include <stdint.h>

/****************************************************************************
Expand All @@ -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");
}
}

0 comments on commit d5854b6

Please sign in to comment.