diff options
author | Mitch Hayenga <mitch.hayenga@arm.com> | 2016-07-21 17:19:15 +0100 |
---|---|---|
committer | Mitch Hayenga <mitch.hayenga@arm.com> | 2016-07-21 17:19:15 +0100 |
commit | 8a476d387c84f037d0ccf3cc20dc88870ab45fec (patch) | |
tree | 341d4975740d91056a44b13bd43e10bf175d7166 /src/arch/mips/interrupts.cc | |
parent | d25b58036a040d8ac733b824e2865e1f5fe43e00 (diff) | |
download | gem5-8a476d387c84f037d0ccf3cc20dc88870ab45fec.tar.xz |
isa: Modify get/check interrupt routines
Make it so that getInterrupt *always* returns an interrupt if
checkInterrupts() returns true. This fixes/simplifies handling
of interrupts on the SMT FS CPUs (currently minor).
Diffstat (limited to 'src/arch/mips/interrupts.cc')
-rwxr-xr-x | src/arch/mips/interrupts.cc | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/arch/mips/interrupts.cc b/src/arch/mips/interrupts.cc index a0d9de03b..98c1b8e23 100755 --- a/src/arch/mips/interrupts.cc +++ b/src/arch/mips/interrupts.cc @@ -105,11 +105,11 @@ Interrupts::clearAll() } - -Fault -Interrupts::getInterrupt(ThreadContext * tc) +bool +Interrupts::checkInterrupts(ThreadContext *tc) const { - DPRINTF(Interrupt, "Interrupts getInterrupt\n"); + if (!interruptsPending(tc)) + return false; //Check if there are any outstanding interrupts StatusReg status = tc->readMiscRegNoEffect(MISCREG_STATUS); @@ -120,14 +120,25 @@ Interrupts::getInterrupt(ThreadContext * tc) // So if any interrupt that isn't masked is detected, jump to interrupt // handler CauseReg cause = tc->readMiscRegNoEffect(MISCREG_CAUSE); - if (status.im && cause.ip) { - DPRINTF(Interrupt, "Interrupt! IM[7:0]=%d IP[7:0]=%d \n", - (unsigned)status.im, (unsigned)cause.ip); - return std::make_shared<InterruptFault>(); - } + if (status.im && cause.ip) + return true; + } - return NoFault; + return false; +} + +Fault +Interrupts::getInterrupt(ThreadContext * tc) +{ + assert(checkInterrupts(tc)); + + StatusReg M5_VAR_USED status = tc->readMiscRegNoEffect(MISCREG_STATUS); + CauseReg M5_VAR_USED cause = tc->readMiscRegNoEffect(MISCREG_CAUSE); + DPRINTF(Interrupt, "Interrupt! IM[7:0]=%d IP[7:0]=%d \n", + (unsigned)status.im, (unsigned)cause.ip); + + return std::make_shared<InterruptFault>(); } bool |