[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/23] target/arm: Move arm_debug_exception_fsr to debug_helpe
From: |
Richard Henderson |
Subject: |
[PATCH v3 08/23] target/arm: Move arm_debug_exception_fsr to debug_helper.c |
Date: |
Thu, 9 Jun 2022 13:28:46 -0700 |
This function now now only used in debug_helper.c, so there is
no reason to have a declaration in a header.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 25 -------------------------
target/arm/debug_helper.c | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 02fa70f75a..6f94f3019d 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -793,31 +793,6 @@ static inline TCR *regime_tcr(CPUARMState *env, ARMMMUIdx
mmu_idx)
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.
- */
-static inline uint32_t arm_debug_exception_fsr(CPUARMState *env)
-{
- ARMMMUFaultInfo fi = { .type = ARMFault_Debug };
- int target_el = arm_debug_target_el(env);
- bool using_lpae = false;
-
- if (target_el == 2 || arm_el_is_aa64(env, target_el)) {
- using_lpae = true;
- } else {
- if (arm_feature(env, ARM_FEATURE_LPAE) &&
- (env->cp15.tcr_el[target_el].raw_tcr & TTBCR_EAE)) {
- using_lpae = true;
- }
- }
-
- if (using_lpae) {
- return arm_fi_to_lfsc(&fi);
- } else {
- return arm_fi_to_sfsc(&fi);
- }
-}
-
/**
* arm_num_brps: Return number of implemented breakpoints.
* Note that the ID register BRPS field is "number of bps - 1",
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 80dff0788b..a743061e89 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -379,6 +379,32 @@ bool arm_debug_check_watchpoint(CPUState *cs,
CPUWatchpoint *wp)
return check_watchpoints(cpu);
}
+/*
+ * Return the FSR value for a debug exception (watchpoint, hardware
+ * breakpoint or BKPT insn) targeting the specified exception level.
+ */
+static uint32_t arm_debug_exception_fsr(CPUARMState *env)
+{
+ ARMMMUFaultInfo fi = { .type = ARMFault_Debug };
+ int target_el = arm_debug_target_el(env);
+ bool using_lpae = false;
+
+ if (target_el == 2 || arm_el_is_aa64(env, target_el)) {
+ using_lpae = true;
+ } else {
+ if (arm_feature(env, ARM_FEATURE_LPAE) &&
+ (env->cp15.tcr_el[target_el].raw_tcr & TTBCR_EAE)) {
+ using_lpae = true;
+ }
+ }
+
+ if (using_lpae) {
+ return arm_fi_to_lfsc(&fi);
+ } else {
+ return arm_fi_to_sfsc(&fi);
+ }
+}
+
void arm_debug_excp_handler(CPUState *cs)
{
/*
--
2.34.1
- [PATCH v3 00/23] target/arm: tidy exception routing, Richard Henderson, 2022/06/09
- [PATCH v3 01/23] target/arm: Mark exception helpers as noreturn, Richard Henderson, 2022/06/09
- [PATCH v3 02/23] target/arm: Add coproc parameter to syn_fp_access_trap, Richard Henderson, 2022/06/09
- [PATCH v3 04/23] target/arm: Move arm_singlestep_active out of line, Richard Henderson, 2022/06/09
- [PATCH v3 03/23] target/arm: Move exception_target_el out of line, Richard Henderson, 2022/06/09
- [PATCH v3 06/23] target/arm: Use is_a64 in arm_generate_debug_exceptions, Richard Henderson, 2022/06/09
- [PATCH v3 08/23] target/arm: Move arm_debug_exception_fsr to debug_helper.c,
Richard Henderson <=
- [PATCH v3 09/23] target/arm: Rename helper_exception_with_syndrome, Richard Henderson, 2022/06/09
- [PATCH v3 07/23] target/arm: Move exception_bkpt_insn to debug_helper.c, Richard Henderson, 2022/06/09
- [PATCH v3 10/23] target/arm: Introduce gen_exception_insn_el_v, Richard Henderson, 2022/06/09
- [PATCH v3 11/23] target/arm: Rename gen_exception_insn to gen_exception_insn_el, Richard Henderson, 2022/06/09
- [PATCH v3 12/23] target/arm: Introduce gen_exception_insn, Richard Henderson, 2022/06/09
- [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