diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-06-03 16:04:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-06-03 16:04:11 +0000 |
commit | 75fcceded2cfc65e4879521fff4db6a620a96363 (patch) | |
tree | 6d0763c5a2e4b59ece4d57a87232d435d15a5f7f /nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | |
parent | 322861e8b62dbca030a66f9ab37e6688b223c65f (diff) | |
download | glibc-75fcceded2cfc65e4879521fff4db6a620a96363.tar.gz glibc-75fcceded2cfc65e4879521fff4db6a620a96363.tar.xz glibc-75fcceded2cfc65e4879521fff4db6a620a96363.zip |
Update.
2004-06-03 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i486/bits/atomic.h: Optimize a bit.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 8b460eb98f..60679cca86 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -29,6 +29,7 @@ #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 #define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 /* Initializer for compatibility lock. */ #define LLL_MUTEX_LOCK_INITIALIZER (0) @@ -82,22 +83,29 @@ }) -#define lll_futex_requeue(futex, nr_wake, nr_move, mutex) \ +/* Returns non-zero if error happened, zero if success. */ +#if 0 +/* FIXME: s390 only supports up to 5 argument syscalls. Once FUTEX_CMP_REQUEUE + kernel interface for s390 is finalized, adjust this. */ +#define lll_futex_requeue(futex, nr_wake, nr_move, mutex, val) \ ({ \ - register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \ - register unsigned long int __r3 asm ("3") = FUTEX_REQUEUE; \ - register unsigned long int __r4 asm ("4") = (long int) (nr_wake); \ - register unsigned long int __r5 asm ("5") = (long int) (nr_move); \ - register unsigned long int __r6 asm ("6") = (unsigned long int) (mutex); \ - register unsigned long __result asm ("2"); \ + register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \ + register unsigned long int __r3 asm ("3") = FUTEX_CMP_REQUEUE; \ + register unsigned long int __r4 asm ("4") = (long int) (nr_wake); \ + register unsigned long int __r5 asm ("5") = (long int) (nr_move); \ + register unsigned long int __r6 asm ("6") = (unsigned long int) (mutex); \ + 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) \ : "cc", "memory" ); \ - __result; \ + __result > -4096UL; \ }) +#else +#define lll_futex_requeue(futex, nr_wake, nr_move, mutex, val) 1 +#endif #define lll_compare_and_swap(futex, oldval, newval, operation) \ |