summaryrefslogtreecommitdiff
path: root/src/arch/arm/interrupts.hh
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2016-07-21 17:19:15 +0100
committerMitch Hayenga <mitch.hayenga@arm.com>2016-07-21 17:19:15 +0100
commit8a476d387c84f037d0ccf3cc20dc88870ab45fec (patch)
tree341d4975740d91056a44b13bd43e10bf175d7166 /src/arch/arm/interrupts.hh
parentd25b58036a040d8ac733b824e2865e1f5fe43e00 (diff)
downloadgem5-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/arm/interrupts.hh')
-rw-r--r--src/arch/arm/interrupts.hh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/arm/interrupts.hh b/src/arch/arm/interrupts.hh
index d5d2dac34..d09176ca9 100644
--- a/src/arch/arm/interrupts.hh
+++ b/src/arch/arm/interrupts.hh
@@ -149,6 +149,10 @@ class Interrupts : public SimObject
bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode;
bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode;
+ if ( !(intStatus || (hcr.vi && allowVIrq) || (hcr.vf && allowVFiq) ||
+ (hcr.va && allowVAbort)) )
+ return false;
+
bool take_irq = takeInt(tc, INT_IRQ);
bool take_fiq = takeInt(tc, INT_FIQ);
bool take_ea = takeInt(tc, INT_ABT);
@@ -221,6 +225,8 @@ class Interrupts : public SimObject
Fault
getInterrupt(ThreadContext *tc)
{
+ assert(checkInterrupts(tc));
+
HCR hcr = tc->readMiscReg(MISCREG_HCR);
CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
SCR scr = tc->readMiscReg(MISCREG_SCR);
@@ -234,15 +240,10 @@ class Interrupts : public SimObject
bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode;
bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode;
- if ( !(intStatus || (hcr.vi && allowVIrq) || (hcr.vf && allowVFiq) ||
- (hcr.va && allowVAbort)) )
- return NoFault;
-
bool take_irq = takeInt(tc, INT_IRQ);
bool take_fiq = takeInt(tc, INT_FIQ);
bool take_ea = takeInt(tc, INT_ABT);
-
if (interrupts[INT_IRQ] && take_irq)
return std::make_shared<Interrupt>();
if ((interrupts[INT_VIRT_IRQ] || hcr.vi) && allowVIrq)