summary refs log tree commit diff stats
path: root/linux-user
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-08-28 08:07:32 +1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-30 07:03:57 +1000
commit68bb444d358c8cbe7bf4d8f942491ff01f132443 (patch)
tree566f38f21aeea24513aa3a8716df32273e1203c4 /linux-user
parent544843f2e76b2d40535b8b3d14007371cbd868f8 (diff)
downloadfocaccia-qemu-68bb444d358c8cbe7bf4d8f942491ff01f132443.tar.gz
focaccia-qemu-68bb444d358c8cbe7bf4d8f942491ff01f132443.zip
linux-user/loongarch64: 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')
-rw-r--r--linux-user/elfload.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0dd76937f9..1e59399afa 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -518,7 +518,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env)
 
 /* See linux kernel: arch/loongarch/include/asm/elf.h */
 #define ELF_NREG 45
-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_EF_R0 = 0,
@@ -526,19 +528,17 @@ enum {
     TARGET_EF_CSR_BADV = TARGET_EF_R0 + 34,
 };
 
-static void elf_core_copy_regs(target_elf_gregset_t *regs,
+static void elf_core_copy_regs(target_elf_gregset_t *r,
                                const CPULoongArchState *env)
 {
-    int i;
-
-    (*regs)[TARGET_EF_R0] = 0;
+    r->regs[TARGET_EF_R0] = 0;
 
-    for (i = 1; i < ARRAY_SIZE(env->gpr); i++) {
-        (*regs)[TARGET_EF_R0 + i] = tswapreg(env->gpr[i]);
+    for (int i = 1; i < ARRAY_SIZE(env->gpr); i++) {
+        r->regs[TARGET_EF_R0 + i] = tswapreg(env->gpr[i]);
     }
 
-    (*regs)[TARGET_EF_CSR_ERA] = tswapreg(env->pc);
-    (*regs)[TARGET_EF_CSR_BADV] = tswapreg(env->CSR_BADV);
+    r->regs[TARGET_EF_CSR_ERA] = tswapreg(env->pc);
+    r->regs[TARGET_EF_CSR_BADV] = tswapreg(env->CSR_BADV);
 }
 
 #define USE_ELF_CORE_DUMP