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
This commit is contained in:
parent
7b07b0877f
commit
956aff1291
11 changed files with 19 additions and 18 deletions
|
@ -2067,7 +2067,7 @@ class UnaryNode : public Node
|
|||
mutable rvec_t result;
|
||||
|
||||
public:
|
||||
UnaryNode(NodePtr p) : l(p) {}
|
||||
UnaryNode(NodePtr &p) : l(p) {}
|
||||
|
||||
const rvec_t &val() const {
|
||||
const rvec_t &lvec = l->val();
|
||||
|
@ -2110,7 +2110,7 @@ class BinaryNode : public Node
|
|||
mutable rvec_t result;
|
||||
|
||||
public:
|
||||
BinaryNode(NodePtr a, NodePtr b) : l(a), r(b) {}
|
||||
BinaryNode(NodePtr &a, NodePtr &b) : l(a), r(b) {}
|
||||
|
||||
const rvec_t &val() const {
|
||||
Op op;
|
||||
|
@ -2179,7 +2179,7 @@ class SumNode : public Node
|
|||
mutable rvec_t result;
|
||||
|
||||
public:
|
||||
SumNode(NodePtr p) : l(p), result(1) {}
|
||||
SumNode(NodePtr &p) : l(p), result(1) {}
|
||||
|
||||
const rvec_t &val() const {
|
||||
const rvec_t &lvec = l->val();
|
||||
|
@ -2999,7 +2999,7 @@ class Temp
|
|||
* Return the node pointer.
|
||||
* @return the node pointer.
|
||||
*/
|
||||
operator NodePtr() { return node;}
|
||||
operator NodePtr&() { return node;}
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -91,8 +91,9 @@ class InstRecord : public Record
|
|||
bool regs_valid;
|
||||
|
||||
public:
|
||||
InstRecord(Tick _cycle, BaseCPU *_cpu, StaticInstPtr<TheISA> _staticInst,
|
||||
Addr _pc, bool spec, unsigned _thread)
|
||||
InstRecord(Tick _cycle, BaseCPU *_cpu,
|
||||
const StaticInstPtr<TheISA> &_staticInst,
|
||||
Addr _pc, bool spec, int _thread)
|
||||
: Record(_cycle), cpu(_cpu), staticInst(_staticInst), PC(_pc),
|
||||
misspeculating(spec), thread(_thread)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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() { }
|
||||
};
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ EtherTap::detach()
|
|||
}
|
||||
|
||||
bool
|
||||
EtherTap::recvPacket(PacketPtr packet)
|
||||
EtherTap::recvPacket(PacketPtr &packet)
|
||||
{
|
||||
if (dump)
|
||||
dump->dump(packet);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue