Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- linux-user/elfload.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ba205c5a19..e8a7f040ed 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -233,7 +233,9 @@ static bool init_guest_commpage(void) #define EXSTACK_DEFAULT true #define ELF_NREG 17 -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; /* * Note that ELF_NREG should be 19 as there should be place for @@ -242,25 +244,25 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { - (*regs)[0] = tswapreg(env->regs[R_EBX]); - (*regs)[1] = tswapreg(env->regs[R_ECX]); - (*regs)[2] = tswapreg(env->regs[R_EDX]); - (*regs)[3] = tswapreg(env->regs[R_ESI]); - (*regs)[4] = tswapreg(env->regs[R_EDI]); - (*regs)[5] = tswapreg(env->regs[R_EBP]); - (*regs)[6] = tswapreg(env->regs[R_EAX]); - (*regs)[7] = tswapreg(env->segs[R_DS].selector & 0xffff); - (*regs)[8] = tswapreg(env->segs[R_ES].selector & 0xffff); - (*regs)[9] = tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[10] = tswapreg(env->segs[R_GS].selector & 0xffff); - (*regs)[11] = tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - (*regs)[12] = tswapreg(env->eip); - (*regs)[13] = tswapreg(env->segs[R_CS].selector & 0xffff); - (*regs)[14] = tswapreg(env->eflags); - (*regs)[15] = tswapreg(env->regs[R_ESP]); - (*regs)[16] = tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[0] = tswapreg(env->regs[R_EBX]); + r->regs[1] = tswapreg(env->regs[R_ECX]); + r->regs[2] = tswapreg(env->regs[R_EDX]); + r->regs[3] = tswapreg(env->regs[R_ESI]); + r->regs[4] = tswapreg(env->regs[R_EDI]); + r->regs[5] = tswapreg(env->regs[R_EBP]); + r->regs[6] = tswapreg(env->regs[R_EAX]); + r->regs[7] = tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[8] = tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[9] = tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[10] = tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[11] = tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[12] = tswapreg(env->eip); + r->regs[13] = tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[14] = tswapreg(env->eflags); + r->regs[15] = tswapreg(env->regs[R_ESP]); + r->regs[16] = tswapreg(env->segs[R_SS].selector & 0xffff); } /* -- 2.43.0