summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2004-02-02 15:45:22 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2004-02-02 15:45:22 -0800
commit956aff1291990639f8a59a95c6b22e0c17bb8cd8 (patch)
treeab01786ee2cada4cd0c7156de68a2ac85675ac0e /dev
parent7b07b0877f05cffa93b782a76a15791c1126216a (diff)
downloadgem5-956aff1291990639f8a59a95c6b22e0c17bb8cd8.tar.xz
More conversions of ref-counted parameters to references:
Statistics::NodePtr, StaticInstPtr, ethernet PacketPtr. base/statistics.hh: Change NodePtr parameters to Nodeptr &. cpu/exetrace.hh: Change StaticInstPtr parameters to StaticInstPtr &. dev/etherbus.cc: dev/etherbus.hh: dev/etherdump.cc: dev/etherdump.hh: dev/etherint.hh: dev/etherlink.cc: dev/etherlink.hh: dev/ethertap.cc: dev/ethertap.hh: change PacketPtr parameters to PacketPtr &. --HG-- extra : convert_revision : a778efdca33b0ec5beb76cf47db0e9e4728897ee
Diffstat (limited to 'dev')
-rw-r--r--dev/etherbus.cc2
-rw-r--r--dev/etherbus.hh2
-rw-r--r--dev/etherdump.cc2
-rw-r--r--dev/etherdump.hh4
-rw-r--r--dev/etherint.hh4
-rw-r--r--dev/etherlink.cc2
-rw-r--r--dev/etherlink.hh4
-rw-r--r--dev/ethertap.cc2
-rw-r--r--dev/ethertap.hh2
9 files changed, 12 insertions, 12 deletions
diff --git a/dev/etherbus.cc b/dev/etherbus.cc
index 3f6036f72..76697dd3e 100644
--- a/dev/etherbus.cc
+++ b/dev/etherbus.cc
@@ -81,7 +81,7 @@ EtherBus::reg(EtherInt *dev)
{ devlist.push_back(dev); }
bool
-EtherBus::send(EtherInt *sndr, PacketPtr pkt)
+EtherBus::send(EtherInt *sndr, PacketPtr &pkt)
{
if (busy()) {
DPRINTF(Ethernet, "ethernet packet not sent, bus busy\n", curTick);
diff --git a/dev/etherbus.hh b/dev/etherbus.hh
index f7f633303..9ef477808 100644
--- a/dev/etherbus.hh
+++ b/dev/etherbus.hh
@@ -73,7 +73,7 @@ class EtherBus : public SimObject
void txDone();
void reg(EtherInt *dev);
bool busy() const { return (bool)packet; }
- bool send(EtherInt *sender, PacketPtr packet);
+ bool send(EtherInt *sender, PacketPtr &packet);
};
#endif // __ETHERBUS_H__
diff --git a/dev/etherdump.cc b/dev/etherdump.cc
index 89f1ce382..6d86adc32 100644
--- a/dev/etherdump.cc
+++ b/dev/etherdump.cc
@@ -106,7 +106,7 @@ EtherDump::init()
}
void
-EtherDump::dumpPacket(PacketPtr packet)
+EtherDump::dumpPacket(PacketPtr &packet)
{
pcap_pkthdr pkthdr;
pkthdr.ts.tv_sec = curtime + (curTick / s_freq);
diff --git a/dev/etherdump.hh b/dev/etherdump.hh
index b3aefeb74..e22b66166 100644
--- a/dev/etherdump.hh
+++ b/dev/etherdump.hh
@@ -44,7 +44,7 @@ class EtherDump : public SimObject
{
private:
std::ofstream stream;
- void dumpPacket(PacketPtr packet);
+ void dumpPacket(PacketPtr &packet);
void init();
Tick curtime;
@@ -54,7 +54,7 @@ class EtherDump : public SimObject
public:
EtherDump(const std::string &name, const std::string &file);
- inline void dump(PacketPtr pkt) { if (stream.is_open()) dumpPacket(pkt); }
+ inline void dump(PacketPtr &pkt) { if (stream.is_open()) dumpPacket(pkt); }
};
#endif // __ETHERDUMP_H__
diff --git a/dev/etherint.hh b/dev/etherint.hh
index dfc9f6fd6..70e29eb7c 100644
--- a/dev/etherint.hh
+++ b/dev/etherint.hh
@@ -54,9 +54,9 @@ class EtherInt : public SimObject
virtual ~EtherInt() {}
void setPeer(EtherInt *p);
- virtual bool recvPacket(PacketPtr packet) = 0;
+ virtual bool recvPacket(PacketPtr &packet) = 0;
void recvDone() { peer->sendDone(); }
- bool sendPacket(PacketPtr packet)
+ bool sendPacket(PacketPtr &packet)
{
return peer ? peer->recvPacket(packet) : true;
}
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index c042cac34..676b1da1c 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -102,7 +102,7 @@ EtherLink::Link::txDone()
}
bool
-EtherLink::Link::transmit(PacketPtr pkt)
+EtherLink::Link::transmit(PacketPtr &pkt)
{
if (busy()) {
DPRINTF(Ethernet, "EtherLink packet not sent, link busy\n");
diff --git a/dev/etherlink.hh b/dev/etherlink.hh
index ef587faf7..895bac2e1 100644
--- a/dev/etherlink.hh
+++ b/dev/etherlink.hh
@@ -92,7 +92,7 @@ class EtherLink : public SimObject
virtual std::string name() const { return objName; }
bool busy() const { return (bool)packet; }
- bool transmit(PacketPtr packet);
+ bool transmit(PacketPtr &packet);
void setTxInt(Interface *i) { assert(!txint); txint = i; }
void setRxInt(Interface *i) { assert(!rxint); rxint = i; }
@@ -108,7 +108,7 @@ class EtherLink : public SimObject
public:
Interface(const std::string &name, Link *txlink, Link *rxlink);
- bool recvPacket(PacketPtr packet) { return txlink->transmit(packet); }
+ bool recvPacket(PacketPtr &packet) { return txlink->transmit(packet); }
void sendDone() { }
};
diff --git a/dev/ethertap.cc b/dev/ethertap.cc
index 339e7ac78..960d21d73 100644
--- a/dev/ethertap.cc
+++ b/dev/ethertap.cc
@@ -169,7 +169,7 @@ EtherTap::detach()
}
bool
-EtherTap::recvPacket(PacketPtr packet)
+EtherTap::recvPacket(PacketPtr &packet)
{
if (dump)
dump->dump(packet);
diff --git a/dev/ethertap.hh b/dev/ethertap.hh
index e2b1f640f..0b853a11d 100644
--- a/dev/ethertap.hh
+++ b/dev/ethertap.hh
@@ -94,7 +94,7 @@ class EtherTap : public EtherInt
EtherTap(const std::string &name, EtherDump *dump, int port, int bufsz);
virtual ~EtherTap();
- virtual bool recvPacket(PacketPtr packet);
+ virtual bool recvPacket(PacketPtr &packet);
virtual void sendDone();
virtual void serialize(std::ostream &os);