summaryrefslogtreecommitdiff
path: root/src/dev/ns_gige.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:01 -0500
committerAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:01 -0500
commitdf02047d5a362296bde9d07dba6dba59516fa328 (patch)
treeb52f0bb518cee1c19c49061595defa29f0afcc68 /src/dev/ns_gige.hh
parentc0ab52799ca4ebd0a51363cfedd0658e6d79b842 (diff)
downloadgem5-df02047d5a362296bde9d07dba6dba59516fa328.tar.xz
dev: Fix ethernet device inheritance structure
The Python wrappers and the C++ should have the same object structure. If this is not the case, bad things will happen when the SWIG wrappers cast between an object and any of its base classes. This was not the case for NSGigE and Sinic devices. This patch makes NSGigE and Sinic inherit from the new EtherDevBase class, which in turn inherits from EtherDevice. As a bonus, this removes some duplicated statistics from the Sinic device.
Diffstat (limited to 'src/dev/ns_gige.hh')
-rw-r--r--src/dev/ns_gige.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dev/ns_gige.hh b/src/dev/ns_gige.hh
index 8032c0623..f4d0171d6 100644
--- a/src/dev/ns_gige.hh
+++ b/src/dev/ns_gige.hh
@@ -118,7 +118,7 @@ class Packet;
/**
* NS DP83820 Ethernet device model
*/
-class NSGigE : public EtherDevice
+class NSGigE : public EtherDevBase
{
public:
/** Transmit State Machine states */
@@ -346,7 +346,10 @@ class NSGigE : public EtherDevice
public:
typedef NSGigEParams Params;
- const Params *params() const { return (const Params *)_params; }
+ const Params *params() const {
+ return dynamic_cast<const Params *>(_params);
+ }
+
NSGigE(Params *params);
~NSGigE();