Browse Source

bugfix in raising accelerator interrupts

pull/18/head
Yunsup Lee 11 years ago
parent
commit
c0f7d3cd77
  1. 2
      hwacha/hwacha.cc
  2. 9
      riscv/extension.cc

2
hwacha/hwacha.cc

@ -103,5 +103,5 @@ void hwacha_t::take_exception(reg_t c, reg_t a)
cause = c;
aux = a;
raise_interrupt();
throw std::logic_error("a hwacha exception was posted, but interrupts are disabled!");
throw std::logic_error("unreachable!");
}

9
riscv/extension.cc

@ -12,7 +12,14 @@ void extension_t::illegal_instruction()
void extension_t::raise_interrupt()
{
p->raise_interrupt(IRQ_COP);
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()

Loading…
Cancel
Save