> 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
 22:18:25 up 4 days, 17:23,  1 user,  load average: 0.63, 0.60, 0.58
This commit is contained in:
tracer-ics2023
2024-09-21 22:18:25 +08:00
committed by zzy
parent 65e0f7e402
commit 4665456e59
2 changed files with 2 additions and 3 deletions

View File

@ -26,14 +26,14 @@ static inline int check_reg_idx(int idx) {
#define gpr(idx) (cpu.gpr[check_reg_idx(idx)])
enum {
MSTATUS = 0x300, // Machine status register.
// 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 == MCAUSE || idx == MEPC || idx == MTVEC));
IFDEF(CONFIG_RT_CHECK, assert(idx == MCAUSE || idx == MEPC || idx == MTVEC));
return idx;
}

View File

@ -21,7 +21,6 @@ word_t isa_raise_intr(word_t NO, vaddr_t epc) {
/* TODO: Trigger an interrupt/exception with ``NO''.
* Then return the address of the interrupt/exception vector.
*/
printf("raise intr %d\n", NO);
C(MEPC) = epc;
C(MCAUSE) = NO;
return C(MTVEC);