MessagePort: implement the virtual recvTiming function to avoid double pkt delete

Double packet delete problem is due to an interrupt device deleting a packet that the SimpleTimingPort also deletes. Since MessagePort descends from SimpleTimingPort, simply reimplement the failing code from SimpleTimingPort: recvTiming.
This commit is contained in:
Joel Hestness 2011-02-06 22:14:17 -08:00
parent 02b05bf9be
commit d9f0a8288e
3 changed files with 6 additions and 6 deletions

View file

@ -340,8 +340,6 @@ X86ISA::Interrupts::recvResponse(PacketPtr pkt)
low.deliveryStatus = 0;
regs[APIC_INTERRUPT_COMMAND_LOW] = low;
}
delete pkt->req;
delete pkt;
DPRINTF(LocalApic, "ICR is now idle.\n");
return 0;
}

View file

@ -37,10 +37,14 @@ X86ISA::IntDev::IntPort::sendMessage(ApicList apics,
ApicList::iterator apicIt;
for (apicIt = apics.begin(); apicIt != apics.end(); apicIt++) {
PacketPtr pkt = buildIntRequest(*apicIt, message);
if (timing)
if (timing) {
sendMessageTiming(pkt, latency);
else
// The target handles cleaning up the packet in timing mode.
} else {
sendMessageAtomic(pkt);
delete pkt->req;
delete pkt;
}
}
}

View file

@ -138,8 +138,6 @@ class IntDev
virtual Tick
recvResponse(PacketPtr pkt)
{
delete pkt->req;
delete pkt;
return 0;
}