qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] linux-user: ppc: mark as long long aligned
@ 2012-09-30  1:32 Alexander Graf
  2012-09-30  1:32 ` [Qemu-devel] [PATCH 2/2] linux-user: register align p{read, write}64 Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexander Graf @ 2012-09-30  1:32 UTC (permalink / raw)
  To: qemu-devel qemu-devel
  Cc: Peter Maydell, Riku Voipio, qemu-ppc@nongnu.org List

The PPC32 ABI dictates that long long (64bit) parameters are pass in odd/even
register pairs. Because unlike ARM and MIPS we start at an odd register number,
we can reuse the same aligning code that ARM and MIPS use.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 linux-user/syscall.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1a38169..8cd56f2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -587,12 +587,16 @@ extern int setfsgid(int);
 extern int setgroups(int, gid_t *);
 
 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */
-#ifdef TARGET_ARM 
+#ifdef TARGET_ARM
 static inline int regpairs_aligned(void *cpu_env) {
     return ((((CPUARMState *)cpu_env)->eabi) == 1) ;
 }
 #elif defined(TARGET_MIPS)
 static inline int regpairs_aligned(void *cpu_env) { return 1; }
+#elif defined(TARGET_PPC) && !defined(TARGET_PPC64)
+/* PPC32 expects 64bit parameters to be passed on odd/even pairs of registers
+   which translates to the same as ARM/MIPS, because we start with r3 as arg1 */
+static inline int regpairs_aligned(void *cpu_env) { return 1; }
 #else
 static inline int regpairs_aligned(void *cpu_env) { return 0; }
 #endif
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-12 11:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-30  1:32 [Qemu-devel] [PATCH 1/2] linux-user: ppc: mark as long long aligned Alexander Graf
2012-09-30  1:32 ` [Qemu-devel] [PATCH 2/2] linux-user: register align p{read, write}64 Alexander Graf
2012-10-01 17:31   ` Alex Barcelo
2012-10-12 11:42   ` Peter Maydell
2012-10-01 13:04 ` [Qemu-devel] [PATCH 1/2] linux-user: ppc: mark as long long aligned Andreas Färber
2012-10-01 13:10   ` Alexander Graf
2012-10-01 17:27 ` malc

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).