X86: Use recvResponse to implement the idle bit in the Local APIC ICR.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:56:24 +0000 (03:56 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:56:24 +0000 (03:56 -0700)
src/arch/x86/interrupts.cc

index 9ac4b20ba355cb99b4906fab462d5d4ea6179886..c247d9ebc62e4b4e89521c910fa4592dfa57619d 100644 (file)
@@ -332,6 +332,22 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt)
 }
 
 
+Tick
+X86ISA::Interrupts::recvResponse(PacketPtr pkt)
+{
+    assert(!pkt->isError());
+    assert(pkt->cmd == MemCmd::MessageResp);
+    InterruptCommandRegLow low = regs[APIC_INTERRUPT_COMMAND_LOW];
+    // Record that the ICR is now idle.
+    low.deliveryStatus = 0;
+    regs[APIC_INTERRUPT_COMMAND_LOW] = low;
+    delete pkt->req;
+    delete pkt;
+    DPRINTF(LocalApic, "ICR is now idle.\n");
+    return 0;
+}
+
+
 void
 X86ISA::Interrupts::addressRanges(AddrRangeList &range_list)
 {
@@ -475,9 +491,12 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val)
             message.level = low.level;
             message.trigger = low.trigger;
             bool timing = sys->getMemoryMode() == Enums::timing;
+            // Be careful no updates of the delivery status bit get lost.
+            regs[APIC_INTERRUPT_COMMAND_LOW] = low;
             switch (low.destShorthand) {
               case 0:
                 intPort->sendMessage(message, timing);
+                newVal = regs[APIC_INTERRUPT_COMMAND_LOW];
                 break;
               case 1:
                 panic("Self IPIs aren't implemented.\n");