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:15:44 +1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-30 07:03:57 +1000
commitaebdd808e6288d78d7393bf1d4b49aaea93f786c (patch)
tree181c517d63b46f879f9413a961aa1cfd6dbd7e31 /linux-user/elfload.c
parentb4ad80d6d3355f2ab7f02381f8eb697609b89e93 (diff)
downloadfocaccia-qemu-aebdd808e6288d78d7393bf1d4b49aaea93f786c.tar.gz
focaccia-qemu-aebdd808e6288d78d7393bf1d4b49aaea93f786c.zip
linux-user/openrisc: 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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 40a5bcccab..da034e5a76 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -655,18 +655,18 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env)
 
 /* See linux kernel arch/openrisc/include/asm/elf.h.  */
 #define ELF_NREG 34 /* gprs and pc, sr */
-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,
+static void elf_core_copy_regs(target_elf_gregset_t *r,
                                const CPUOpenRISCState *env)
 {
-    int i;
-
-    for (i = 0; i < 32; i++) {
-        (*regs)[i] = tswapreg(cpu_get_gpr(env, i));
+    for (int i = 0; i < 32; i++) {
+        r->regs[i] = tswapreg(cpu_get_gpr(env, i));
     }
-    (*regs)[32] = tswapreg(env->pc);
-    (*regs)[33] = tswapreg(cpu_get_sr(env));
+    r->regs[32] = tswapreg(env->pc);
+    r->regs[33] = tswapreg(cpu_get_sr(env));
 }
 
 #endif /* TARGET_OPENRISC */