From bdda224d4110dd8ebb6224bfa9bc2641957a8c57 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 19 Apr 2009 03:54:11 -0700 Subject: [PATCH] X86: Add a function which gets called when an interrupt message has been delivered. --- src/arch/x86/interrupts.cc | 3 +-- src/arch/x86/interrupts.hh | 1 + src/dev/x86/intdev.cc | 5 +++-- src/dev/x86/intdev.hh | 13 +++++++++++++ src/mem/mport.cc | 5 ++++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index a0ce30ad7..9ac4b20ba 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -327,8 +327,7 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt) offset); break; } - delete pkt->req; - delete pkt; + pkt->makeAtomicResponse(); return latency; } diff --git a/src/arch/x86/interrupts.hh b/src/arch/x86/interrupts.hh index c43129133..ba92c77d6 100644 --- a/src/arch/x86/interrupts.hh +++ b/src/arch/x86/interrupts.hh @@ -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() diff --git a/src/dev/x86/intdev.cc b/src/dev/x86/intdev.cc index 3b29eb7bf..10e50c13e 100644 --- a/src/dev/x86/intdev.cc +++ b/src/dev/x86/intdev.cc @@ -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", diff --git a/src/dev/x86/intdev.hh b/src/dev/x86/intdev.hh index e95c72058..3a99783f7 100644 --- a/src/dev/x86/intdev.hh +++ b/src/dev/x86/intdev.hh @@ -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) { diff --git a/src/mem/mport.cc b/src/mem/mport.cc index 72bcfc7fd..564c560c6 100644 --- a/src/mem/mport.cc +++ b/src/mem/mport.cc @@ -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; }