summaryrefslogtreecommitdiff
path: root/patches/glibc/ports-2.6.1/120-lll_lock_t.patch
blob: b6743371f8708855761d6c54db81829891c28b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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)