mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user/microblaze: Expand target_elf_gregset_t
Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -11,18 +11,14 @@ const char *get_elf_cpu_model(uint32_t eflags)
|
||||
return "any";
|
||||
}
|
||||
|
||||
#define tswapreg(ptr) tswapal(ptr)
|
||||
|
||||
void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env)
|
||||
{
|
||||
for (int i = 0; i < 32; i++) {
|
||||
r->regs[i] = tswapreg(env->regs[i]);
|
||||
r->pt.r[i] = tswapal(env->regs[i]);
|
||||
}
|
||||
|
||||
r->regs[32] = tswapreg(env->pc);
|
||||
r->regs[33] = tswapreg(mb_cpu_read_msr(env));
|
||||
r->regs[34] = 0;
|
||||
r->regs[35] = tswapreg(env->ear);
|
||||
r->regs[36] = 0;
|
||||
r->regs[37] = tswapreg(env->esr);
|
||||
r->pt.pc = tswapal(env->pc);
|
||||
r->pt.msr = tswapal(mb_cpu_read_msr(env));
|
||||
r->pt.ear = tswapal(env->ear);
|
||||
r->pt.esr = tswapal(env->esr);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
#ifndef MICROBLAZE_TARGET_ELF_H
|
||||
#define MICROBLAZE_TARGET_ELF_H
|
||||
|
||||
#include "target_ptrace.h"
|
||||
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
||||
typedef abi_ulong target_elf_greg_t;
|
||||
|
||||
#define ELF_NREG 38
|
||||
/*
|
||||
* See linux kernel: arch/microblaze/include/asm/elf.h, where
|
||||
* elf_gregset_t is mapped to struct pt_regs via sizeof.
|
||||
*/
|
||||
typedef struct target_elf_gregset_t {
|
||||
target_elf_greg_t regs[ELF_NREG];
|
||||
struct target_pt_regs pt;
|
||||
} target_elf_gregset_t;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user