summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2017-03-02 01:11:45 +0100
committerRiku Voipio <riku.voipio@linaro.org>2017-05-29 14:56:07 +0300
commit43046b5a074029a9354bb2b772ca1f91320440f5 (patch)
treee5d8841c2717b314d301692e136e3d0a0b11596b /linux-user
parent562a20b4ef63bdde6e2e5bac0da02302aeb5299f (diff)
linux-user: fix fadvise64_64() on ppc
On ppc, advice is arg2, not arg6: long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, u32 len_high, u32 len_low) Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2da8426aaa..671b13a23b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11261,6 +11261,15 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_fadvise64_64
case TARGET_NR_fadvise64_64:
+#if defined(TARGET_PPC)
+ /* 6 args: fd, advice, offset (high, low), len (high, low) */
+ ret = arg2;
+ arg2 = arg3;
+ arg3 = arg4;
+ arg4 = arg5;
+ arg5 = arg6;
+ arg6 = ret;
+#else
/* 6 args: fd, offset (high, low), len (high, low), advice */
if (regpairs_aligned(cpu_env)) {
/* offset is in (3,4), len in (5,6) and advice in 7 */
@@ -11270,6 +11279,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
arg5 = arg6;
arg6 = arg7;
}
+#endif
ret = -host_to_target_errno(posix_fadvise(arg1,
target_offset64(arg2, arg3),
target_offset64(arg4, arg5),