diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 08:17:40 +1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-30 07:03:57 +1000 |
| commit | 7bd01645d66c23ef5494dcc8ea13d15bc90d82f5 (patch) | |
| tree | 61a84058b8c3fbb32497455efd7f1eef5657f937 /linux-user | |
| parent | aebdd808e6288d78d7393bf1d4b49aaea93f786c (diff) | |
| download | focaccia-qemu-7bd01645d66c23ef5494dcc8ea13d15bc90d82f5.tar.gz focaccia-qemu-7bd01645d66c23ef5494dcc8ea13d15bc90d82f5.zip | |
linux-user/sh4: 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.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index da034e5a76..cc9140bf32 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -678,7 +678,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, /* See linux kernel: arch/sh/include/asm/elf.h. */ #define ELF_NREG 23 -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; /* See linux kernel: arch/sh/include/asm/ptrace.h. */ enum { @@ -691,22 +693,19 @@ enum { TARGET_REG_SYSCALL = 22 }; -static inline void elf_core_copy_regs(target_elf_gregset_t *regs, - const CPUSH4State *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) { - int i; - - for (i = 0; i < 16; i++) { - (*regs)[i] = tswapreg(env->gregs[i]); + for (int i = 0; i < 16; i++) { + r->regs[i] = tswapreg(env->gregs[i]); } - (*regs)[TARGET_REG_PC] = tswapreg(env->pc); - (*regs)[TARGET_REG_PR] = tswapreg(env->pr); - (*regs)[TARGET_REG_SR] = tswapreg(env->sr); - (*regs)[TARGET_REG_GBR] = tswapreg(env->gbr); - (*regs)[TARGET_REG_MACH] = tswapreg(env->mach); - (*regs)[TARGET_REG_MACL] = tswapreg(env->macl); - (*regs)[TARGET_REG_SYSCALL] = 0; /* FIXME */ + r->regs[TARGET_REG_PC] = tswapreg(env->pc); + r->regs[TARGET_REG_PR] = tswapreg(env->pr); + r->regs[TARGET_REG_SR] = tswapreg(env->sr); + r->regs[TARGET_REG_GBR] = tswapreg(env->gbr); + r->regs[TARGET_REG_MACH] = tswapreg(env->mach); + r->regs[TARGET_REG_MACL] = tswapreg(env->macl); + r->regs[TARGET_REG_SYSCALL] = 0; /* FIXME */ } #define USE_ELF_CORE_DUMP |