linux-user: Move elf_core_copy_regs to arm/elfload.c
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of 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:
parent
93c62ca6fe
commit
53c6724cc9
3 changed files with 20 additions and 15 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "qemu.h"
|
||||
#include "loader.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
#include "target_elf.h"
|
||||
|
||||
|
||||
const char *get_elf_cpu_model(uint32_t eflags)
|
||||
|
|
@ -199,3 +200,14 @@ const char *get_elf_platform(CPUState *cs)
|
|||
|
||||
#undef END
|
||||
}
|
||||
|
||||
#define tswapreg(ptr) tswapal(ptr)
|
||||
|
||||
void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
r->regs[i] = tswapreg(env->regs[i]);
|
||||
}
|
||||
r->regs[16] = tswapreg(cpsr_read((CPUARMState *)env));
|
||||
r->regs[17] = tswapreg(env->regs[0]); /* XXX */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,13 @@
|
|||
#define HAVE_ELF_HWCAP 1
|
||||
#define HAVE_ELF_HWCAP2 1
|
||||
#define HAVE_ELF_PLATFORM 1
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
||||
typedef abi_ulong target_elf_greg_t;
|
||||
|
||||
#define ELF_NREG 18
|
||||
typedef struct target_elf_gregset_t {
|
||||
target_elf_greg_t regs[ELF_NREG];
|
||||
} target_elf_gregset_t;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -218,21 +218,6 @@ static bool init_guest_commpage(void)
|
|||
#define ELF_CLASS ELFCLASS32
|
||||
#define EXSTACK_DEFAULT true
|
||||
|
||||
#define ELF_NREG 18
|
||||
typedef struct target_elf_gregset_t {
|
||||
target_elf_greg_t regs[ELF_NREG];
|
||||
} target_elf_gregset_t;
|
||||
|
||||
void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
r->regs[i] = tswapreg(env->regs[i]);
|
||||
}
|
||||
r->regs[16] = tswapreg(cpsr_read((CPUARMState *)env));
|
||||
r->regs[17] = tswapreg(env->regs[0]); /* XXX */
|
||||
}
|
||||
|
||||
#define HAVE_ELF_CORE_DUMP
|
||||
#define ELF_EXEC_PAGESIZE 4096
|
||||
|
||||
/* The commpage only exists for 32 bit kernels */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue