get_physical_address() and its static helpers 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/system/physaddr.c | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/target/mips/internal.h b/target/mips/internal.h
index 177fe5cadaef..2c152e246a24 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -115,7 +115,7 @@ enum {
     TLBRET_MATCH = 0
 };
 
-int get_physical_address(CPUMIPSState *env, hwaddr *physical,
+int get_physical_address(const CPUMIPSState *env, hwaddr *physical,
                          int *prot, target_ulong real_address,
                          MMUAccessType access_type, int mmu_idx);
 bool mips_cpu_translate_for_debug(CPUState *cpu, vaddr addr,
diff --git a/target/mips/system/physaddr.c b/target/mips/system/physaddr.c
index 6f11e70ba804..523197f02090 100644
--- a/target/mips/system/physaddr.c
+++ b/target/mips/system/physaddr.c
@@ -75,7 +75,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, int 
mmu_idx)
     };
 }
 
-static int get_seg_physical_address(CPUMIPSState *env, hwaddr *physical,
+static int get_seg_physical_address(const CPUMIPSState *env, hwaddr *physical,
                                     int *prot, target_ulong real_address,
                                     MMUAccessType access_type, int mmu_idx,
                                     unsigned int am, bool eu,
@@ -99,8 +99,9 @@ static int get_seg_physical_address(CPUMIPSState *env, hwaddr 
*physical,
     }
 }
 
-static int get_segctl_physical_address(CPUMIPSState *env, hwaddr *physical,
-                                       int *prot, target_ulong real_address,
+static int get_segctl_physical_address(const CPUMIPSState *env,
+                                       hwaddr *physical, int *prot,
+                                       target_ulong real_address,
                                        MMUAccessType access_type, int mmu_idx,
                                        uint16_t segctl, target_ulong segmask)
 {
@@ -113,7 +114,7 @@ static int get_segctl_physical_address(CPUMIPSState *env, 
hwaddr *physical,
                                     pa & ~(hwaddr)segmask);
 }
 
-int get_physical_address(CPUMIPSState *env, hwaddr *physical,
+int get_physical_address(const CPUMIPSState *env, hwaddr *physical,
                          int *prot, target_ulong real_address,
                          MMUAccessType access_type, int mmu_idx)
 {
-- 
2.55.0


Reply via email to