From 8a476d387c84f037d0ccf3cc20dc88870ab45fec Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Thu, 21 Jul 2016 17:19:15 +0100 Subject: 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). --- src/arch/arm/interrupts.hh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/arch/arm') 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(); if ((interrupts[INT_VIRT_IRQ] || hcr.vi) && allowVIrq) -- cgit v1.2.3