> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 19:49:18 up 4 days, 14:54, 1 user, load average: 0.80, 0.54, 0.40
This commit is contained in:
@ -25,12 +25,15 @@ static inline int check_reg_idx(int idx) {
|
||||
|
||||
#define gpr(idx) (cpu.gpr[check_reg_idx(idx)])
|
||||
|
||||
#define MSTATUS 0x300 // Machine status register.
|
||||
#define MTVEC 0x305 // Machine trap-handler base address.
|
||||
#define MEPC 0x341 // Machine exception program counter.
|
||||
#define MCAUSE 0x342 // Machine trap cause.
|
||||
enum {
|
||||
MSTATUS = 0x300, // Machine status register.
|
||||
MTVEC = 0x305, // Machine trap-handler base address.
|
||||
MEPC = 0x341, // Machine exception program counter.
|
||||
MCAUSE = 0x342, // Machine trap cause.
|
||||
};
|
||||
|
||||
static inline int check_cpr_idx(int idx) {
|
||||
IFDEF(CONFIG_RT_CHECK, assert(idx == MSTATUS || idx == MEPC || idx == MCAUSE));
|
||||
IFDEF(CONFIG_RT_CHECK, assert(idx == MSTATUS || idx == MEPC || idx == MCAUSE || idx == MTVEC));
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user