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();
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;
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();
* Return the node pointer.
* @return the node pointer.
*/
- operator NodePtr() { return node;}
+ operator NodePtr&() { return node;}
public:
/**
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)
{
{ 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);
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__
}
void
-EtherDump::dumpPacket(PacketPtr packet)
+EtherDump::dumpPacket(PacketPtr &packet)
{
pcap_pkthdr pkthdr;
pkthdr.ts.tv_sec = curtime + (curTick / s_freq);
{
private:
std::ofstream stream;
- void dumpPacket(PacketPtr packet);
+ void dumpPacket(PacketPtr &packet);
void init();
Tick curtime;
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__
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;
}
}
bool
-EtherLink::Link::transmit(PacketPtr pkt)
+EtherLink::Link::transmit(PacketPtr &pkt)
{
if (busy()) {
DPRINTF(Ethernet, "EtherLink packet not sent, link busy\n");
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; }
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() { }
};
}
bool
-EtherTap::recvPacket(PacketPtr packet)
+EtherTap::recvPacket(PacketPtr &packet)
{
if (dump)
dump->dump(packet);
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);