]> granicus.if.org Git - strace/commitdiff
2003-01-13 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Tue, 14 Jan 2003 07:53:41 +0000 (07:53 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 14 Jan 2003 07:53:41 +0000 (07:53 +0000)
* defs.h [POWERPC] (UESP, EIP, EAX, ORIG_EAX): Remove this cruft.
[LINUX && POWERPC && !__powerpc64__] (ALIGN64): New macro.
* io.c (sys_pread, sys_pwrite): Use ALIGN64.
From Anton Blanchard <anton@samba.org>.

defs.h
io.c

diff --git a/defs.h b/defs.h
index 11d0877d41bf212af3b030722e5a46987464e94a..3c20dd1d0596f17dfb3bdd41244dfb93dd94fd02 100644 (file)
--- a/defs.h
+++ b/defs.h
 #define __KERNEL__
 #include <asm/ptrace.h>
 #undef __KERNEL__
-/* TEMP */
-#define UESP   PT_R1
-#define EIP    PT_NIP
-#define EAX    PT_R3
-#define ORIG_EAX PT_ORIG_R3
 #endif
 #ifdef __STDC__
 #ifdef LINUX
@@ -550,6 +545,13 @@ do {                                                                       \
            memmove (&tcp->u_arg[arg], &tcp->u_arg[arg + 1],            \
                     (tcp->u_nargs - arg - 1) * sizeof tcp->u_arg[0]);  \
 } while (0)
+#elif defined(LINUX) && defined(POWERPC) && !defined(__powerpc64__)
+#define ALIGN64(tcp,arg)                                               \
+do {                                                                   \
+       if (!(arg % 2))                                                 \
+           memmove (&tcp->u_arg[arg], &tcp->u_arg[arg + 1],            \
+                    (tcp->u_nargs - arg - 1) * sizeof tcp->u_arg[0]);  \
+} while (0)
 #else
 #define ALIGN64(tcp,arg) do { } while (0)
 #endif
diff --git a/io.c b/io.c
index 471879cc6e2733b35120b63d073639656775fd3a..618b0c8a29a981ac0ddc49a948f0264458dc2f96 100644 (file)
--- a/io.c
+++ b/io.c
@@ -242,6 +242,7 @@ struct tcb *tcp;
                        tprintf("%#lx", tcp->u_arg[1]);
                else
                        printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+               ALIGN64 (tcp, 2); /* PowerPC alignment restriction */
                tprintf(", %lu, %llu", tcp->u_arg[2],
                        *(unsigned long long *)&tcp->u_arg[3]);
        }
@@ -255,6 +256,7 @@ struct tcb *tcp;
        if (entering(tcp)) {
                tprintf("%ld, ", tcp->u_arg[0]);
                printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+               ALIGN64 (tcp, 2); /* PowerPC alignment restriction */
                tprintf(", %lu, %llu", tcp->u_arg[2],
                        *(unsigned long long *)&tcp->u_arg[3]);
        }