diff mbox series

[15/23] target/cris: Use MMU_INDEX() helper

Message ID 20230806120001.89130-16-deller@gmx.de
State New
Headers show
Series Introduce MMU_INDEX() | expand

Commit Message

Helge Deller Aug. 6, 2023, 11:59 a.m. UTC
Use the new MMU_INDEX() helper to specify the index of the CPUTLB which
should be used.  Additionally, in a follow-up patch this helper allows
then to optimize the tcg code generation.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 target/cris/cpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.41.0
diff mbox series

Patch

diff --git a/target/cris/cpu.h b/target/cris/cpu.h
index 8e37c6e50d..4064a16564 100644
--- a/target/cris/cpu.h
+++ b/target/cris/cpu.h
@@ -248,10 +248,10 @@  enum {
 #define CPU_RESOLVING_TYPE TYPE_CRIS_CPU

 /* MMU modes definitions */
-#define MMU_USER_IDX 1
+#define MMU_USER_IDX MMU_INDEX(1)
 static inline int cpu_mmu_index (CPUCRISState *env, bool ifetch)
 {
-	return !!(env->pregs[PR_CCS] & U_FLAG);
+	return MMU_INDEX(!!(env->pregs[PR_CCS] & U_FLAG));
 }

 /* Support function regs.  */