diff mbox series

[08/23] target/mips: Use MMU_INDEX() helper

Message ID 20230806120001.89130-9-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/mips/cpu.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.41.0
diff mbox series

Patch

diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index f81bd06f5e..4039d59f61 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1231,14 +1231,14 @@  extern uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env);
  * MMU modes definitions. We carefully match the indices with our
  * hflags layout.
  */
-#define MMU_USER_IDX 2
+#define MMU_USER_IDX MMU_INDEX(2)

 static inline int hflags_mmu_index(uint32_t hflags)
 {
     if (hflags & MIPS_HFLAG_ERL) {
-        return 3; /* ERL */
+        return MMU_INDEX(3); /* ERL */
     } else {
-        return hflags & MIPS_HFLAG_KSU;
+        return MMU_INDEX(hflags & MIPS_HFLAG_KSU);
     }
 }