summaryrefslogtreecommitdiff
path: root/src/arch/arm/interrupts.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2013-04-22 13:20:32 -0400
committerAndreas Sandberg <andreas.sandberg@arm.com>2013-04-22 13:20:32 -0400
commit6d2941d9904bdaf0805d46046a0ff43b22d77165 (patch)
tree815723128609a4e416252df573a2afc4895cac96 /src/arch/arm/interrupts.hh
parentf8f66fa3df3ef5b4e30ee86d33a4e95476ba425a (diff)
downloadgem5-6d2941d9904bdaf0805d46046a0ff43b22d77165.tar.xz
arm: Add a method to query interrupt state ignoring CPSR masks
Add the method checkRaw to ArmISA::Interrupts. This method can be used to query the raw state (ignoring CPSR masks) of an interrupt. It is primarily intended for hardware virtualized CPUs.
Diffstat (limited to 'src/arch/arm/interrupts.hh')
-rw-r--r--src/arch/arm/interrupts.hh20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/arch/arm/interrupts.hh b/src/arch/arm/interrupts.hh
index 82c0bb713..7def6ddd6 100644
--- a/src/arch/arm/interrupts.hh
+++ b/src/arch/arm/interrupts.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 ARM Limited
+ * Copyright (c) 2010,2012 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -150,6 +150,24 @@ class Interrupts : public SimObject
return intStatus;
}
+ /**
+ * Check the state of a particular interrupt, ignoring CPSR masks.
+ *
+ * This method is primarily used when running the target CPU in a
+ * hardware VM (e.g., KVM) to check if interrupts should be
+ * delivered upon guest entry.
+ *
+ * @param interrupt Interrupt type to check the state of.
+ * @return true if the interrupt is asserted, false otherwise.
+ */
+ bool
+ checkRaw(InterruptTypes interrupt) const
+ {
+ if (interrupt >= NumInterruptTypes)
+ panic("Interrupt number out of range.\n");
+
+ return interrupts[interrupt];
+ }
Fault
getInterrupt(ThreadContext *tc)