The map_address() handlers only read the CPU state, make
their CPUMIPSState argument const.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 target/mips/internal.h              | 2 +-
 target/mips/tcg/system/tlb_helper.c | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/target/mips/internal.h b/target/mips/internal.h
index a302fc0c20bb..177fe5cadaef 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -145,7 +145,7 @@ struct r4k_tlb_t {
 struct CPUMIPSTLBContext {
     uint32_t nb_tlb;
     uint32_t tlb_in_use;
-    int (*map_address)(CPUMIPSState *env, hwaddr *physical, int *prot,
+    int (*map_address)(const CPUMIPSState *env, hwaddr *physical, int *prot,
                        target_ulong address, MMUAccessType access_type);
     void (*helper_tlbwi)(CPUMIPSState *env);
     void (*helper_tlbwr)(CPUMIPSState *env);
diff --git a/target/mips/tcg/system/tlb_helper.c 
b/target/mips/tcg/system/tlb_helper.c
index 0ff0c9c87175..976226a548db 100644
--- a/target/mips/tcg/system/tlb_helper.c
+++ b/target/mips/tcg/system/tlb_helper.c
@@ -360,8 +360,9 @@ void HELPER(ginvt)(CPUMIPSState *env, target_ulong arg, 
uint32_t type)
 }
 
 /* no MMU emulation */
-static int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot,
-                              target_ulong address, MMUAccessType access_type)
+static int no_mmu_map_address(const CPUMIPSState *env, hwaddr *physical,
+                              int *prot, target_ulong address,
+                              MMUAccessType access_type)
 {
     *physical = address;
     *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
@@ -369,7 +370,7 @@ static int no_mmu_map_address(CPUMIPSState *env, hwaddr 
*physical, int *prot,
 }
 
 /* fixed mapping MMU emulation */
-static int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical,
+static int fixed_mmu_map_address(const CPUMIPSState *env, hwaddr *physical,
                                  int *prot, target_ulong address,
                                  MMUAccessType access_type)
 {
@@ -390,7 +391,7 @@ static int fixed_mmu_map_address(CPUMIPSState *env, hwaddr 
*physical,
 }
 
 /* MIPS32/MIPS64 R4000-style MMU emulation */
-static int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot,
+static int r4k_map_address(const CPUMIPSState *env, hwaddr *physical, int 
*prot,
                            target_ulong address, MMUAccessType access_type)
 {
     uint16_t ASID = env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask;
-- 
2.55.0


Reply via email to