aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mohring <martin.mohring@opensuse.org>2009-05-04 21:34:56 +0300
committerRiku Voipio <riku.voipio@nokia.com>2009-06-16 16:56:29 +0300
commita29ccd6382eb4c9df72cfd10e279d5f56448b0f4 (patch)
tree803d7754edc662606a4f93ff21c666ae4d9225cc
parent350d1779f81817223751c0beb89722139cfce7e2 (diff)
linux-user: support private futexes
Implemented the same way as in the kernel. From: Martin Mohring <martin.mohring@opensuse.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
-rw-r--r--linux-user/syscall.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0c7ce51f04..59c8558dc8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3926,7 +3926,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;
@@ -3934,17 +3938,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;