diff mbox

linux-user: declare sys_futex to have 6 arguments

Message ID 1373894260-57259-1-git-send-email-petar.jovanovic@rt-rk.com
State New
Headers show

Commit Message

Petar Jovanovic July 15, 2013, 1:17 p.m. UTC
From: Petar Jovanovic <petar.jovanovic@imgtec.com>

sys_futex has 6 arguments, and all of these need to be copied. Fix incorrect
declaration in the mips_syscall_args array.

This change fixes the cases where the 5th and 6th arguments have non-zero
value and have importance. An example is a Linux implementation of
pthread_cond_wait() function.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
---
 linux-user/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell July 15, 2013, 1:26 p.m. UTC | #1
On 15 July 2013 14:17, Petar Jovanovic <petar.jovanovic@rt-rk.com> wrote:
> From: Petar Jovanovic <petar.jovanovic@imgtec.com>
>
> sys_futex has 6 arguments, and all of these need to be copied. Fix incorrect
> declaration in the mips_syscall_args array.
>
> This change fixes the cases where the 5th and 6th arguments have non-zero
> value and have importance. An example is a Linux implementation of
> pthread_cond_wait() function.
>
> Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

This is the QEMU version of a bug fixed in the Linux kernel
by commit 90a67b590 in 2005...

thanks
-- PMM
Michael Tokarev July 16, 2013, 5:54 p.m. UTC | #2
15.07.2013 17:17, Petar Jovanovic wrote:
> From: Petar Jovanovic <petar.jovanovic@imgtec.com>
> 
> sys_futex has 6 arguments, and all of these need to be copied. Fix incorrect
> declaration in the mips_syscall_args array.

Thanks, applied to the trivial patches queue.

/mjt
diff mbox

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 7f15d3d..99c3b3f 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2028,7 +2028,7 @@  static const uint8_t mips_syscall_args[] = {
 	MIPS_SYS(sys_fremovexattr, 2)	/* 4235 */
 	MIPS_SYS(sys_tkill	, 2)
 	MIPS_SYS(sys_sendfile64	, 5)
-	MIPS_SYS(sys_futex	, 2)
+	MIPS_SYS(sys_futex	, 6)
 	MIPS_SYS(sys_sched_setaffinity, 3)
 	MIPS_SYS(sys_sched_getaffinity, 3)	/* 4240 */
 	MIPS_SYS(sys_io_setup	, 2)