1 // See LICENSE for license details.
6 extension_t::~extension_t()
10 void extension_t::illegal_instruction()
12 throw trap_illegal_instruction();
15 void extension_t::raise_interrupt()
17 int priv
= get_field(p
->get_state()->mstatus
, MSTATUS_PRV
);
18 int ie
= get_field(p
->get_state()->mstatus
, MSTATUS_IE
);
20 if (priv
< PRV_M
|| (priv
== PRV_M
&& ie
)) {
21 p
->raise_interrupt(IRQ_COP
);
24 throw std::logic_error("a COP exception was posted, but interrupts are disabled!");
27 void extension_t::clear_interrupt()