blob: 00cd24ff9bd174daf33b4c4e92bcf83649dfec19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// See LICENSE for license details.
#include "extension.h"
#include "trap.h"
extension_t::~extension_t()
{
}
void extension_t::illegal_instruction()
{
throw trap_illegal_instruction();
}
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);
}
throw std::logic_error("a COP exception was posted, but interrupts are disabled!");
}
void extension_t::clear_interrupt()
{
}
|