diff --git a/riscv_cpu.c b/riscv_cpu.c index dd84888..f582def 100644 --- a/riscv_cpu.c +++ b/riscv_cpu.c @@ -1134,6 +1134,9 @@ static void raise_exception2(RISCVCPUState *s, uint32_t cause, set_priv(s, PRV_M); s->pc = s->mtvec; } + //// Begin Test: Quit if cause=2, otherwise it will loop forever + if (cause == 2) { puts("tinyemu: Unknown mcause 2, quitting"); exit(1); } + //// End Test } static void raise_exception(RISCVCPUState *s, uint32_t cause)