summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/port.cc17
-rw-r--r--src/mem/port.hh11
2 files changed, 15 insertions, 13 deletions
diff --git a/src/mem/port.cc b/src/mem/port.cc
index 0e03194c9..a666c968b 100644
--- a/src/mem/port.cc
+++ b/src/mem/port.cc
@@ -49,7 +49,7 @@ class DefaultPeerPort : public Port
public:
DefaultPeerPort()
- : Port("default_port")
+ : Port("default_port", NULL)
{ }
bool recvTiming(PacketPtr)
@@ -90,13 +90,9 @@ class DefaultPeerPort : public Port
DefaultPeerPort defaultPeerPort;
-Port::Port()
- : peer(&defaultPeerPort), owner(NULL)
-{
-}
-
Port::Port(const std::string &_name, MemObject *_owner)
- : portName(_name), peer(&defaultPeerPort), owner(_owner)
+ : EventManager(_owner), portName(_name), peer(&defaultPeerPort),
+ owner(_owner)
{
}
@@ -113,6 +109,13 @@ Port::setPeer(Port *port)
}
void
+Port::setOwner(MemObject *_owner)
+{
+ eventq = _owner->queue();
+ owner = _owner;
+}
+
+void
Port::removeConn()
{
if (peer->getOwner())
diff --git a/src/mem/port.hh b/src/mem/port.hh
index 15fda2164..1d9135ae6 100644
--- a/src/mem/port.hh
+++ b/src/mem/port.hh
@@ -47,6 +47,7 @@
#include "base/range.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
+#include "sim/eventq.hh"
/** This typedef is used to clean up the parameter list of
* getDeviceAddressRanges() and getPeerAddressRanges(). It's declared
@@ -58,6 +59,7 @@
typedef std::list<Range<Addr> > AddrRangeList;
typedef std::list<Range<Addr> >::iterator AddrRangeIter;
+class EventQueue;
class MemObject;
/**
@@ -71,7 +73,7 @@ class MemObject;
* Send accessor functions are being called from the device the port is
* associated with, and it will call the peer recv. accessor function.
*/
-class Port
+class Port : public EventManager
{
protected:
/** Descriptive name (for DPRINTF output) */
@@ -86,9 +88,6 @@ class Port
MemObject *owner;
public:
-
- Port();
-
/**
* Constructor.
*
@@ -97,7 +96,7 @@ class Port
* @param _owner Pointer to the MemObject that owns this port.
* Will not necessarily be set.
*/
- Port(const std::string &_name, MemObject *_owner = NULL);
+ Port(const std::string &_name, MemObject *_owner);
/** Return port name (for DPRINTF). */
const std::string &name() const { return portName; }
@@ -121,7 +120,7 @@ class Port
Port *getPeer() { return peer; }
/** Function to set the owner of this port. */
- void setOwner(MemObject *_owner) { owner = _owner; }
+ void setOwner(MemObject *_owner);
/** Function to return the owner of this port. */
MemObject *getOwner() { return owner; }