about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-09-08 17:39:07 +0000
committerUlrich Drepper <drepper@redhat.com>2005-09-08 17:39:07 +0000
commitb9b8cf036684d69a1bac70cb604ad7dd4c31b8c4 (patch)
tree73a4fd4eedf757760c1ca1f7745407585efe67a3 /nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
parent4043787150772987ca8e377b2d488dae6b5d8a8b (diff)
downloadglibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.tar.gz
glibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.tar.xz
glibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.zip
(FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define. (lll_futex_wake_unlock): Define.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index 4626aec524..8d12db3a16 100644
--- a/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -30,6 +30,8 @@
 #define FUTEX_WAKE		1
 #define FUTEX_REQUEUE		3
 #define FUTEX_CMP_REQUEUE	4
+#define FUTEX_WAKE_OP		5
+#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE	((4 << 24) | 1)
 
 /* Initializer for compatibility lock.	*/
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
@@ -76,6 +78,19 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
+/* Returns non-zero if error happened, zero if success.  */
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret;							      \
+									      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
+			      (futexp), FUTEX_WAKE_OP, (nr_wake),	      \
+			      (nr_wake2), (futexp2),			      \
+			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
+    INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
+  })
+
 #ifdef __sparc32_atomic_do_lock
 #error SPARC < v9 does not support compare and swap which is essential for futex based locking
 #endif