etherlink.cc (13766:4ecebdee8da4) etherlink.cc (13784:1941dc118243)
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 74 unchanged lines hidden (view full) ---

83{
84 delete link[0];
85 delete link[1];
86
87 delete interface[0];
88 delete interface[1];
89}
90
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 74 unchanged lines hidden (view full) ---

83{
84 delete link[0];
85 delete link[1];
86
87 delete interface[0];
88 delete interface[1];
89}
90
91EtherInt*
92EtherLink::getEthPort(const std::string &if_name, int idx)
91Port &
92EtherLink::getPort(const std::string &if_name, PortID idx)
93{
93{
94 Interface *i;
95 if (if_name == "int0")
94 if (if_name == "int0")
96 i = interface[0];
95 return *interface[0];
97 else if (if_name == "int1")
96 else if (if_name == "int1")
98 i = interface[1];
99 else
100 return NULL;
101 if (i->getPeer())
102 panic("interface already connected to\n");
103
104 return i;
97 return *interface[1];
98 return SimObject::getPort(if_name, idx);
105}
106
107
108EtherLink::Interface::Interface(const string &name, Link *tx, Link *rx)
109 : EtherInt(name), txlink(tx)
110{
111 tx->setTxInt(this);
112 rx->setRxInt(this);

--- 169 unchanged lines hidden ---
99}
100
101
102EtherLink::Interface::Interface(const string &name, Link *tx, Link *rx)
103 : EtherInt(name), txlink(tx)
104{
105 tx->setTxInt(this);
106 rx->setRxInt(this);

--- 169 unchanged lines hidden ---