diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 08:05:47 +1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-30 07:03:57 +1000 |
| commit | 544843f2e76b2d40535b8b3d14007371cbd868f8 (patch) | |
| tree | 67a8eeaf586616c2899bc57db6f1abd821e7f762 /linux-user/elfload.c | |
| parent | 0b3357425cef78233ec0c574990a4e70e53c30e6 (diff) | |
| download | focaccia-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.c | 20 |
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 |