[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/28] target/arm: Move stage_1_mmu_idx decl to internals.h
From: |
Richard Henderson |
Subject: |
[PATCH 01/28] target/arm: Move stage_1_mmu_idx decl to internals.h |
Date: |
Fri, 3 Jun 2022 21:05:40 -0700 |
Move the decl from ptw.h to internals.h. Provide an inline
version for user-only, just as we do for arm_stage1_mmu_idx.
Move an endif down to make the definition in helper.c be
system only.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 5 +++++
target/arm/helper.c | 5 ++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index b654bee468..72b6af5559 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -979,11 +979,16 @@ ARMMMUIdx arm_mmu_idx(CPUARMState *env);
* Return the ARMMMUIdx for the stage1 traversal for the current regime.
*/
#ifdef CONFIG_USER_ONLY
+static inline ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx)
+{
+ return ARMMMUIdx_Stage1_E0;
+}
static inline ARMMMUIdx arm_stage1_mmu_idx(CPUARMState *env)
{
return ARMMMUIdx_Stage1_E0;
}
#else
+ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx);
ARMMMUIdx arm_stage1_mmu_idx(CPUARMState *env);
#endif
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 40da63913c..d0460d3a0b 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10481,12 +10481,10 @@ static inline uint64_t regime_ttbr(CPUARMState *env,
ARMMMUIdx mmu_idx,
}
}
-#endif /* !CONFIG_USER_ONLY */
-
/* Convert a possible stage1+2 MMU index into the appropriate
* stage 1 MMU index
*/
-static inline ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx)
+ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx)
{
switch (mmu_idx) {
case ARMMMUIdx_SE10_0:
@@ -10505,6 +10503,7 @@ static inline ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx
mmu_idx)
return mmu_idx;
}
}
+#endif /* !CONFIG_USER_ONLY */
/* Return true if the translation regime is using LPAE format page tables */
static inline bool regime_using_lpae_format(CPUARMState *env,
--
2.34.1
- [PATCH 00/28] target/arm: Split out ptw.c from helper.c, Richard Henderson, 2022/06/04
- [PATCH 01/28] target/arm: Move stage_1_mmu_idx decl to internals.h,
Richard Henderson <=
- [PATCH 04/28] target/arm: Move get_phys_addr_v6 to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 05/28] target/arm: Move get_phys_addr_pmsav5 to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 07/28] target/arm: Move get_phys_addr_pmsav7 to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 02/28] target/arm: Move get_phys_addr to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 03/28] target/arm: Move get_phys_addr_v5 to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 10/28] target/arm: Move pmsav7_use_background_region to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 11/28] target/arm: Move v8m_security_lookup to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 13/28] target/arm: Move get_level1_table_address to ptw.c, Richard Henderson, 2022/06/04