diff mbox series

[13/23] target/xtensa: Use MMU_INDEX() helper

Message ID 20230806120001.89130-14-deller@gmx.de (mailing list archive)
State New, archived
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/xtensa/cpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.41.0
diff mbox series

Patch

diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h
index 87fe992ba6..2f1349b13d 100644
--- a/target/xtensa/cpu.h
+++ b/target/xtensa/cpu.h
@@ -699,11 +699,11 @@  static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env)
 }

 /* MMU modes definitions */
-#define MMU_USER_IDX 3
+#define MMU_USER_IDX MMU_INDEX(3)

 static inline int cpu_mmu_index(CPUXtensaState *env, bool ifetch)
 {
-    return xtensa_get_cring(env);
+    return MMU_INDEX(xtensa_get_cring(env));
 }

 #define XTENSA_TBFLAG_RING_MASK 0x3