diff options
author | Gabe Black <gabeblack@google.com> | 2019-03-07 00:33:53 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-03-15 18:37:49 +0000 |
commit | 6e8be00dff5717ba6bd066749d1847ea48680878 (patch) | |
tree | fcf564fc8be09f570e597388c1231ccf50b12915 /src/dev/net | |
parent | a73069c87dab6d32d5de021d37e009a93cd50cac (diff) | |
download | gem5-6e8be00dff5717ba6bd066749d1847ea48680878.tar.xz |
dev: Make EtherInt inherit from Port.
This way a common function can return EtherInt (and master and slave
ports).
Change-Id: I1215baaad918ef0352b228877241b2b6dd2503fc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17035
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/dev/net')
-rw-r--r-- | src/dev/net/etherint.hh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dev/net/etherint.hh b/src/dev/net/etherint.hh index a11d02681..77032208c 100644 --- a/src/dev/net/etherint.hh +++ b/src/dev/net/etherint.hh @@ -39,21 +39,22 @@ #include <string> #include "dev/net/etherpkt.hh" +#include "mem/port.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 +class EtherInt : public Port { protected: mutable std::string portName; EtherInt *peer; public: - EtherInt(const std::string &name) - : portName(name), peer(NULL) {} + EtherInt(const std::string &name, int idx=InvalidPortID) + : Port(name, idx), portName(name), peer(NULL) {} virtual ~EtherInt() {} /** Return port name (for DPRINTF). */ |