arm: Use static_cast to get access the ARM specific ISA functions.
authorGabe Black <gabeblack@google.com>
Sun, 2 Feb 2020 23:27:41 +0000 (15:27 -0800)
committerGabe Black <gabeblack@google.com>
Wed, 5 Feb 2020 22:41:12 +0000 (22:41 +0000)
Change-Id: I8d237fa60c0fc17c97ed351afd0fa3c623262f0d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25006
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/insts/misc64.cc
src/arch/arm/insts/static_inst.cc
src/arch/arm/miscregs.cc
src/arch/arm/utility.cc

index 0c263fb6547c119e89859da4d0c4f253f3767067..9bb4026c49a0089b93756e006dbbc173b52a36d2 100644 (file)
@@ -269,13 +269,19 @@ MiscRegOp64::checkEL2Trap(ThreadContext *tc, const MiscRegIndex misc_reg,
             break;
           // GICv3 regs
           case MISCREG_ICC_SGI0R_EL1:
-            if (tc->getIsaPtr()->haveGICv3CpuIfc())
-                trap_to_hyp = hcr.fmo && el == EL1;
+            {
+                auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+                if (isa->haveGICv3CpuIfc())
+                    trap_to_hyp = hcr.fmo && el == EL1;
+            }
             break;
           case MISCREG_ICC_SGI1R_EL1:
           case MISCREG_ICC_ASGI1R_EL1:
-            if (tc->getIsaPtr()->haveGICv3CpuIfc())
-                trap_to_hyp = hcr.imo && el == EL1;
+            {
+                auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+                if (isa->haveGICv3CpuIfc())
+                    trap_to_hyp = hcr.imo && el == EL1;
+            }
             break;
           default:
             break;
index 1f849b9710c1d04cac640698baaa111a412a509b..644cafd85285ef6595ecce01616a4b0d9757c435 100644 (file)
@@ -1166,7 +1166,8 @@ ArmStaticInst::generalExceptionsToAArch64(ThreadContext *tc,
 unsigned
 ArmStaticInst::getCurSveVecLenInBits(ThreadContext *tc)
 {
-    return tc->getIsaPtr()->getCurSveVecLenInBits(tc);
+    auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+    return isa->getCurSveVecLenInBits(tc);
 }
 
 }
index 87e130c2b56e12e84ba73027e3f414d92a79123e..4785f00cd9a1d45545b05af6809eeaf41a0ce020 100644 (file)
@@ -1080,8 +1080,9 @@ snsBankedIndex(MiscRegIndex reg, ThreadContext *tc, bool ns)
 int
 snsBankedIndex64(MiscRegIndex reg, ThreadContext *tc)
 {
+    auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
     SCR scr = tc->readMiscReg(MISCREG_SCR);
-    return tc->getIsaPtr()->snsBankedIndex64(reg, scr.ns);
+    return isa->snsBankedIndex64(reg, scr.ns);
 }
 
 /**
index e8ca13d0efa36b8a9368bb706f2983b62d21f7d9..44bc7372e6a294f9de6df205bd65be0573eae7cd 100644 (file)
@@ -612,13 +612,19 @@ mcrMrc15TrapToHyp(const MiscRegIndex miscReg, ThreadContext *tc, uint32_t iss)
                 break;
               // GICv3 regs
               case MISCREG_ICC_SGI0R:
-                if (tc->getIsaPtr()->haveGICv3CpuIfc())
-                    trapToHype = hcr.fmo;
+                {
+                    auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+                    if (isa->haveGICv3CpuIfc())
+                        trapToHype = hcr.fmo;
+                }
                 break;
               case MISCREG_ICC_SGI1R:
               case MISCREG_ICC_ASGI1R:
-                if (tc->getIsaPtr()->haveGICv3CpuIfc())
-                    trapToHype = hcr.imo;
+                {
+                    auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+                    if (isa->haveGICv3CpuIfc())
+                        trapToHype = hcr.imo;
+                }
                 break;
               // No default action needed
               default: