X86: Add a function which gets called when an interrupt message has been delivered.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:54:11 +0000 (03:54 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:54:11 +0000 (03:54 -0700)
src/arch/x86/interrupts.cc
src/arch/x86/interrupts.hh
src/dev/x86/intdev.cc
src/dev/x86/intdev.hh
src/mem/mport.cc

index a0ce30ad7caf6a83dc6620eb07f99ddd6ea2784e..9ac4b20ba355cb99b4906fab462d5d4ea6179886 100644 (file)
@@ -327,8 +327,7 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt)
                 offset);
         break;
     }
-    delete pkt->req;
-    delete pkt;
+    pkt->makeAtomicResponse();
     return latency;
 }
 
index c4312913376742979275036f08857671bb27a2ab..ba92c77d6a8d1a65f751262d654ed36258bbe378 100644 (file)
@@ -213,6 +213,7 @@ class Interrupts : public BasicPioDevice, IntDev
     Tick read(PacketPtr pkt);
     Tick write(PacketPtr pkt);
     Tick recvMessage(PacketPtr pkt);
+    Tick recvResponse(PacketPtr pkt);
 
     bool
     triggerTimerInterrupt()
index 3b29eb7bf76e1985abf48bbccc04f8656b4b7e53..10e50c13ed32b4bbc19d9842ec4d9545dde05d11 100644 (file)
@@ -45,10 +45,11 @@ X86ISA::IntDev::IntPort::sendMessage(TriggerIntMessage message, bool timing)
         DPRINTF(IntDev,
                 "Sending interrupt to APIC ID %d.\n", message.destination);
         PacketPtr pkt = buildIntRequest(message.destination, message);
-        if (timing)
+        if (timing) {
             sendMessageTiming(pkt, latency);
-        else
+        } else {
             sendMessageAtomic(pkt);
+        }
     } else {
         DPRINTF(IntDev, "Sending interrupts to APIC IDs:"
                 "%s%s%s%s%s%s%s%s\n",
index e95c720585968b5e34fa2163f20701923b9ec0f3..3a99783f78287f53f7724e88fc4a676861fe4b4a 100644 (file)
@@ -71,6 +71,11 @@ class IntDev
             return device->recvMessage(pkt);
         }
 
+        Tick recvResponse(PacketPtr pkt)
+        {
+            return device->recvResponse(pkt);
+        }
+
         // This is x86 focused, so if this class becomes generic, this would
         // need to be moved into a subclass.
         void sendMessage(TriggerIntMessage message, bool timing);
@@ -125,6 +130,14 @@ class IntDev
         return 0;
     }
 
+    virtual Tick
+    recvResponse(PacketPtr pkt)
+    {
+        delete pkt->req;
+        delete pkt;
+        return 0;
+    }
+
     virtual void
     getIntAddrRange(AddrRangeList &range_list)
     {
index 72bcfc7fdc878b31b56502d98498ad9680a45a9b..564c560c62b9019a58db9631cb31079855a68812 100644 (file)
@@ -56,5 +56,8 @@ MessagePort::sendMessageTiming(PacketPtr pkt, Tick latency)
 Tick
 MessagePort::sendMessageAtomic(PacketPtr pkt)
 {
-    return sendAtomic(pkt);
+    Tick latency = sendAtomic(pkt);
+    assert(pkt->isResponse());
+    latency += recvResponse(pkt);
+    return latency;
 }