From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, edgar.iglesias@gmail.com
Subject: [Qemu-devel] [PATCH 04/13] elfload: use tswapreg consistently in elf_core_copy_regs
Date: Wed, 17 Apr 2013 16:26:38 +0200 [thread overview]
Message-ID: <1366208807-4433-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1366208807-4433-1-git-send-email-pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
linux-user/elfload.c | 114 +++++++++++++++++++++++++--------------------------
1 file changed, 57 insertions(+), 57 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 9d5dbb8..bc2e9f1 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -297,25 +297,25 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUARMState *env)
{
- (*regs)[0] = tswapl(env->regs[0]);
- (*regs)[1] = tswapl(env->regs[1]);
- (*regs)[2] = tswapl(env->regs[2]);
- (*regs)[3] = tswapl(env->regs[3]);
- (*regs)[4] = tswapl(env->regs[4]);
- (*regs)[5] = tswapl(env->regs[5]);
- (*regs)[6] = tswapl(env->regs[6]);
- (*regs)[7] = tswapl(env->regs[7]);
- (*regs)[8] = tswapl(env->regs[8]);
- (*regs)[9] = tswapl(env->regs[9]);
- (*regs)[10] = tswapl(env->regs[10]);
- (*regs)[11] = tswapl(env->regs[11]);
- (*regs)[12] = tswapl(env->regs[12]);
- (*regs)[13] = tswapl(env->regs[13]);
- (*regs)[14] = tswapl(env->regs[14]);
- (*regs)[15] = tswapl(env->regs[15]);
-
- (*regs)[16] = tswapl(cpsr_read((CPUARMState *)env));
- (*regs)[17] = tswapl(env->regs[0]); /* XXX */
+ (*regs)[0] = tswapreg(env->regs[0]);
+ (*regs)[1] = tswapreg(env->regs[1]);
+ (*regs)[2] = tswapreg(env->regs[2]);
+ (*regs)[3] = tswapreg(env->regs[3]);
+ (*regs)[4] = tswapreg(env->regs[4]);
+ (*regs)[5] = tswapreg(env->regs[5]);
+ (*regs)[6] = tswapreg(env->regs[6]);
+ (*regs)[7] = tswapreg(env->regs[7]);
+ (*regs)[8] = tswapreg(env->regs[8]);
+ (*regs)[9] = tswapreg(env->regs[9]);
+ (*regs)[10] = tswapreg(env->regs[10]);
+ (*regs)[11] = tswapreg(env->regs[11]);
+ (*regs)[12] = tswapreg(env->regs[12]);
+ (*regs)[13] = tswapreg(env->regs[13]);
+ (*regs)[14] = tswapreg(env->regs[14]);
+ (*regs)[15] = tswapreg(env->regs[15]);
+
+ (*regs)[16] = tswapreg(cpsr_read((CPUARMState *)env));
+ (*regs)[17] = tswapreg(env->regs[0]); /* XXX */
}
#define USE_ELF_CORE_DUMP
@@ -681,19 +681,19 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en
target_ulong ccr = 0;
for (i = 0; i < ARRAY_SIZE(env->gpr); i++) {
- (*regs)[i] = tswapl(env->gpr[i]);
+ (*regs)[i] = tswapreg(env->gpr[i]);
}
- (*regs)[32] = tswapl(env->nip);
- (*regs)[33] = tswapl(env->msr);
- (*regs)[35] = tswapl(env->ctr);
- (*regs)[36] = tswapl(env->lr);
- (*regs)[37] = tswapl(env->xer);
+ (*regs)[32] = tswapreg(env->nip);
+ (*regs)[33] = tswapreg(env->msr);
+ (*regs)[35] = tswapreg(env->ctr);
+ (*regs)[36] = tswapreg(env->lr);
+ (*regs)[37] = tswapreg(env->xer);
for (i = 0; i < ARRAY_SIZE(env->crf); i++) {
ccr |= env->crf[i] << (32 - ((i + 1) * 4));
}
- (*regs)[38] = tswapl(ccr);
+ (*regs)[38] = tswapreg(ccr);
}
#define USE_ELF_CORE_DUMP
@@ -801,11 +801,11 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env
int i, pos = 0;
for (i = 0; i < 32; i++) {
- (*regs)[pos++] = tswapl(env->regs[i]);
+ (*regs)[pos++] = tswapreg(env->regs[i]);
}
for (i = 0; i < 6; i++) {
- (*regs)[pos++] = tswapl(env->sregs[i]);
+ (*regs)[pos++] = tswapreg(env->sregs[i]);
}
}
@@ -841,11 +841,11 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
int i;
for (i = 0; i < 32; i++) {
- (*regs)[i] = tswapl(env->gpr[i]);
+ (*regs)[i] = tswapreg(env->gpr[i]);
}
- (*regs)[32] = tswapl(env->pc);
- (*regs)[33] = tswapl(env->sr);
+ (*regs)[32] = tswapreg(env->pc);
+ (*regs)[33] = tswapreg(env->sr);
}
#define ELF_HWCAP 0
#define ELF_PLATFORM NULL
@@ -890,15 +890,15 @@ static inline void elf_core_copy_regs(target_elf_gregset_t *regs,
int i;
for (i = 0; i < 16; i++) {
- (*regs[i]) = tswapl(env->gregs[i]);
+ (*regs[i]) = tswapreg(env->gregs[i]);
}
- (*regs)[TARGET_REG_PC] = tswapl(env->pc);
- (*regs)[TARGET_REG_PR] = tswapl(env->pr);
- (*regs)[TARGET_REG_SR] = tswapl(env->sr);
- (*regs)[TARGET_REG_GBR] = tswapl(env->gbr);
- (*regs)[TARGET_REG_MACH] = tswapl(env->mach);
- (*regs)[TARGET_REG_MACL] = tswapl(env->macl);
+ (*regs)[TARGET_REG_PC] = tswapreg(env->pc);
+ (*regs)[TARGET_REG_PR] = tswapreg(env->pr);
+ (*regs)[TARGET_REG_SR] = tswapreg(env->sr);
+ (*regs)[TARGET_REG_GBR] = tswapreg(env->gbr);
+ (*regs)[TARGET_REG_MACH] = tswapreg(env->mach);
+ (*regs)[TARGET_REG_MACL] = tswapreg(env->macl);
(*regs)[TARGET_REG_SYSCALL] = 0; /* FIXME */
}
@@ -952,25 +952,25 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *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)[0] = tswapreg(env->dregs[1]);
+ (*regs)[1] = tswapreg(env->dregs[2]);
+ (*regs)[2] = tswapreg(env->dregs[3]);
+ (*regs)[3] = tswapreg(env->dregs[4]);
+ (*regs)[4] = tswapreg(env->dregs[5]);
+ (*regs)[5] = tswapreg(env->dregs[6]);
+ (*regs)[6] = tswapreg(env->dregs[7]);
+ (*regs)[7] = tswapreg(env->aregs[0]);
+ (*regs)[8] = tswapreg(env->aregs[1]);
+ (*regs)[9] = tswapreg(env->aregs[2]);
+ (*regs)[10] = tswapreg(env->aregs[3]);
+ (*regs)[11] = tswapreg(env->aregs[4]);
+ (*regs)[12] = tswapreg(env->aregs[5]);
+ (*regs)[13] = tswapreg(env->aregs[6]);
+ (*regs)[14] = tswapreg(env->dregs[0]);
+ (*regs)[15] = tswapreg(env->aregs[7]);
+ (*regs)[16] = tswapreg(env->dregs[0]); /* FIXME: orig_d0 */
+ (*regs)[17] = tswapreg(env->sr);
+ (*regs)[18] = tswapreg(env->pc);
(*regs)[19] = 0; /* FIXME: regs->format | regs->vector */
}
--
1.8.1.4
next prev parent reply other threads:[~2013-04-17 14:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 14:26 [Qemu-devel] [PATCH v3 00/13] TARGET_*_ALIGNMENT cleanup, and config-target.mak trimming Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 01/13] configure: QEMU_INCLUDES are the same for all subtargets Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 02/13] elfload: fix size of ABI-dependent fields in core dumps Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 03/13] elfload: fix size of registers for N32 Paolo Bonzini
2013-04-17 14:26 ` Paolo Bonzini [this message]
2013-04-17 14:26 ` [Qemu-devel] [PATCH 05/13] elfload: use abi_short/ushort instead of target_short/ushort Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 06/13] elfload: use abi_int/uint instead of target_int/uint Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 07/13] elfload: only give abi_long/ulong the alignment specified by the target Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 08/13] elfload: use abi_llong/ullong instead of target_llong/ullong Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 09/13] configure: move CONFIG_QEMU_LDST_OPTIMIZATION to config-host.mak Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 10/13] configure: move common libraries " Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 11/13] configure: eliminate target_libs_softmmu Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 12/13] configure: CONFIG_NO_XEN is duplicated Paolo Bonzini
2013-04-17 14:26 ` [Qemu-devel] [PATCH 13/13] configure: remove duplicate test Paolo Bonzini
2013-04-18 14:49 ` [Qemu-devel] [PATCH v3 00/13] TARGET_*_ALIGNMENT cleanup, and config-target.mak trimming Edgar E. Iglesias
2013-04-18 14:58 ` Riku Voipio
2013-04-18 19:39 ` Paolo Bonzini
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=1366208807-4433-5-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--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).