diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2009-12-11 09:04:50 -0800 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-12-19 20:29:18 +0100 |
commit | 7a93cc55e9af661949cb9a56866b5652667294c9 (patch) | |
tree | a9b4767dda83e8100a1b9d8c463a20036160d784 /linux-user/elfload.c | |
parent | 51e526063d23e4ae6732d6b9868e9dcf3cd3597b (diff) |
linux-user: add core dump support for M68K
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index b17cf64a4b..78dcf6500c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -725,6 +725,35 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->pc = infop->entry; } +/* See linux kernel: arch/m68k/include/asm/elf.h. */ +#define ELF_NREG 20 +typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; + +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +{ + (*regs)[0] = tswapl(env->dregs[1]); + (*regs)[1] = tswapl(env->dregs[2]); + (*regs)[2] = tswapl(env->dregs[3]); + (*regs)[3] = tswapl(env->dregs[4]); + (*regs)[4] = tswapl(env->dregs[5]); + (*regs)[5] = tswapl(env->dregs[6]); + (*regs)[6] = tswapl(env->dregs[7]); + (*regs)[7] = tswapl(env->aregs[0]); + (*regs)[8] = tswapl(env->aregs[1]); + (*regs)[9] = tswapl(env->aregs[2]); + (*regs)[10] = tswapl(env->aregs[3]); + (*regs)[11] = tswapl(env->aregs[4]); + (*regs)[12] = tswapl(env->aregs[5]); + (*regs)[13] = tswapl(env->aregs[6]); + (*regs)[14] = tswapl(env->dregs[0]); + (*regs)[15] = tswapl(env->aregs[7]); + (*regs)[16] = tswapl(env->dregs[0]); /* FIXME: orig_d0 */ + (*regs)[17] = tswapl(env->sr); + (*regs)[18] = tswapl(env->pc); + (*regs)[19] = 0; /* FIXME: regs->format | regs->vector */ +} + +#define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 #endif |