From: Roland McGrath Date: Tue, 14 Jan 2003 07:53:41 +0000 (+0000) Subject: 2003-01-13 Roland McGrath X-Git-Tag: v4.5.18~864 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5c450d3c5353a74b0370b27594c70d3ad74ef47;p=strace 2003-01-13 Roland McGrath * 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 . --- diff --git a/defs.h b/defs.h index 11d0877d..3c20dd1d 100644 --- a/defs.h +++ b/defs.h @@ -124,11 +124,6 @@ #define __KERNEL__ #include #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 471879cc..618b0c8a 100644 --- 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]); }