Correct decoding of readahead and fadvice64(_64) on PowerPC

* file.c (sys_readahead): Align 64bit argument.  Handle PowerPC64
like other 64bit architectures.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Handle PowerPC like ARM.
* linux/powerpc/syscallent.h (sys_readahead): Account for 64bit
argument alignment on PowerPC32.
This commit is contained in:
Andreas Schwab 2009-11-03 15:21:14 +01:00
parent ccdff481c0
commit d45f0a66c1
2 changed files with 6 additions and 4 deletions

8
file.c
View File

@ -610,10 +610,11 @@ int
sys_readahead(struct tcb *tcp)
{
if (entering(tcp)) {
ALIGN64 (tcp, 1);
tprintf("%ld, %lld, %ld", tcp->u_arg[0],
# if defined LINUX_MIPSN32
tcp->ext_arg[1], tcp->u_arg[2]
# elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64
# elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64 || (defined POWERPC && defined __powerpc64__)
(long long int) tcp->u_arg[1], tcp->u_arg[2]
# else
LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]), tcp->u_arg[3]
@ -2815,9 +2816,10 @@ int
sys_fadvise64(struct tcb *tcp)
{
if (entering(tcp)) {
ALIGN64(tcp, 1);
tprintf("%ld, %lld, %ld, ",
tcp->u_arg[0],
# if defined IA64 || defined X86_64 || defined ALPHA
# if defined IA64 || defined X86_64 || defined ALPHA || (defined POWERPC && defined __powerpc64__)
(long long int) tcp->u_arg[1], tcp->u_arg[2]);
printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
#else
@ -2842,7 +2844,7 @@ sys_fadvise64_64(struct tcb *tcp)
#elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64
(long long int) tcp->u_arg[1], (long long int) tcp->u_arg[2]);
printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
#elif defined ARM
#elif defined ARM || defined POWERPC
LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]),
LONG_LONG(tcp->u_arg[4], tcp->u_arg[5]));
printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");

View File

@ -219,7 +219,7 @@
{ 5, 0, sys_putpmsg, "putpmsg" }, /* 188 */
{ 0, TP, sys_vfork, "vfork" }, /* 189 */
{ 2, 0, sys_getrlimit, "getrlimit" }, /* 190 */
{ 4, TD, sys_readahead, "readahead" }, /* 190 */
{ 5, TD, sys_readahead, "readahead" }, /* 190 */
{ 6, 0, sys_mmap, "mmap2" }, /* 192 */
{ 4, TF, sys_truncate64, "truncate64" }, /* 193 */
{ 4, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */