summary refs log tree commit diff stats
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-08-28 08:05:47 +1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-30 07:03:57 +1000
commit544843f2e76b2d40535b8b3d14007371cbd868f8 (patch)
tree67a8eeaf586616c2899bc57db6f1abd821e7f762 /linux-user/elfload.c
parent0b3357425cef78233ec0c574990a4e70e53c30e6 (diff)
downloadfocaccia-qemu-544843f2e76b2d40535b8b3d14007371cbd868f8.tar.gz
focaccia-qemu-544843f2e76b2d40535b8b3d14007371cbd868f8.zip
linux-user/ppc: Convert target_elf_gregset_t to a struct
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index da57c6c2ce..0dd76937f9 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -470,25 +470,27 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env)
 
 /* See linux kernel: arch/powerpc/include/asm/elf.h.  */
 #define ELF_NREG 48
-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;
 
-static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *env)
+static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env)
 {
     int i;
     target_ulong ccr = 0;
 
     for (i = 0; i < ARRAY_SIZE(env->gpr); i++) {
-        (*regs)[i] = tswapreg(env->gpr[i]);
+        r->regs[i] = tswapreg(env->gpr[i]);
     }
 
-    (*regs)[32] = tswapreg(env->nip);
-    (*regs)[33] = tswapreg(env->msr);
-    (*regs)[35] = tswapreg(env->ctr);
-    (*regs)[36] = tswapreg(env->lr);
-    (*regs)[37] = tswapreg(cpu_read_xer(env));
+    r->regs[32] = tswapreg(env->nip);
+    r->regs[33] = tswapreg(env->msr);
+    r->regs[35] = tswapreg(env->ctr);
+    r->regs[36] = tswapreg(env->lr);
+    r->regs[37] = tswapreg(cpu_read_xer(env));
 
     ccr = ppc_get_cr(env);
-    (*regs)[38] = tswapreg(ccr);
+    r->regs[38] = tswapreg(ccr);
 }
 
 #define USE_ELF_CORE_DUMP