[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/21] target/arm: Export arm_v7m_mrs_control
From: |
Peter Maydell |
Subject: |
[PULL 12/21] target/arm: Export arm_v7m_mrs_control |
Date: |
Mon, 6 Mar 2023 15:34:26 +0000 |
From: David Reiss <dreiss@meta.com>
Allow the function to be used outside of m_helper.c.
Rename with an "arm_" prefix.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-13-richard.henderson@linaro.org
[rth: Split out of a larger patch]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/internals.h | 3 +++
target/arm/tcg/m_helper.c | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index dda89aa5dff..086e88e2377 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -1357,6 +1357,9 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp);
void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp);
#endif
+/* Read the CONTROL register as the MRS instruction would. */
+uint32_t arm_v7m_mrs_control(CPUARMState *env, uint32_t secure);
+
#ifdef CONFIG_USER_ONLY
static inline void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) { }
#else
diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c
index f94e87e7289..03be79e7bfa 100644
--- a/target/arm/tcg/m_helper.c
+++ b/target/arm/tcg/m_helper.c
@@ -56,7 +56,7 @@ static uint32_t v7m_mrs_xpsr(CPUARMState *env, uint32_t reg,
unsigned el)
return xpsr_read(env) & mask;
}
-static uint32_t v7m_mrs_control(CPUARMState *env, uint32_t secure)
+uint32_t arm_v7m_mrs_control(CPUARMState *env, uint32_t secure)
{
uint32_t value = env->v7m.control[secure];
@@ -93,7 +93,7 @@ uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg)
case 0 ... 7: /* xPSR sub-fields */
return v7m_mrs_xpsr(env, reg, 0);
case 20: /* CONTROL */
- return v7m_mrs_control(env, 0);
+ return arm_v7m_mrs_control(env, 0);
default:
/* Unprivileged reads others as zero. */
return 0;
@@ -2465,7 +2465,7 @@ uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg)
case 0 ... 7: /* xPSR sub-fields */
return v7m_mrs_xpsr(env, reg, el);
case 20: /* CONTROL */
- return v7m_mrs_control(env, env->v7m.secure);
+ return arm_v7m_mrs_control(env, env->v7m.secure);
case 0x94: /* CONTROL_NS */
/*
* We have to handle this here because unprivileged Secure code
--
2.34.1
- [PULL 01/21] target/arm: Normalize aarch64 gdbstub get/set function names, (continued)
- [PULL 01/21] target/arm: Normalize aarch64 gdbstub get/set function names, Peter Maydell, 2023/03/06
- [PULL 05/21] target/arm: Simplify register counting in arm_gen_dynamic_svereg_xml, Peter Maydell, 2023/03/06
- [PULL 02/21] target/arm: Unexport arm_gen_dynamic_sysreg_xml, Peter Maydell, 2023/03/06
- [PULL 09/21] target/arm: Simplify iteration over bit widths, Peter Maydell, 2023/03/06
- [PULL 04/21] target/arm: Split out output_vector_union_type, Peter Maydell, 2023/03/06
- [PULL 03/21] target/arm: Move arm_gen_dynamic_svereg_xml to gdbstub64.c, Peter Maydell, 2023/03/06
- [PULL 07/21] target/arm: Fix svep width in arm_gen_dynamic_svereg_xml, Peter Maydell, 2023/03/06
- [PULL 08/21] target/arm: Add name argument to output_vector_union_type, Peter Maydell, 2023/03/06
- [PULL 10/21] target/arm: Create pauth_ptr_mask, Peter Maydell, 2023/03/06
- [PULL 06/21] target/arm: Hoist pred_width in arm_gen_dynamic_svereg_xml, Peter Maydell, 2023/03/06
- [PULL 12/21] target/arm: Export arm_v7m_mrs_control,
Peter Maydell <=
- [PULL 15/21] target/arm: Handle m-profile in arm_is_secure, Peter Maydell, 2023/03/06
- [PULL 13/21] target/arm: Export arm_v7m_get_sp_ptr, Peter Maydell, 2023/03/06
- [PULL 17/21] target/arm: Diagnose incorrect usage of arm_is_secure subroutines, Peter Maydell, 2023/03/06
- [PULL 11/21] target/arm: Implement gdbstub pauth extension, Peter Maydell, 2023/03/06
- [PULL 14/21] target/arm: Implement gdbstub m-profile systemreg and secext, Peter Maydell, 2023/03/06
- [PULL 16/21] target/arm: Stub arm_hcr_el2_eff for m-profile, Peter Maydell, 2023/03/06
- [PULL 21/21] hw: arm: allwinner-h3: Fix and complete H3 i2c devices, Peter Maydell, 2023/03/06
- [PULL 18/21] target/arm: Rewrite check_s2_mmu_setup, Peter Maydell, 2023/03/06
- [PULL 19/21] hw: arm: Support direct boot for Linux/arm64 EFI zboot images, Peter Maydell, 2023/03/06
- [PULL 20/21] hw: allwinner-i2c: Fix TWI_CNTR_INT_FLAG on SUN6i SoCs, Peter Maydell, 2023/03/06