diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-09-08 17:39:07 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-09-08 17:39:07 +0000 |
commit | b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4 (patch) | |
tree | 73a4fd4eedf757760c1ca1f7745407585efe67a3 /nptl/sysdeps/unix/sysv/linux/s390 | |
parent | 4043787150772987ca8e377b2d488dae6b5d8a8b (diff) | |
download | glibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.tar glibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.tar.gz glibc-b9b8cf036684d69a1bac70cb604ad7dd4c31b8c4.tar.bz2 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/s390')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index f4ed98a503..5f20537943 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/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) @@ -103,6 +105,27 @@ }) +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futex, nr_wake, nr_wake2, futex2) \ + ({ \ + register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \ + register unsigned long int __r3 asm ("3") = FUTEX_WAKE_OP; \ + register unsigned long int __r4 asm ("4") = (long int) (nr_wake); \ + register unsigned long int __r5 asm ("5") = (long int) (nr_wake2); \ + register unsigned long int __r6 asm ("6") = (unsigned long int) (futex2); \ + register unsigned long int __r7 asm ("7") \ + = (int) FUTEX_OP_CLEAR_WAKE_IF_GT_ONE; \ + register unsigned long __result asm ("2"); \ + \ + __asm __volatile ("svc %b1" \ + : "=d" (__result) \ + : "i" (SYS_futex), "0" (__r2), "d" (__r3), \ + "d" (__r4), "d" (__r5), "d" (__r6), "d" (__r7) \ + : "cc", "memory" ); \ + __result > -4096UL; \ + }) + + #define lll_compare_and_swap(futex, oldval, newval, operation) \ do { \ __typeof (futex) __futex = (futex); \ |