]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user/s390x: Convert target_elf_gregset_t to a struct
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 27 Aug 2025 22:30:25 +0000 (08:30 +1000)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 29 Aug 2025 21:03:58 +0000 (07:03 +1000)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/elfload.c

index 63376fa1d658b654a210a1a137a6073a34113eb2..98c17d32e60be24746eec0ac4d71f86e3ef88fd0 100644 (file)
@@ -770,7 +770,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState *env)
 
 /* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs).  */
 #define ELF_NREG 27
-typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
+typedef struct target_elf_gregset_t {
+    target_elf_greg_t regs[ELF_NREG];
+} target_elf_gregset_t;
 
 enum {
     TARGET_REG_PSWM = 0,
@@ -780,22 +782,22 @@ enum {
     TARGET_REG_ORIG_R2 = 26,
 };
 
-static void elf_core_copy_regs(target_elf_gregset_t *regs,
+static void elf_core_copy_regs(target_elf_gregset_t *r,
                                const CPUS390XState *env)
 {
     int i;
     uint32_t *aregs;
 
-    (*regs)[TARGET_REG_PSWM] = tswapreg(env->psw.mask);
-    (*regs)[TARGET_REG_PSWA] = tswapreg(env->psw.addr);
+    r->regs[TARGET_REG_PSWM] = tswapreg(env->psw.mask);
+    r->regs[TARGET_REG_PSWA] = tswapreg(env->psw.addr);
     for (i = 0; i < 16; i++) {
-        (*regs)[TARGET_REG_GPRS + i] = tswapreg(env->regs[i]);
+        r->regs[TARGET_REG_GPRS + i] = tswapreg(env->regs[i]);
     }
-    aregs = (uint32_t *)&((*regs)[TARGET_REG_ARS]);
+    aregs = (uint32_t *)&(r->regs[TARGET_REG_ARS]);
     for (i = 0; i < 16; i++) {
         aregs[i] = tswap32(env->aregs[i]);
     }
-    (*regs)[TARGET_REG_ORIG_R2] = 0;
+    r->regs[TARGET_REG_ORIG_R2] = 0;
 }
 
 #define USE_ELF_CORE_DUMP