Skip to content

Commit d926f2f

Browse files
committed
test
1 parent 92c3597 commit d926f2f

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/riscv.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ enum TRAP_CODE {
9696
ECALL_M = 11,
9797
};
9898

99+
#define SET_SCAUSE_AND_STVAL_THEN_TRAP(rv, scause, stval) \
100+
{ \
101+
/* \
102+
* To align rv32emu behavior with Spike \
103+
* \
104+
* If not in system mode, the __trap_handler \
105+
* should be be invoked \
106+
*/ \
107+
IIF(RV32_HAS(SYSTEM))(rv->is_trapped = true, ); \
108+
rv->csr_scause = scause; \
109+
rv->csr_stval = stval; \
110+
rv->io.on_trap(rv); \
111+
}
112+
113+
99114
#define MISA_SUPER (1 << ('S' - 'A'))
100115
#define MISA_USER (1 << ('U' - 'A'))
101116
#define MISA_I (1 << ('I' - 'A'))

src/system.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@
77

88
#include "riscv_private.h"
99

10-
#define SET_SCAUSE_AND_STVAL_THEN_TRAP(rv, scause, stval) \
11-
{ \
12-
/* \
13-
* To align rv32emu behavior with Spike \
14-
* \
15-
* If not in system mode, the __trap_handler \
16-
* should be be invoked \
17-
*/ \
18-
IIF(RV32_HAS(SYSTEM))(rv->is_trapped = true, ); \
19-
rv->csr_scause = scause; \
20-
rv->csr_stval = stval; \
21-
rv->io.on_trap(rv); \
22-
}
23-
2410
/* PTE XWRV bit in order */
2511
enum SV32_PTE_PERM {
2612
NEXT_PG_TBL = 0b0001,

0 commit comments

Comments
 (0)