crosstool-ng/patches/glibc/ports-2.6.1/120-lll_lock_t.patch

157 lines
5.7 KiB
Diff
Raw Permalink Normal View History

Propagate the patch from base glibc that changes lll_lock_t into a plain int,
without using a typedef, as glibc-2.7 now does.
diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
--- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2006-08-04 20:56:15.000000000 +0200
+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-07-28 23:49:29.000000000 +0200
@@ -260,9 +260,6 @@
/* Our internal lock implementation is identical to the binary-compatible
mutex implementation. */
-/* Type for lock object. */
-typedef int lll_lock_t;
-
/* Initializers for lock. */
#define LLL_LOCK_INITIALIZER (0)
#define LLL_LOCK_INITIALIZER_LOCKED (1)
diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
--- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2006-07-14 15:51:24.000000000 +0200
+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2008-07-28 23:49:56.000000000 +0200
@@ -25,7 +25,7 @@
void
-__lll_lock_wait (lll_lock_t *futex)
+__lll_lock_wait (int *futex)
{
do
{
@@ -38,7 +38,7 @@
int
-__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
+__lll_timedlock_wait (int *futex, const struct timespec *abstime)
{
/* Reject invalid timeouts. */
if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
@@ -78,7 +78,7 @@
/* These don't get included in libc.so */
#ifdef IS_IN_libpthread
int
-lll_unlock_wake_cb (lll_lock_t *futex)
+lll_unlock_wake_cb (int *futex)
{
int val = atomic_exchange_rel (futex, 0);
diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
--- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2006-09-07 18:34:43.000000000 +0200
+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2008-07-28 23:50:54.000000000 +0200
@@ -43,11 +43,6 @@
/* Initialize locks to zero. */
#define LLL_MUTEX_LOCK_INITIALIZER (0)
-
-/* Type for lock object. */
-typedef int lll_lock_t;
-
-
#define lll_futex_wait(futexp, val) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
@@ -108,7 +103,7 @@
})
static inline int __attribute__((always_inline))
-__lll_mutex_trylock(lll_lock_t *futex)
+__lll_mutex_trylock(int *futex)
{
return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
}
@@ -124,17 +119,17 @@
static inline int __attribute__((always_inline))
-__lll_mutex_cond_trylock(lll_lock_t *futex)
+__lll_mutex_cond_trylock(int *futex)
{
return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
}
#define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock))
-extern void __lll_lock_wait (lll_lock_t *futex) attribute_hidden;
+extern void __lll_lock_wait (int *futex) attribute_hidden;
static inline void __attribute__((always_inline))
-__lll_mutex_lock(lll_lock_t *futex)
+__lll_mutex_lock(int *futex)
{
if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
__lll_lock_wait (futex);
@@ -155,7 +150,7 @@
__lll_robust_mutex_lock (&(futex), id)
static inline void __attribute__ ((always_inline))
-__lll_mutex_cond_lock (lll_lock_t *futex)
+__lll_mutex_cond_lock (int *futex)
{
if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
__lll_lock_wait (futex);
@@ -167,13 +162,13 @@
__lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
-extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *)
+extern int __lll_timedlock_wait (int *futex, const struct timespec *)
attribute_hidden;
extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
attribute_hidden;
static inline int __attribute__ ((always_inline))
-__lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime)
+__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
{
int result = 0;
if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
@@ -197,7 +192,7 @@
static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock (lll_lock_t *futex)
+__lll_mutex_unlock (int *futex)
{
int val = atomic_exchange_rel (futex, 0);
if (__builtin_expect (val > 1, 0))
@@ -218,7 +213,7 @@
static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock_force (lll_lock_t *futex)
+__lll_mutex_unlock_force (int *futex)
{
(void) atomic_exchange_rel (futex, 0);
lll_futex_wake (futex, 1);
@@ -239,7 +234,7 @@
#define THREAD_INIT_LOCK(PD, LOCK) \
(PD)->LOCK = LLL_LOCK_INITIALIZER
-extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
+extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
/* The states of a lock are:
0 - untaken
diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
--- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2006-08-04 20:54:56.000000000 +0200
+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2008-07-28 23:51:14.000000000 +0200
@@ -227,9 +227,6 @@
/* Our internal lock implementation is identical to the binary-compatible
mutex implementation. */
-/* Type for lock object. */
-typedef int lll_lock_t;
-
/* Initializers for lock. */
#define LLL_LOCK_INITIALIZER (0)
#define LLL_LOCK_INITIALIZER_LOCKED (1)