Add --disable-dtb option to suppress writing the DTB to memory
[riscv-isa-sim.git] / riscv / extension.cc
index c2bea2e648635f30ef513a57d2b97ddcc46172b3..520c2ed578c3964c4cfba8c9f7da394a48c1bc5d 100644 (file)
@@ -1,3 +1,5 @@
+// See LICENSE for license details.
+
 #include "extension.h"
 #include "trap.h"
 
@@ -7,12 +9,13 @@ extension_t::~extension_t()
 
 void extension_t::illegal_instruction()
 {
-  throw trap_illegal_instruction();
+  throw trap_illegal_instruction(0);
 }
 
 void extension_t::raise_interrupt()
 {
-  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!");
 }
 
 void extension_t::clear_interrupt()