diff mbox series

[v2,16/23] target/m68k: Use MMU_INDEX() helper

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

Commit Message

Helge Deller Aug. 6, 2023, 12:17 p.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/m68k/cpu.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.41.0
diff mbox series

Patch

diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index cf70282717..8321868506 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -571,11 +571,11 @@  enum {
 #define cpu_list m68k_cpu_list

 /* MMU modes definitions */
-#define MMU_KERNEL_IDX 0
-#define MMU_USER_IDX 1
+#define MMU_KERNEL_IDX  MMU_INDEX(0)
+#define MMU_USER_IDX    MMU_INDEX(1)
 static inline int cpu_mmu_index (CPUM68KState *env, bool ifetch)
 {
-    return (env->sr & SR_S) == 0 ? 1 : 0;
+    return (env->sr & SR_S) == 0 ? MMU_USER_IDX : MMU_KERNEL_IDX;
 }

 bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,