summaryrefslogtreecommitdiff
path: root/src/dev/arm
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/arm')
-rw-r--r--src/dev/arm/base_gic.hh13
-rw-r--r--src/dev/arm/gic_pl390.hh20
2 files changed, 26 insertions, 7 deletions
diff --git a/src/dev/arm/base_gic.hh b/src/dev/arm/base_gic.hh
index facc99084..cd16c0362 100644
--- a/src/dev/arm/base_gic.hh
+++ b/src/dev/arm/base_gic.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013 ARM Limited
+ * Copyright (c) 2012-2013, 2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -92,4 +92,15 @@ class BaseGic : public PioDevice
Platform *platform;
};
+class BaseGicRegisters
+{
+ public:
+ virtual uint32_t readDistributor(ContextID ctx, Addr daddr) = 0;
+ virtual uint32_t readCpu(ContextID ctx, Addr daddr) = 0;
+
+ virtual void writeDistributor(ContextID ctx, Addr daddr,
+ uint32_t data) = 0;
+ virtual void writeCpu(ContextID ctx, Addr daddr, uint32_t data) = 0;
+};
+
#endif
diff --git a/src/dev/arm/gic_pl390.hh b/src/dev/arm/gic_pl390.hh
index 8beb5e2d5..6f819bf65 100644
--- a/src/dev/arm/gic_pl390.hh
+++ b/src/dev/arm/gic_pl390.hh
@@ -58,7 +58,7 @@
#include "dev/platform.hh"
#include "params/Pl390.hh"
-class Pl390 : public BaseGic
+class Pl390 : public BaseGic, public BaseGicRegisters
{
protected:
// distributor memory addresses
@@ -404,26 +404,34 @@ class Pl390 : public BaseGic
* @param pkt packet to respond to
*/
Tick readDistributor(PacketPtr pkt);
- uint32_t readDistributor(ContextID ctx, Addr daddr, size_t resp_sz);
+ uint32_t readDistributor(ContextID ctx, Addr daddr,
+ size_t resp_sz);
+ uint32_t readDistributor(ContextID ctx, Addr daddr) override {
+ return readDistributor(ctx, daddr, 4);
+ }
/** Handle a read to the cpu portion of the GIC
* @param pkt packet to respond to
*/
Tick readCpu(PacketPtr pkt);
- uint32_t readCpu(ContextID ctx, Addr daddr);
+ uint32_t readCpu(ContextID ctx, Addr daddr) override;
/** Handle a write to the distributor portion of the GIC
* @param pkt packet to respond to
*/
Tick writeDistributor(PacketPtr pkt);
- void writeDistributor(ContextID ctx, Addr daddr, uint32_t data,
- size_t data_sz);
+ void writeDistributor(ContextID ctx, Addr daddr,
+ uint32_t data, size_t data_sz);
+ void writeDistributor(ContextID ctx, Addr daddr,
+ uint32_t data) override {
+ return writeDistributor(ctx, daddr, data, 4);
+ }
/** Handle a write to the cpu portion of the GIC
* @param pkt packet to respond to
*/
Tick writeCpu(PacketPtr pkt);
- void writeCpu(ContextID ctx, Addr daddr, uint32_t data);
+ void writeCpu(ContextID ctx, Addr daddr, uint32_t data) override;
};
#endif //__DEV_ARM_GIC_H__