summaryrefslogtreecommitdiff
path: root/src/dev/arm/amba_device.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@gmail.com>2013-07-11 21:56:39 -0500
committerSteve Reinhardt <stever@gmail.com>2013-07-11 21:56:39 -0500
commit2737650a69f0c56d325c2d9cfd45eef099fbd581 (patch)
tree7e1a7030cdfb961d074729397b6f2c1e24f41e43 /src/dev/arm/amba_device.hh
parentb0b1c0205c438d382aaec54ee4b79b92e1a5e285 (diff)
downloadgem5-2737650a69f0c56d325c2d9cfd45eef099fbd581.tar.xz
dev/arm: get rid of AmbaDev namespace
It was confusing having an AmbaDev namespace along with an AmbaDevice class. The namespace stuff is now moved in to a new base AmbaDevice class, which is a mixin for classes AmbaPioDevice (the former AmbaDevice) and AmbaDmaDevice to provide the readId function as an inherited member function. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/dev/arm/amba_device.hh')
-rw-r--r--src/dev/arm/amba_device.hh37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/dev/arm/amba_device.hh b/src/dev/arm/amba_device.hh
index 6a3ed1c9e..d908ae616 100644
--- a/src/dev/arm/amba_device.hh
+++ b/src/dev/arm/amba_device.hh
@@ -54,35 +54,38 @@
#include "dev/io_device.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
-#include "params/AmbaDevice.hh"
+#include "params/AmbaPioDevice.hh"
#include "params/AmbaDmaDevice.hh"
#include "params/AmbaIntDevice.hh"
-namespace AmbaDev {
-const int AMBA_PER_ID0 = 0xFE0;
-const int AMBA_PER_ID1 = 0xFE4;
-const int AMBA_PER_ID2 = 0xFE8;
-const int AMBA_PER_ID3 = 0xFEC;
-const int AMBA_CEL_ID0 = 0xFF0;
-const int AMBA_CEL_ID1 = 0xFF4;
-const int AMBA_CEL_ID2 = 0xFF8;
-const int AMBA_CEL_ID3 = 0xFFC;
+class AmbaDevice
+{
+ protected:
+ static const int AMBA_PER_ID0 = 0xFE0;
+ static const int AMBA_PER_ID1 = 0xFE4;
+ static const int AMBA_PER_ID2 = 0xFE8;
+ static const int AMBA_PER_ID3 = 0xFEC;
+ static const int AMBA_CEL_ID0 = 0xFF0;
+ static const int AMBA_CEL_ID1 = 0xFF4;
+ static const int AMBA_CEL_ID2 = 0xFF8;
+ static const int AMBA_CEL_ID3 = 0xFFC;
+
+ bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr);
+};
-bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr);
-}
-class AmbaDevice : public BasicPioDevice
+class AmbaPioDevice : public BasicPioDevice, public AmbaDevice
{
protected:
uint64_t ambaId;
public:
- typedef AmbaDeviceParams Params;
- AmbaDevice(const Params *p);
+ typedef AmbaPioDeviceParams Params;
+ AmbaPioDevice(const Params *p);
};
-class AmbaIntDevice : public AmbaDevice
+class AmbaIntDevice : public AmbaPioDevice
{
protected:
int intNum;
@@ -94,7 +97,7 @@ class AmbaIntDevice : public AmbaDevice
AmbaIntDevice(const Params *p);
};
-class AmbaDmaDevice : public DmaDevice
+class AmbaDmaDevice : public DmaDevice, public AmbaDevice
{
protected:
uint64_t ambaId;