[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 22/23] target/arm: Move arm_debug_target_el to debug_helper.c
From: |
Richard Henderson |
Subject: |
[PATCH v3 22/23] target/arm: Move arm_debug_target_el to debug_helper.c |
Date: |
Thu, 9 Jun 2022 13:29:00 -0700 |
This function is no longer used outside debug_helper.c.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.h | 21 ---------------------
target/arm/debug_helper.c | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 719613ad9e..161ac9fa2e 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2986,27 +2986,6 @@ typedef enum ARMASIdx {
ARMASIdx_TagS = 3,
} ARMASIdx;
-/* Return the Exception Level targeted by debug exceptions. */
-static inline int arm_debug_target_el(CPUARMState *env)
-{
- bool secure = arm_is_secure(env);
- bool route_to_el2 = false;
-
- if (arm_is_el2_enabled(env)) {
- route_to_el2 = env->cp15.hcr_el2 & HCR_TGE ||
- env->cp15.mdcr_el2 & MDCR_TDE;
- }
-
- if (route_to_el2) {
- return 2;
- } else if (arm_feature(env, ARM_FEATURE_EL3) &&
- !arm_el_is_aa64(env, 3) && secure) {
- return 3;
- } else {
- return 1;
- }
-}
-
static inline bool arm_v7m_csselr_razwi(ARMCPU *cpu)
{
/* If all the CLIDR.Ctypem bits are 0 there are no caches, and
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 26004df99b..b18a6bd3a2 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -12,6 +12,27 @@
#include "exec/helper-proto.h"
+/* Return the Exception Level targeted by debug exceptions. */
+static int arm_debug_target_el(CPUARMState *env)
+{
+ bool secure = arm_is_secure(env);
+ bool route_to_el2 = false;
+
+ if (arm_is_el2_enabled(env)) {
+ route_to_el2 = env->cp15.hcr_el2 & HCR_TGE ||
+ env->cp15.mdcr_el2 & MDCR_TDE;
+ }
+
+ if (route_to_el2) {
+ return 2;
+ } else if (arm_feature(env, ARM_FEATURE_EL3) &&
+ !arm_el_is_aa64(env, 3) && secure) {
+ return 3;
+ } else {
+ return 1;
+ }
+}
+
/*
* Raise an exception to the debug target el.
* Modify syndrome to indicate when origin and target EL are the same.
--
2.34.1
- [PATCH v3 13/23] target/arm: Create helper_exception_swstep, (continued)
- [PATCH v3 13/23] target/arm: Create helper_exception_swstep, Richard Henderson, 2022/06/09
- [PATCH v3 17/23] target/arm: Introduce gen_exception, Richard Henderson, 2022/06/09
- [PATCH v3 16/23] target/arm: Rename gen_exception to gen_exception_el, Richard Henderson, 2022/06/09
- [PATCH v3 05/23] target/arm: Move arm_generate_debug_exceptions out of line, Richard Henderson, 2022/06/09
- [PATCH v3 18/23] target/arm: Introduce gen_exception_el_v, Richard Henderson, 2022/06/09
- [PATCH v3 15/23] target/arm: Move gen_exception to translate.c, Richard Henderson, 2022/06/09
- [PATCH v3 14/23] target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL, Richard Henderson, 2022/06/09
- [PATCH v3 21/23] target/arm: Create raise_exception_debug, Richard Henderson, 2022/06/09
- [PATCH v3 19/23] target/arm: Introduce helper_exception_with_syndrome, Richard Henderson, 2022/06/09
- [PATCH v3 20/23] target/arm: Remove default_exception_el, Richard Henderson, 2022/06/09
- [PATCH v3 22/23] target/arm: Move arm_debug_target_el to debug_helper.c,
Richard Henderson <=
- [PATCH v3 23/23] target/arm: Fix Secure PL1 tests in fp_exception_el, Richard Henderson, 2022/06/09
- Re: [PATCH v3 00/23] target/arm: tidy exception routing, Peter Maydell, 2022/06/10