Skip to content

Commit

Permalink
Quit if cause=2, otherwise it will loop forever
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jan 16, 2024
1 parent 14badbc commit 9da5b06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions riscv_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9da5b06

Please sign in to comment.