state.pc = state.stvec;
state.scause = t.cause();
state.sepc = epc;
- if (t.has_badaddr())
- state.sbadaddr = t.get_badaddr();
+ state.sbadaddr = t.get_badaddr();
reg_t s = state.mstatus;
s = set_field(s, MSTATUS_SPIE, get_field(s, MSTATUS_SIE));
state.pc = (state.mtvec & ~(reg_t)1) + vector;
state.mepc = epc;
state.mcause = t.cause();
- if (t.has_badaddr())
- state.mbadaddr = t.get_badaddr();
+ state.mbadaddr = t.get_badaddr();
reg_t s = state.mstatus;
s = set_field(s, MSTATUS_MPIE, get_field(s, MSTATUS_MIE));
trap_t(reg_t which) : which(which) {}
virtual const char* name();
virtual bool has_badaddr() { return false; }
- virtual reg_t get_badaddr() { abort(); }
+ virtual reg_t get_badaddr() { return 0; }
reg_t cause() { return which; }
private:
char _name[16];