X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=riscv%2Fextension.cc;h=520c2ed578c3964c4cfba8c9f7da394a48c1bc5d;hb=7b396b51a6c38bc3472ea9c995e8015b39f19c1f;hp=00cd24ff9bd174daf33b4c4e92bcf83649dfec19;hpb=1063a09757908d6b2e5712231e3690f380e4a080;p=riscv-isa-sim.git diff --git a/riscv/extension.cc b/riscv/extension.cc index 00cd24f..520c2ed 100644 --- a/riscv/extension.cc +++ b/riscv/extension.cc @@ -9,18 +9,12 @@ extension_t::~extension_t() void extension_t::illegal_instruction() { - throw trap_illegal_instruction(); + throw trap_illegal_instruction(0); } void extension_t::raise_interrupt() { - int priv = get_field(p->get_state()->mstatus, MSTATUS_PRV); - int ie = get_field(p->get_state()->mstatus, MSTATUS_IE); - - if (priv < PRV_M || (priv == PRV_M && ie)) { - p->raise_interrupt(IRQ_COP); - } - + p->take_interrupt((reg_t)1 << IRQ_COP); // must not return throw std::logic_error("a COP exception was posted, but interrupts are disabled!"); }