ARM: Add support for running multiple systems
[gem5.git] / src / dev / etherint.hh
index dfc224ecc55c8f1a79f41c888a2627156c8749cb..98b820dbf0ee080863328eb465abbe963426f2dc 100644 (file)
 #include <string>
 
 #include "dev/etherpkt.hh"
-#include "sim/sim_object.hh"
 
 /*
  * Class representing the actual interface between two ethernet
  * components.  These components are intended to attach to another
  * ethernet interface on one side and whatever device on the other.
  */
-class EtherInt : public SimObject
+class EtherInt
 {
   protected:
+    mutable std::string portName;
     EtherInt *peer;
 
   public:
-    EtherInt(const std::string &name) : SimObject(name), peer(NULL) {}
+    EtherInt(const std::string &name)
+        : portName(name), peer(NULL) {}
     virtual ~EtherInt() {}
 
+    /** Return port name (for DPRINTF). */
+    const std::string &name() const { return portName; }
+
     void setPeer(EtherInt *p);
+    EtherInt* getPeer() { return peer; }
 
     void recvDone() { peer->sendDone(); }
     virtual void sendDone() = 0;
@@ -63,6 +68,9 @@ class EtherInt : public SimObject
     bool sendPacket(EthPacketPtr packet)
     { return peer ? peer->recvPacket(packet) : true; }
     virtual bool recvPacket(EthPacketPtr packet) = 0;
+
+    bool askBusy() {return peer->isBusy(); }
+    virtual bool isBusy() { return false; }
 };
 
 #endif // __DEV_ETHERINT_HH__