From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1KiK-0001C1-8m for qemu-devel@nongnu.org; Tue, 05 May 2009 09:29:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1KiJ-0001Bl-OU for qemu-devel@nongnu.org; Tue, 05 May 2009 09:29:39 -0400 Received: from [199.232.76.173] (port=52848 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1KiJ-0001Bf-Id for qemu-devel@nongnu.org; Tue, 05 May 2009 09:29:39 -0400 Received: from naru.obs2.net ([84.20.150.76]:56586) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1KiI-00038N-TF for qemu-devel@nongnu.org; Tue, 05 May 2009 09:29:39 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id 55F64327404C for ; Tue, 5 May 2009 16:29:37 +0300 (EEST) Date: Tue, 5 May 2009 16:29:37 +0300 From: Riku Voipio Message-ID: <20090505132937.GA29336@kos.to> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] linux-user: support private futexes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Implemented the same way as in the kernel. Needed by newer glibc (2.9?) based userlands. From: Martin Mohring Signed-off-by: Riku Voipio --- linux-user/syscall.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 77fb7f6..1096bb1 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3925,7 +3925,11 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, /* ??? We assume FUTEX_* constants are the same on both host and target. */ +#ifdef FUTEX_CMD_MASK + switch ((op&FUTEX_CMD_MASK)) { +#else switch (op) { +#endif case FUTEX_WAIT: if (timeout) { pts = &ts; @@ -3933,17 +3937,17 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, } else { pts = NULL; } - return get_errno(sys_futex(g2h(uaddr), FUTEX_WAIT, tswap32(val), + return get_errno(sys_futex(g2h(uaddr), op, tswap32(val), pts, NULL, 0)); case FUTEX_WAKE: - return get_errno(sys_futex(g2h(uaddr), FUTEX_WAKE, val, NULL, NULL, 0)); + return get_errno(sys_futex(g2h(uaddr), op, val, NULL, NULL, 0)); case FUTEX_FD: - return get_errno(sys_futex(g2h(uaddr), FUTEX_FD, val, NULL, NULL, 0)); + return get_errno(sys_futex(g2h(uaddr), op, val, NULL, NULL, 0)); case FUTEX_REQUEUE: - return get_errno(sys_futex(g2h(uaddr), FUTEX_REQUEUE, val, + return get_errno(sys_futex(g2h(uaddr), op, val, NULL, g2h(uaddr2), 0)); case FUTEX_CMP_REQUEUE: - return get_errno(sys_futex(g2h(uaddr), FUTEX_CMP_REQUEUE, val, + return get_errno(sys_futex(g2h(uaddr), op, val, NULL, g2h(uaddr2), tswap32(val3))); default: return -TARGET_ENOSYS; -- 1.6.2.1