mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
@@ -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;
|
||||
r->regs[TARGET_EF_R0] = 0;
|
||||
|
||||
(*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
|
||||
|
||||
Reference in New Issue
Block a user