class Interrupts : public BaseInterrupts
{
private:
- BaseCPU * cpu;
std::bitset<NumInterruptTypes> ip;
std::bitset<NumInterruptTypes> ie;
return dynamic_cast<const Params *>(_params);
}
- Interrupts(Params * p) : BaseInterrupts(p), cpu(nullptr), ip(0), ie(0) {}
-
- void setCPU(BaseCPU * _cpu) { cpu = _cpu; }
+ Interrupts(Params * p) : BaseInterrupts(p), ip(0), ie(0) {}
std::bitset<NumInterruptTypes>
- globalMask(ThreadContext *tc) const
+ globalMask() const
{
INTERRUPT mask = 0;
STATUS status = tc->readMiscReg(MISCREG_STATUS);
}
bool checkInterrupt(int num) const { return ip[num] && ie[num]; }
- bool checkInterrupts(ThreadContext *tc) const
+ bool checkInterrupts() const
{
- return (ip & ie & globalMask(tc)).any();
+ return (ip & ie & globalMask()).any();
}
Fault
- getInterrupt(ThreadContext *tc)
+ getInterrupt()
{
- assert(checkInterrupts(tc));
- std::bitset<NumInterruptTypes> mask = globalMask(tc);
+ assert(checkInterrupts());
+ std::bitset<NumInterruptTypes> mask = globalMask();
for (int c = 0; c < NumInterruptTypes; c++)
if (checkInterrupt(c) && mask[c])
return std::make_shared<InterruptFault>(c);
return NoFault;
}
- void updateIntrInfo(ThreadContext *tc) {}
+ void updateIntrInfo() {}
void
post(int int_num, int index)