[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/25] target/arm: Move exception_target_el out of line
From: |
Richard Henderson |
Subject: |
[PATCH v2 04/25] target/arm: Move exception_target_el out of line |
Date: |
Mon, 6 Jun 2022 19:47:13 -0700 |
Move the function to op_helper.c, near raise_exception.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 16 +---------------
target/arm/op_helper.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index b654bee468..36c33a6ac5 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -1090,21 +1090,6 @@ typedef struct ARMVAParameters {
ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va,
ARMMMUIdx mmu_idx, bool data);
-static inline int exception_target_el(CPUARMState *env)
-{
- int target_el = MAX(1, arm_current_el(env));
-
- /*
- * No such thing as secure EL1 if EL3 is aarch32,
- * so update the target EL to EL3 in this case.
- */
- if (arm_is_secure(env) && !arm_el_is_aa64(env, 3) && target_el == 1) {
- target_el = 3;
- }
-
- return target_el;
-}
-
/* Determine if allocation tags are available. */
static inline bool allocation_tag_access_enabled(CPUARMState *env, int el,
uint64_t sctlr)
@@ -1329,5 +1314,6 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu);
#endif
void aa32_max_features(ARMCPU *cpu);
+int exception_target_el(CPUARMState *env);
#endif
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
index 67b7dbeaa9..00a082d1f7 100644
--- a/target/arm/op_helper.c
+++ b/target/arm/op_helper.c
@@ -28,6 +28,21 @@
#define SIGNBIT (uint32_t)0x80000000
#define SIGNBIT64 ((uint64_t)1 << 63)
+int exception_target_el(CPUARMState *env)
+{
+ int target_el = MAX(1, arm_current_el(env));
+
+ /*
+ * No such thing as secure EL1 if EL3 is aarch32,
+ * so update the target EL to EL3 in this case.
+ */
+ if (arm_is_secure(env) && !arm_el_is_aa64(env, 3) && target_el == 1) {
+ target_el = 3;
+ }
+
+ return target_el;
+}
+
void raise_exception(CPUARMState *env, uint32_t excp,
uint32_t syndrome, uint32_t target_el)
{
--
2.34.1
- [PATCH v2 00/25] target/arm: tidy exception routing, Richard Henderson, 2022/06/06
- [PATCH v2 02/25] target/arm: Add coproc parameter to syn_fp_access_trap, Richard Henderson, 2022/06/06
- [PATCH v2 01/25] target/arm: Mark exception helpers as noreturn, Richard Henderson, 2022/06/06
- [PATCH v2 04/25] target/arm: Move exception_target_el out of line,
Richard Henderson <=
- [PATCH v2 05/25] target/arm: Move arm_singlestep_active out of line, Richard Henderson, 2022/06/06
- [PATCH v2 07/25] target/arm: Use is_a64 in arm_generate_debug_exceptions, Richard Henderson, 2022/06/06
- [PATCH v2 03/25] target/arm: Move fp access syndrome adjust out of raise_exception, Richard Henderson, 2022/06/06
- [PATCH v2 06/25] target/arm: Move arm_generate_debug_exceptions out of line, Richard Henderson, 2022/06/06
- [PATCH v2 08/25] target/arm: Move exception_bkpt_insn to debug_helper.c, Richard Henderson, 2022/06/06
- [PATCH v2 09/25] target/arm: Move arm_debug_exception_fsr to debug_helper.c, Richard Henderson, 2022/06/06