changeset 81c0ae6ffb9e in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=81c0ae6ffb9e
description:
        x86: Add support for checking the raw state of an interrupt

        In order to support hardware virtualization, we need to be able to
        check if there are any interrupts pending irregardless of the
        rflags.intf value. This changeset adds the checkInterruptsRaw() method
        to the x86 interrupt control. It returns true if there are pending
        interrupts that can be delivered as soon as the CPU is ready for
        interrupt delivery.

diffstat:

 src/arch/x86/interrupts.cc |  8 ++++++++
 src/arch/x86/interrupts.hh |  7 +++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r 530a50b10ebe -r 81c0ae6ffb9e src/arch/x86/interrupts.cc
--- a/src/arch/x86/interrupts.cc        Wed Sep 18 11:28:24 2013 +0200
+++ b/src/arch/x86/interrupts.cc        Wed Sep 18 11:28:27 2013 +0200
@@ -649,6 +649,14 @@
     return false;
 }
 
+bool
+X86ISA::Interrupts::checkInterruptsRaw() const
+{
+    return pendingUnmaskableInt || pendingExtInt ||
+        (IRRV > ISRV && bits(IRRV, 7, 4) >
+         bits(regs[APIC_TASK_PRIORITY], 7, 4));
+}
+
 Fault
 X86ISA::Interrupts::getInterrupt(ThreadContext *tc)
 {
diff -r 530a50b10ebe -r 81c0ae6ffb9e src/arch/x86/interrupts.hh
--- a/src/arch/x86/interrupts.hh        Wed Sep 18 11:28:24 2013 +0200
+++ b/src/arch/x86/interrupts.hh        Wed Sep 18 11:28:27 2013 +0200
@@ -274,6 +274,13 @@
      */
 
     bool checkInterrupts(ThreadContext *tc) const;
+    /**
+     * Check if there are pending interrupts without ignoring the
+     * interrupts disabled flag.
+     *
+     * @return true if there are interrupts pending.
+     */
+    bool checkInterruptsRaw() const;
     Fault getInterrupt(ThreadContext *tc);
     void updateIntrInfo(ThreadContext *tc);
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to