* [Qemu-devel] [PATCH] linux-user: fix fadvise64_64() on ppc
@ 2017-03-02 0:11 Laurent Vivier
2017-04-25 16:33 ` Laurent Vivier
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2017-03-02 0:11 UTC (permalink / raw)
To: Riku Voipio; +Cc: qemu-devel, Laurent Vivier
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>
---
linux-user/syscall.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2da8426..671b13a 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),
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user: fix fadvise64_64() on ppc
2017-03-02 0:11 [Qemu-devel] [PATCH] linux-user: fix fadvise64_64() on ppc Laurent Vivier
@ 2017-04-25 16:33 ` Laurent Vivier
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2017-04-25 16:33 UTC (permalink / raw)
To: Riku Voipio; +Cc: qemu-devel
Ping?
Laurent
Le 02/03/2017 à 01:11, Laurent Vivier a écrit :
> 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>
> ---
> linux-user/syscall.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 2da8426..671b13a 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),
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-25 16:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 0:11 [Qemu-devel] [PATCH] linux-user: fix fadvise64_64() on ppc Laurent Vivier
2017-04-25 16:33 ` Laurent Vivier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.