target/avr: Populate CPUClass.mmu_index
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 28 Jan 2024 23:12:17 +0000 (09:12 +1000)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 2 Feb 2024 22:52:25 +0000 (08:52 +1000)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/avr/cpu.c
target/avr/cpu.h

index 1c68748b242147136146f3b7ddef592bd178a7d0..a40f445af218d05ace82bd04b3ffd42cb15e5b43 100644 (file)
@@ -50,6 +50,11 @@ static bool avr_cpu_has_work(CPUState *cs)
             && cpu_interrupts_enabled(env);
 }
 
+static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
+{
+    return ifetch ? MMU_CODE_IDX : MMU_DATA_IDX;
+}
+
 static void avr_cpu_synchronize_from_tb(CPUState *cs,
                                         const TranslationBlock *tb)
 {
@@ -236,6 +241,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data)
     cc->class_by_name = avr_cpu_class_by_name;
 
     cc->has_work = avr_cpu_has_work;
+    cc->mmu_index = avr_cpu_mmu_index;
     cc->dump_state = avr_cpu_dump_state;
     cc->set_pc = avr_cpu_set_pc;
     cc->get_pc = avr_cpu_get_pc;
index 7d5dd42575d7e860cd35f5c64722a6c9fc679a00..4595c6bb18d1cce8950a2ce44e99d56019600422 100644 (file)
@@ -184,9 +184,7 @@ static inline void set_avr_feature(CPUAVRState *env, int feature)
     env->features |= (1U << feature);
 }
 
-#define cpu_mmu_index avr_cpu_mmu_index
-
-static inline int avr_cpu_mmu_index(CPUAVRState *env, bool ifetch)
+static inline int cpu_mmu_index(CPUAVRState *env, bool ifetch)
 {
     return ifetch ? MMU_CODE_IDX : MMU_DATA_IDX;
 }