From 702a94146a857a3b5e5bcfccca4a79e2357dfde0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 14 Aug 2007 19:37:50 +0000 Subject: * sysdeps/ieee754/ldbl-64-128/strtold_l.c (__STRTOF): Declare. Add libc_hidden_proto. (STRTOF): Add libc_hidden_proto. (___new_strtold_l, ___new_wcstold_l): New weak aliases. (strtold_l, wcstold_l): Use them as second argument for long_double_symbol. nptl/ * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock, __lll_robust_unlock): Rewrite as macros instead of inline functions. * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock, __lll_robust_unlock, __lll_wait_tid): Likewise. 2007-08-14 Jakub Jelinek * sysdeps/ieee754/ldbl-64-128/strtold_l.c (__STRTOF): Declare. Add libc_hidden_proto. (STRTOF): Add libc_hidden_proto. (___new_strtold_l, ___new_wcstold_l): New weak aliases. (strtold_l, wcstold_l): Use them as second argument for long_double_symbol. --- nptl/ChangeLog | 7 +++ nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h | 28 +++++------ nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | 60 +++++++++++------------ 3 files changed, 50 insertions(+), 45 deletions(-) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index e56ece02bd..43d97f687e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2007-08-14 Jakub Jelinek + + * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock, + __lll_robust_unlock): Rewrite as macros instead of inline functions. + * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock, + __lll_robust_unlock, __lll_wait_tid): Likewise. + 2007-08-13 Jakub Jelinek * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag): diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h index 4f6796449a..4487607bb3 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h @@ -226,23 +226,23 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, __lll_robust_timedlock (&(futex), abstime, id, private) -static inline void __attribute__ ((always_inline)) -__lll_unlock (int *futex, int private) -{ - int val = atomic_exchange_rel (futex, 0); - if (__builtin_expect (val > 1, 0)) - lll_futex_wake (futex, 1, private); -} +#define __lll_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + ({ int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) #define lll_unlock(futex, private) __lll_unlock(&(futex), private) -static inline void __attribute__ ((always_inline)) -__lll_robust_unlock (int *futex, int private) -{ - int val = atomic_exchange_rel (futex, 0); - if (__builtin_expect (val & FUTEX_WAITERS, 0)) - lll_futex_wake (futex, 1, private); -} +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) #define lll_robust_unlock(futex, private) \ __lll_robust_unlock(&(futex), private) diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 7fee435f12..c9347e98b2 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -291,31 +291,29 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, __lll_robust_timedlock (&(futex), abstime, id, private) -static inline void -__attribute__ ((always_inline)) -__lll_unlock (int *futex, int private) -{ - int oldval; - int newval = 0; - - lll_compare_and_swap (futex, oldval, newval, "slr %2,%2"); - if (__builtin_expect (oldval > 1, 0)) - lll_futex_wake (futex, 1, private); -} +#define __lll_unlock(futex, private) \ + (void) \ + ({ int __oldval; \ + int __newval = 0; \ + int *__futexp = (futex); \ + \ + lll_compare_and_swap (__futexp, __oldval, __newval, "slr %2,%2"); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futexp, 1, private); \ + }) #define lll_unlock(futex, private) __lll_unlock(&(futex), private) -static inline void -__attribute__ ((always_inline)) -__lll_robust_unlock (int *futex, int private) -{ - int oldval; - int newval = 0; - - lll_compare_and_swap (futex, oldval, newval, "slr %2,%2"); - if (__builtin_expect (oldval & FUTEX_WAITERS, 0)) - lll_futex_wake (futex, 1, private); -} +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int __oldval; \ + int __newval = 0; \ + int *__futexp = (futex); \ + \ + lll_compare_and_swap (__futexp, __oldval, __newval, "slr %2,%2"); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futexp, 1, private); \ + }) #define lll_robust_unlock(futex, private) \ __lll_robust_unlock(&(futex), private) @@ -331,15 +329,15 @@ __lll_robust_unlock (int *futex, int private) wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ -static inline void -__attribute__ ((always_inline)) -__lll_wait_tid (int *ptid) -{ - int tid; - - while ((tid = *ptid) != 0) - lll_futex_wait (ptid, tid, LLL_SHARED); -} +#define __lll_wait_tid(ptid) \ + do \ + { \ + int __tid; \ + \ + while ((__tid = *ptid) != 0) \ + lll_futex_wait (ptid, __tid, LLL_SHARED); \ + } \ + while (0) #define lll_wait_tid(tid) __lll_wait_tid(&(tid)) extern int __lll_timedwait_tid (int *, const struct timespec *) -- cgit 1.4.1