mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user/xtensa: 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>
This commit is contained in:
+14
-12
@@ -873,7 +873,9 @@ static bool init_guest_commpage(void)
|
||||
|
||||
/* See linux kernel: arch/xtensa/include/asm/elf.h. */
|
||||
#define ELF_NREG 128
|
||||
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_REG_PC,
|
||||
@@ -888,23 +890,23 @@ enum {
|
||||
TARGET_REG_AR0 = 64,
|
||||
};
|
||||
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs,
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *r,
|
||||
const CPUXtensaState *env)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
(*regs)[TARGET_REG_PC] = tswapreg(env->pc);
|
||||
(*regs)[TARGET_REG_PS] = tswapreg(env->sregs[PS] & ~PS_EXCM);
|
||||
(*regs)[TARGET_REG_LBEG] = tswapreg(env->sregs[LBEG]);
|
||||
(*regs)[TARGET_REG_LEND] = tswapreg(env->sregs[LEND]);
|
||||
(*regs)[TARGET_REG_LCOUNT] = tswapreg(env->sregs[LCOUNT]);
|
||||
(*regs)[TARGET_REG_SAR] = tswapreg(env->sregs[SAR]);
|
||||
(*regs)[TARGET_REG_WINDOWSTART] = tswapreg(env->sregs[WINDOW_START]);
|
||||
(*regs)[TARGET_REG_WINDOWBASE] = tswapreg(env->sregs[WINDOW_BASE]);
|
||||
(*regs)[TARGET_REG_THREADPTR] = tswapreg(env->uregs[THREADPTR]);
|
||||
r->regs[TARGET_REG_PC] = tswapreg(env->pc);
|
||||
r->regs[TARGET_REG_PS] = tswapreg(env->sregs[PS] & ~PS_EXCM);
|
||||
r->regs[TARGET_REG_LBEG] = tswapreg(env->sregs[LBEG]);
|
||||
r->regs[TARGET_REG_LEND] = tswapreg(env->sregs[LEND]);
|
||||
r->regs[TARGET_REG_LCOUNT] = tswapreg(env->sregs[LCOUNT]);
|
||||
r->regs[TARGET_REG_SAR] = tswapreg(env->sregs[SAR]);
|
||||
r->regs[TARGET_REG_WINDOWSTART] = tswapreg(env->sregs[WINDOW_START]);
|
||||
r->regs[TARGET_REG_WINDOWBASE] = tswapreg(env->sregs[WINDOW_BASE]);
|
||||
r->regs[TARGET_REG_THREADPTR] = tswapreg(env->uregs[THREADPTR]);
|
||||
xtensa_sync_phys_from_window((CPUXtensaState *)env);
|
||||
for (i = 0; i < env->config->nareg; ++i) {
|
||||
(*regs)[TARGET_REG_AR0 + i] = tswapreg(env->phys_regs[i]);
|
||||
r->regs[TARGET_REG_AR0 + i] = tswapreg(env->phys_regs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user