dev-arm: Add read/writeBanked helpers to GICv3
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 2 Sep 2019 09:28:12 +0000 (10:28 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 6 Sep 2019 20:00:34 +0000 (20:00 +0000)
These will be used by AA64 security banked registers in GICv3.

Change-Id: Ia980c4f5c14187ab9c18da1d1d596562644111ae
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20624
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/gic_v3_cpu_interface.cc
src/dev/arm/gic_v3_cpu_interface.hh

index cc630b4d28dde75ca03c374dac14f269a9537188..d3d73a32f66ec68054773e103c8a2276b6b74af4 100644 (file)
@@ -1623,6 +1623,20 @@ Gicv3CPUInterface::setMiscReg(int misc_reg, RegVal val)
     }
 }
 
+RegVal
+Gicv3CPUInterface::readBankedMiscReg(MiscRegIndex misc_reg) const
+{
+    return isa->readMiscRegNoEffect(
+        isa->snsBankedIndex64(misc_reg, !isSecureBelowEL3()));
+}
+
+void
+Gicv3CPUInterface::setBankedMiscReg(MiscRegIndex misc_reg, RegVal val) const
+{
+    isa->setMiscRegNoEffect(
+        isa->snsBankedIndex64(misc_reg, !isSecureBelowEL3()), val);
+}
+
 int
 Gicv3CPUInterface::virtualFindActive(uint32_t int_id) const
 {
index 56a66952cd90e23fd630e60e317304f9797a596d..9e1c9a09f545edf88ad19be964b9ffff34a90aaf 100644 (file)
@@ -338,6 +338,8 @@ class Gicv3CPUInterface : public ArmISA::BaseISADevice, public Serializable
     void virtualUpdate();
     RegVal bpr1(Gicv3::GroupId group);
 
+    RegVal readBankedMiscReg(MiscRegIndex misc_reg) const;
+    void setBankedMiscReg(MiscRegIndex misc_reg, RegVal val) const;
   public:
 
     Gicv3CPUInterface(Gicv3 * gic, uint32_t cpu_id);