#include "arch/x86/interrupts.hh"
+#include <list>
#include <memory>
#include "arch/x86/intmessage.hh"
message.destMode = low.destMode;
message.level = low.level;
message.trigger = low.trigger;
- ApicList apics;
+ std::list<int> apics;
int numContexts = sys->numContexts();
switch (low.destShorthand) {
case 0:
pendingIPIs += apics.size();
}
regs[APIC_INTERRUPT_COMMAND_LOW] = low;
- intMasterPort.sendMessage(apics, message, sys->isTimingMode());
+ for (auto id: apics) {
+ PacketPtr pkt = buildIntTriggerPacket(id, message);
+ intMasterPort.sendMessage(pkt, sys->isTimingMode());
+ }
newVal = regs[APIC_INTERRUPT_COMMAND_LOW];
}
break;
#include "arch/x86/x86_traits.hh"
#include "base/bitunion.hh"
#include "base/types.hh"
+#include "dev/x86/intdev.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
#include "mem/request.hh"
static const Addr TriggerIntOffset = 0;
- template<class T>
- PacketPtr
- buildIntPacket(Addr addr, T payload)
+ static inline PacketPtr
+ buildIntTriggerPacket(int id, TriggerIntMessage message)
{
- RequestPtr req = std::make_shared<Request>(
- addr, sizeof(T), Request::UNCACHEABLE, Request::intMasterId);
- PacketPtr pkt = new Packet(req, MemCmd::WriteReq);
- pkt->allocate();
- pkt->setRaw<T>(payload);
- return pkt;
+ Addr addr = x86InterruptAddress(id, TriggerIntOffset);
+ return buildIntPacket(addr, message);
}
}
#include "dev/x86/i82094aa.hh"
+#include <list>
+
#include "arch/x86/interrupts.hh"
#include "arch/x86/intmessage.hh"
#include "cpu/base.hh"
message.destMode = entry.destMode;
message.level = entry.polarity;
message.trigger = entry.trigger;
- ApicList apics;
+ std::list<int> apics;
int numContexts = sys->numContexts();
if (message.destMode == 0) {
if (message.deliveryMode == DeliveryMode::LowestPriority) {
// through the set of APICs selected above.
uint64_t modOffset = lowestPriorityOffset % apics.size();
lowestPriorityOffset++;
- ApicList::iterator apicIt = apics.begin();
+ auto apicIt = apics.begin();
while (modOffset--) {
apicIt++;
assert(apicIt != apics.end());
apics.push_back(selected);
}
}
- intMasterPort.sendMessage(apics, message, sys->isTimingMode());
+ for (auto id: apics) {
+ PacketPtr pkt = buildIntTriggerPacket(id, message);
+ intMasterPort.sendMessage(pkt, sys->isTimingMode());
+ }
}
}
#define __DEV_X86_INTDEV_HH__
#include <cassert>
-#include <list>
#include <string>
-#include "arch/x86/intmessage.hh"
#include "mem/tport.hh"
#include "sim/sim_object.hh"
}
};
-typedef std::list<int> ApicList;
+template<class T>
+PacketPtr
+buildIntPacket(Addr addr, T payload)
+{
+ RequestPtr req = std::make_shared<Request>(
+ addr, sizeof(T), Request::UNCACHEABLE, Request::intMasterId);
+ PacketPtr pkt = new Packet(req, MemCmd::WriteReq);
+ pkt->allocate();
+ pkt->setRaw<T>(payload);
+ return pkt;
+}
template <class Device>
class IntMasterPort : public QueuedMasterPort
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(X86ISA::ApicList apics, TriggerIntMessage message, bool timing)
+ sendMessage(PacketPtr pkt, bool timing)
{
- for (auto id: apics) {
- Addr addr = x86InterruptAddress(id, TriggerIntOffset);
- PacketPtr pkt = buildIntPacket(addr, message);
- if (timing) {
- schedTimingReq(pkt, curTick() + latency);
- // The target handles cleaning up the packet in timing mode.
- } else {
- // ignore the latency involved in the atomic transaction
- sendAtomic(pkt);
- assert(pkt->isResponse());
- // also ignore the latency in handling the response
- device->recvResponse(pkt);
- }
+ if (timing) {
+ schedTimingReq(pkt, curTick() + latency);
+ // The target handles cleaning up the packet in timing mode.
+ } else {
+ // ignore the latency involved in the atomic transaction
+ sendAtomic(pkt);
+ assert(pkt->isResponse());
+ // also ignore the latency in handling the response
+ device->recvResponse(pkt);
}
}
};