[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 21/42] target/arm: Move regime_el to internals.h
From: |
Richard Henderson |
Subject: |
[PATCH v6 21/42] target/arm: Move regime_el to internals.h |
Date: |
Thu, 12 Mar 2020 12:41:58 -0700 |
We will shortly need this in mte_helper.c as well.
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/internals.h | 36 ++++++++++++++++++++++++++++++++++++
target/arm/helper.c | 36 ------------------------------------
2 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 3190fc40fc..f091891312 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -912,6 +912,42 @@ static inline bool regime_is_pan(CPUARMState *env,
ARMMMUIdx mmu_idx)
}
}
+/* Return the exception level which controls this address translation regime */
+static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx)
+{
+ switch (mmu_idx) {
+ case ARMMMUIdx_E20_0:
+ case ARMMMUIdx_E20_2:
+ case ARMMMUIdx_E20_2_PAN:
+ case ARMMMUIdx_Stage2:
+ case ARMMMUIdx_E2:
+ return 2;
+ case ARMMMUIdx_SE3:
+ return 3;
+ case ARMMMUIdx_SE10_0:
+ return arm_el_is_aa64(env, 3) ? 1 : 3;
+ case ARMMMUIdx_SE10_1:
+ case ARMMMUIdx_SE10_1_PAN:
+ case ARMMMUIdx_Stage1_E0:
+ case ARMMMUIdx_Stage1_E1:
+ case ARMMMUIdx_Stage1_E1_PAN:
+ case ARMMMUIdx_E10_0:
+ case ARMMMUIdx_E10_1:
+ case ARMMMUIdx_E10_1_PAN:
+ case ARMMMUIdx_MPrivNegPri:
+ case ARMMMUIdx_MUserNegPri:
+ case ARMMMUIdx_MPriv:
+ case ARMMMUIdx_MUser:
+ case ARMMMUIdx_MSPrivNegPri:
+ case ARMMMUIdx_MSUserNegPri:
+ case ARMMMUIdx_MSPriv:
+ case ARMMMUIdx_MSUser:
+ return 1;
+ default:
+ g_assert_not_reached();
+ }
+}
+
/* Return the FSR value for a debug exception (watchpoint, hardware
* breakpoint or BKPT insn) targeting the specified exception level.
*/
diff --git a/target/arm/helper.c b/target/arm/helper.c
index f9daeec1f4..2a50d4e9a2 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9753,42 +9753,6 @@ void arm_cpu_do_interrupt(CPUState *cs)
}
#endif /* !CONFIG_USER_ONLY */
-/* Return the exception level which controls this address translation regime */
-static uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx)
-{
- switch (mmu_idx) {
- case ARMMMUIdx_E20_0:
- case ARMMMUIdx_E20_2:
- case ARMMMUIdx_E20_2_PAN:
- case ARMMMUIdx_Stage2:
- case ARMMMUIdx_E2:
- return 2;
- case ARMMMUIdx_SE3:
- return 3;
- case ARMMMUIdx_SE10_0:
- return arm_el_is_aa64(env, 3) ? 1 : 3;
- case ARMMMUIdx_SE10_1:
- case ARMMMUIdx_SE10_1_PAN:
- case ARMMMUIdx_Stage1_E0:
- case ARMMMUIdx_Stage1_E1:
- case ARMMMUIdx_Stage1_E1_PAN:
- case ARMMMUIdx_E10_0:
- case ARMMMUIdx_E10_1:
- case ARMMMUIdx_E10_1_PAN:
- case ARMMMUIdx_MPrivNegPri:
- case ARMMMUIdx_MUserNegPri:
- case ARMMMUIdx_MPriv:
- case ARMMMUIdx_MUser:
- case ARMMMUIdx_MSPrivNegPri:
- case ARMMMUIdx_MSUserNegPri:
- case ARMMMUIdx_MSPriv:
- case ARMMMUIdx_MSUser:
- return 1;
- default:
- g_assert_not_reached();
- }
-}
-
uint64_t arm_sctlr(CPUARMState *env, int el)
{
/* Only EL0 needs to be adjusted for EL1&0 or EL2&0. */
--
2.20.1
- [PATCH v6 11/42] target/arm: Implement the GMI instruction, (continued)
- [PATCH v6 11/42] target/arm: Implement the GMI instruction, Richard Henderson, 2020/03/12
- [PATCH v6 12/42] target/arm: Implement the SUBP instruction, Richard Henderson, 2020/03/12
- [PATCH v6 08/42] target/arm: Add MTE bits to tb_flags, Richard Henderson, 2020/03/12
- [PATCH v6 10/42] target/arm: Implement the ADDG, SUBG instructions, Richard Henderson, 2020/03/12
- [PATCH v6 14/42] target/arm: Add helper_probe_access, Richard Henderson, 2020/03/12
- [PATCH v6 13/42] target/arm: Define arm_cpu_do_unaligned_access for user-only, Richard Henderson, 2020/03/12
- [PATCH v6 16/42] target/arm: Implement the STGP instruction, Richard Henderson, 2020/03/12
- [PATCH v6 15/42] target/arm: Implement LDG, STG, ST2G instructions, Richard Henderson, 2020/03/12
- [PATCH v6 17/42] target/arm: Restrict the values of DCZID.BS under TCG, Richard Henderson, 2020/03/12
- [PATCH v6 20/42] target/arm: Implement the access tag cache flushes, Richard Henderson, 2020/03/12
- [PATCH v6 21/42] target/arm: Move regime_el to internals.h,
Richard Henderson <=
- [PATCH v6 18/42] target/arm: Simplify DC_ZVA, Richard Henderson, 2020/03/12
- [PATCH v6 22/42] target/arm: Move regime_tcr to internals.h, Richard Henderson, 2020/03/12
- [PATCH v6 19/42] target/arm: Implement the LDGM, STGM, STZGM instructions, Richard Henderson, 2020/03/12
- [PATCH v6 23/42] target/arm: Add gen_mte_check1, Richard Henderson, 2020/03/12
- [PATCH v6 24/42] target/arm: Add gen_mte_checkN, Richard Henderson, 2020/03/12
- [PATCH v6 25/42] target/arm: Implement helper_mte_check1, Richard Henderson, 2020/03/12
- [PATCH v6 26/42] target/arm: Implement helper_mte_checkN, Richard Henderson, 2020/03/12
- [PATCH v6 27/42] target/arm: Add helper_mte_check_zva, Richard Henderson, 2020/03/12
- [PATCH v6 28/42] target/arm: Use mte_checkN for sve unpredicated loads, Richard Henderson, 2020/03/12
- [PATCH v6 29/42] target/arm: Use mte_checkN for sve unpredicated stores, Richard Henderson, 2020/03/12