From: Nathan Froyd <froydnj@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 6/7] linux-user: add core dump support for M68K
Date: Fri, 11 Dec 2009 09:04:50 -0800 [thread overview]
Message-ID: <1260551091-2890-7-git-send-email-froydnj@codesourcery.com> (raw)
In-Reply-To: <1260551091-2890-1-git-send-email-froydnj@codesourcery.com>
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
---
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 eb89f5f..53851d9 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
--
1.6.3.2
next prev parent reply other threads:[~2009-12-11 17:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 17:04 [Qemu-devel] [PATCH 0/7] linux-user: core dump enhancements Nathan Froyd
2009-12-11 17:04 ` [Qemu-devel] [PATCH 1/7] linux-user: fix ELF_USE_CORE_DUMP/USE_ELF_CORE_DUMP confusion Nathan Froyd
2009-12-11 17:04 ` [Qemu-devel] [PATCH 2/7] linux-user: commonify definitions of target typedefs Nathan Froyd
2009-12-11 17:04 ` [Qemu-devel] [PATCH 3/7] linux-user: fix ARM core dumps on opposite-endian hosts Nathan Froyd
2009-12-11 17:04 ` [Qemu-devel] [PATCH 4/7] linux-user: add core dump support for PPC Nathan Froyd
2009-12-11 19:20 ` malc
2009-12-11 17:04 ` [Qemu-devel] [PATCH 5/7] linux-user: add core dump support for MIPS Nathan Froyd
2009-12-11 17:04 ` Nathan Froyd [this message]
2009-12-11 17:04 ` [Qemu-devel] [PATCH 7/7] linux-user: add core dump support for SH Nathan Froyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1260551091-2890-7-git-send-email-froydnj@codesourcery.com \
--to=froydnj@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).