From 4b840b8322f4536a4e0c49c43f999c00fa66a1e9 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Wed, 18 Sep 2013 11:28:27 +0200 Subject: 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. --- src/arch/x86/interrupts.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/arch/x86/interrupts.cc') diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index afed9c132..ca765782e 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -649,6 +649,14 @@ X86ISA::Interrupts::checkInterrupts(ThreadContext *tc) const 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) { -- cgit v1.2.3