1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/ports-2.6.1/120-lll_lock_t.patch Mon Oct 13 20:36:37 2008 +0000
1.3 @@ -0,0 +1,156 @@
1.4 +Propagate the patch from base glibc that changes lll_lock_t into a plain int,
1.5 +without using a typedef, as glibc-2.7 now does.
1.6 +
1.7 +diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
1.8 +--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2006-08-04 20:56:15.000000000 +0200
1.9 ++++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-07-28 23:49:29.000000000 +0200
1.10 +@@ -260,9 +260,6 @@
1.11 + /* Our internal lock implementation is identical to the binary-compatible
1.12 + mutex implementation. */
1.13 +
1.14 +-/* Type for lock object. */
1.15 +-typedef int lll_lock_t;
1.16 +-
1.17 + /* Initializers for lock. */
1.18 + #define LLL_LOCK_INITIALIZER (0)
1.19 + #define LLL_LOCK_INITIALIZER_LOCKED (1)
1.20 +diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
1.21 +--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2006-07-14 15:51:24.000000000 +0200
1.22 ++++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2008-07-28 23:49:56.000000000 +0200
1.23 +@@ -25,7 +25,7 @@
1.24 +
1.25 +
1.26 + void
1.27 +-__lll_lock_wait (lll_lock_t *futex)
1.28 ++__lll_lock_wait (int *futex)
1.29 + {
1.30 + do
1.31 + {
1.32 +@@ -38,7 +38,7 @@
1.33 +
1.34 +
1.35 + int
1.36 +-__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
1.37 ++__lll_timedlock_wait (int *futex, const struct timespec *abstime)
1.38 + {
1.39 + /* Reject invalid timeouts. */
1.40 + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
1.41 +@@ -78,7 +78,7 @@
1.42 + /* These don't get included in libc.so */
1.43 + #ifdef IS_IN_libpthread
1.44 + int
1.45 +-lll_unlock_wake_cb (lll_lock_t *futex)
1.46 ++lll_unlock_wake_cb (int *futex)
1.47 + {
1.48 + int val = atomic_exchange_rel (futex, 0);
1.49 +
1.50 +diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
1.51 +--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2006-09-07 18:34:43.000000000 +0200
1.52 ++++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2008-07-28 23:50:54.000000000 +0200
1.53 +@@ -43,11 +43,6 @@
1.54 + /* Initialize locks to zero. */
1.55 + #define LLL_MUTEX_LOCK_INITIALIZER (0)
1.56 +
1.57 +-
1.58 +-/* Type for lock object. */
1.59 +-typedef int lll_lock_t;
1.60 +-
1.61 +-
1.62 + #define lll_futex_wait(futexp, val) \
1.63 + ({ \
1.64 + INTERNAL_SYSCALL_DECL (__err); \
1.65 +@@ -108,7 +103,7 @@
1.66 + })
1.67 +
1.68 + static inline int __attribute__((always_inline))
1.69 +-__lll_mutex_trylock(lll_lock_t *futex)
1.70 ++__lll_mutex_trylock(int *futex)
1.71 + {
1.72 + return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
1.73 + }
1.74 +@@ -124,17 +119,17 @@
1.75 +
1.76 +
1.77 + static inline int __attribute__((always_inline))
1.78 +-__lll_mutex_cond_trylock(lll_lock_t *futex)
1.79 ++__lll_mutex_cond_trylock(int *futex)
1.80 + {
1.81 + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
1.82 + }
1.83 + #define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock))
1.84 +
1.85 +
1.86 +-extern void __lll_lock_wait (lll_lock_t *futex) attribute_hidden;
1.87 ++extern void __lll_lock_wait (int *futex) attribute_hidden;
1.88 +
1.89 + static inline void __attribute__((always_inline))
1.90 +-__lll_mutex_lock(lll_lock_t *futex)
1.91 ++__lll_mutex_lock(int *futex)
1.92 + {
1.93 + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
1.94 + __lll_lock_wait (futex);
1.95 +@@ -155,7 +150,7 @@
1.96 + __lll_robust_mutex_lock (&(futex), id)
1.97 +
1.98 + static inline void __attribute__ ((always_inline))
1.99 +-__lll_mutex_cond_lock (lll_lock_t *futex)
1.100 ++__lll_mutex_cond_lock (int *futex)
1.101 + {
1.102 + if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
1.103 + __lll_lock_wait (futex);
1.104 +@@ -167,13 +162,13 @@
1.105 + __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
1.106 +
1.107 +
1.108 +-extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *)
1.109 ++extern int __lll_timedlock_wait (int *futex, const struct timespec *)
1.110 + attribute_hidden;
1.111 + extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
1.112 + attribute_hidden;
1.113 +
1.114 + static inline int __attribute__ ((always_inline))
1.115 +-__lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime)
1.116 ++__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
1.117 + {
1.118 + int result = 0;
1.119 + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
1.120 +@@ -197,7 +192,7 @@
1.121 +
1.122 +
1.123 + static inline void __attribute__ ((always_inline))
1.124 +-__lll_mutex_unlock (lll_lock_t *futex)
1.125 ++__lll_mutex_unlock (int *futex)
1.126 + {
1.127 + int val = atomic_exchange_rel (futex, 0);
1.128 + if (__builtin_expect (val > 1, 0))
1.129 +@@ -218,7 +213,7 @@
1.130 +
1.131 +
1.132 + static inline void __attribute__ ((always_inline))
1.133 +-__lll_mutex_unlock_force (lll_lock_t *futex)
1.134 ++__lll_mutex_unlock_force (int *futex)
1.135 + {
1.136 + (void) atomic_exchange_rel (futex, 0);
1.137 + lll_futex_wake (futex, 1);
1.138 +@@ -239,7 +234,7 @@
1.139 + #define THREAD_INIT_LOCK(PD, LOCK) \
1.140 + (PD)->LOCK = LLL_LOCK_INITIALIZER
1.141 +
1.142 +-extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
1.143 ++extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
1.144 +
1.145 + /* The states of a lock are:
1.146 + 0 - untaken
1.147 +diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
1.148 +--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2006-08-04 20:54:56.000000000 +0200
1.149 ++++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2008-07-28 23:51:14.000000000 +0200
1.150 +@@ -227,9 +227,6 @@
1.151 + /* Our internal lock implementation is identical to the binary-compatible
1.152 + mutex implementation. */
1.153 +
1.154 +-/* Type for lock object. */
1.155 +-typedef int lll_lock_t;
1.156 +-
1.157 + /* Initializers for lock. */
1.158 + #define LLL_LOCK_INITIALIZER (0)
1.159 + #define LLL_LOCK_INITIALIZER_LOCKED (1)