summaryrefslogtreecommitdiff
path: root/src/dev/x86/intdev.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/x86/intdev.hh')
-rw-r--r--src/dev/x86/intdev.hh65
1 files changed, 29 insertions, 36 deletions
diff --git a/src/dev/x86/intdev.hh b/src/dev/x86/intdev.hh
index 0cc2be032..1a198db62 100644
--- a/src/dev/x86/intdev.hh
+++ b/src/dev/x86/intdev.hh
@@ -54,34 +54,40 @@
namespace X86ISA {
-typedef std::list<int> ApicList;
-
-class IntDevice
+template <class Device>
+class IntSlavePort : public SimpleTimingPort
{
- protected:
- class IntSlavePort : public MessageSlavePort
+ Device * device;
+
+ public:
+ IntSlavePort(const std::string& _name, SimObject* _parent,
+ Device* dev) :
+ SimpleTimingPort(_name, _parent), device(dev)
{
- IntDevice * device;
+ }
- public:
- IntSlavePort(const std::string& _name, SimObject* _parent,
- IntDevice* dev) :
- MessageSlavePort(_name, _parent), device(dev)
- {
- }
+ AddrRangeList
+ getAddrRanges() const
+ {
+ return device->getIntAddrRange();
+ }
- AddrRangeList getAddrRanges() const
- {
- return device->getIntAddrRange();
- }
+ Tick
+ recvAtomic(PacketPtr pkt)
+ {
+ panic_if(pkt->cmd != MemCmd::MessageReq,
+ "%s received unexpected command %s from %s.\n",
+ name(), pkt->cmd.toString(), getPeer());
+ pkt->headerDelay = pkt->payloadDelay = 0;
+ return device->recvMessage(pkt);
+ }
+};
- Tick recvMessage(PacketPtr pkt)
- {
- // @todo someone should pay for this
- pkt->headerDelay = pkt->payloadDelay = 0;
- return device->recvMessage(pkt);
- }
- };
+typedef std::list<int> ApicList;
+
+class IntDevice
+{
+ protected:
class IntMasterPort : public MessageMasterPort
{
@@ -119,24 +125,11 @@ class IntDevice
virtual void init();
virtual Tick
- recvMessage(PacketPtr pkt)
- {
- panic("recvMessage not implemented.\n");
- return 0;
- }
-
- virtual Tick
recvResponse(PacketPtr pkt)
{
panic("recvResponse not implemented.\n");
return 0;
}
-
- virtual AddrRangeList
- getIntAddrRange() const
- {
- panic("intAddrRange not implemented.\n");
- }
};
} // namespace X86ISA