Skip to contentSkip to conversation

linux-user: Constify target_shmlba() argument

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Jan 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Constify target_shmlba() argument

Returning target segment low boundary address multiple shouldn't need to modify the CPU env. Make it const.

---
 linux-user/arm/target_syscall.h    | 2 +-
 linux-user/mips/target_syscall.h   | 2 +-
 linux-user/mips64/target_syscall.h | 2 +-
 linux-user/sh4/target_syscall.h    | 2 +-
 linux-user/sparc/target_syscall.h  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
linux-user/arm/target_syscall.h +1 -1
index 412ad434cfc..de5661c296b 100644
@@ -35,7 +35,7 @@ struct target_pt_regs {
 
 #define TARGET_FORCE_SHMLBA
 
-static inline abi_ulong target_shmlba(CPUARMState *env)
+static inline abi_ulong target_shmlba(const CPUARMState *env)
 {
     return 4 * 4096;
 }
linux-user/mips/target_syscall.h +1 -1
index 08ead678104..7aade628645 100644
@@ -30,7 +30,7 @@ struct target_pt_regs {
 
 #define TARGET_FORCE_SHMLBA
 
-static inline abi_ulong target_shmlba(CPUMIPSState *env)
+static inline abi_ulong target_shmlba(const CPUMIPSState *env)
 {
     return 0x40000;
 }
linux-user/mips64/target_syscall.h +1 -1
index 358dc2d64c9..c4d54bda1d6 100644
@@ -27,7 +27,7 @@ struct target_pt_regs {
 
 #define TARGET_FORCE_SHMLBA
 
-static inline abi_ulong target_shmlba(CPUMIPSState *env)
+static inline abi_ulong target_shmlba(const CPUMIPSState *env)
 {
     return 0x40000;
 }
linux-user/sh4/target_syscall.h +1 -1
index 148398855df..8fd504fff1b 100644
@@ -21,7 +21,7 @@ struct target_pt_regs {
 
 #define TARGET_FORCE_SHMLBA
 
-static inline abi_ulong target_shmlba(CPUSH4State *env)
+static inline abi_ulong target_shmlba(const CPUSH4State *env)
 {
     return 0x4000;
 }
linux-user/sparc/target_syscall.h +1 -1
index e4211653574..6ab47102045 100644
@@ -45,7 +45,7 @@ struct target_pt_regs {
  */
 #define TARGET_FORCE_SHMLBA
 
-static inline abi_ulong target_shmlba(CPUSPARCState *env)
+static inline abi_ulong target_shmlba(const CPUSPARCState *env)
 {
 #ifdef TARGET_SPARC64
     return MAX(TARGET_PAGE_SIZE, 16 * 1024);
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé

Returning target segment low boundary address multiple shouldn't need to modify the CPU env. Make it const.

---
  linux-user/arm/target_syscall.h    | 2 +-
  linux-user/mips/target_syscall.h   | 2 +-
  linux-user/mips64/target_syscall.h | 2 +-
  linux-user/sh4/target_syscall.h    | 2 +-
  linux-user/sparc/target_syscall.h  | 2 +-
  5 files changed, 5 insertions(+), 5 deletions(-)

r~