summaryrefslogtreecommitdiffstats
path: root/target/arm/internals.h
diff options
context:
space:
mode:
authorRichard Henderson2020-06-26 05:31:20 +0200
committerPeter Maydell2020-06-26 15:31:12 +0200
commit38659d311d05e6c5feff6bddcc1c33b60d3b86a1 (patch)
treef9b2b3228ae19e58479acf5a248bcc489f72cc30 /target/arm/internals.h
parenttarget/arm: Move regime_el to internals.h (diff)
downloadqemu-38659d311d05e6c5feff6bddcc1c33b60d3b86a1.tar.gz
qemu-38659d311d05e6c5feff6bddcc1c33b60d3b86a1.tar.xz
qemu-38659d311d05e6c5feff6bddcc1c33b60d3b86a1.zip
target/arm: Move regime_tcr to internals.h
We will shortly need this in mte_helper.c as well. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200626033144.790098-23-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/internals.h')
-rw-r--r--target/arm/internals.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/target/arm/internals.h b/target/arm/internals.h
index c36fcb151b..7c9abbabc9 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -949,6 +949,15 @@ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx)
}
}
+/* Return the TCR controlling this translation regime */
+static inline TCR *regime_tcr(CPUARMState *env, ARMMMUIdx mmu_idx)
+{
+ if (mmu_idx == ARMMMUIdx_Stage2) {
+ return &env->cp15.vtcr_el2;
+ }
+ return &env->cp15.tcr_el[regime_el(env, mmu_idx)];
+}
+
/* Return the FSR value for a debug exception (watchpoint, hardware
* breakpoint or BKPT insn) targeting the specified exception level.
*/