Skip to content

Commit 42896f1

Browse files
committed
test
1 parent b44a5af commit 42896f1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/emulate.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,8 @@ static void __trap_handler(riscv_t *rv)
11381138

11391139
static void _trap_handler(riscv_t *rv)
11401140
{
1141-
uint32_t cause =
1142-
rv->priv_mode == RV_PRIV_S_MODE ? rv->csr_scause : rv->csr_mcause;
1143-
uint32_t tval =
1144-
rv->priv_mode == RV_PRIV_S_MODE ? rv->csr_stval : rv->csr_mtval;
1141+
uint32_t cause = RV_PRIV_IS_U_OR_S_MODE() ? rv->csr_scause : rv->csr_mcause;
1142+
uint32_t tval = RV_PRIV_IS_U_OR_S_MODE() ? rv->csr_stval : rv->csr_mtval;
11451143

11461144
switch (cause) {
11471145
#if !RV32_HAS(EXT_C)

0 commit comments

Comments
 (0)