X86: Add a function which gets called when an interrupt message has been delivered.

This commit is contained in:
Gabe Black 2009-04-19 03:54:11 -07:00
parent 3031af21c7
commit bdda224d41
5 changed files with 22 additions and 5 deletions

View file

@ -327,8 +327,7 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt)
offset);
break;
}
delete pkt->req;
delete pkt;
pkt->makeAtomicResponse();
return latency;
}

View 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()

View 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",

View 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)
{

View 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;
}