Move elf_core_copy_regs to elfload.c. Move ELF_NREG to target_elf.h. Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- linux-user/microblaze/target_elf.h | 2 ++ linux-user/elfload.c | 19 ------------------- linux-user/microblaze/elfload.c | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/target_elf.h index bfe2997fd2..2d83fdaf6d 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -8,4 +8,6 @@ #ifndef MICROBLAZE_TARGET_ELF_H #define MICROBLAZE_TARGET_ELF_H +#define ELF_NREG 38 + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e5833ec3b4..161118d855 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -408,25 +408,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t elf_flags) #define ELF_EXEC_PAGESIZE 4096 -#define ELF_NREG 38 - -/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -void elf_core_copy_regs(target_ulong *regs, const CPUMBState *env) -{ - int i, pos = 0; - - for (i = 0; i < 32; i++) { - regs[pos++] = tswapl(env->regs[i]); - } - - regs[pos++] = tswapl(env->pc); - regs[pos++] = tswapl(mb_cpu_read_msr(env)); - regs[pos++] = 0; - regs[pos++] = tswapl(env->ear); - regs[pos++] = 0; - regs[pos++] = tswapl(env->esr); -} - #endif /* TARGET_MICROBLAZE */ #ifdef TARGET_OPENRISC diff --git a/linux-user/microblaze/elfload.c b/linux-user/microblaze/elfload.c index b92442dfeb..8a17ffa561 100644 --- a/linux-user/microblaze/elfload.c +++ b/linux-user/microblaze/elfload.c @@ -9,3 +9,20 @@ const char *get_elf_cpu_model(uint32_t eflags) { return "any"; } + +/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ +void elf_core_copy_regs(target_ulong *regs, const CPUMBState *env) +{ + int i, pos = 0; + + for (i = 0; i < 32; i++) { + regs[pos++] = tswapl(env->regs[i]); + } + + regs[pos++] = tswapl(env->pc); + regs[pos++] = tswapl(mb_cpu_read_msr(env)); + regs[pos++] = 0; + regs[pos++] = tswapl(env->ear); + regs[pos++] = 0; + regs[pos++] = tswapl(env->esr); +} -- 2.43.0