Update.
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
2
3         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4         include <sysdep-cancel.h>, vfork is no cancellation point.
5         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
6         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
7         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
8
9 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
10
11         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
12         libc_hidden_def.
13         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
14         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
15         Likewise.
16         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
17         Likewise.
18         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
19         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
20         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
21         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
22         of DO_CALL_VIA_BREAK.  Work around a gas problem.
23
24         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
25         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
26         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
27         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
28         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
29         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
30
31         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
32         a local register for saving old PID.  Negate PID in parent upon exit.
33
34         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
35         tcb-offsets.h.
36         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
37         before syscall, set to the old value in the parent afterwards.
38         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
39         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
40         tcb-offsets.h.
41         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
42         before syscall, set to the old value in the parent afterwards.
43         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
44         * sysdeps/s390/tcb-offsets.sym: Add PID.
45
46         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
47         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
48         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
49         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
50         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
51         * sysdeps/sparc/tcb-offsets.sym: Add PID.
52
53 2004-03-10  Andreas Schwab  <schwab@suse.de>
54
55         * sysdeps/ia64/tcb-offsets.sym: Add PID.
56         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
57         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
58
59 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
60
61         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
62         * tst-cancel21.c (do_one_test): Likewise.
63         Reported by Gordon Jin <gordon.jin@intel.com>.
64
65 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
66
67         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
68         if non-zero and set to INT_MIN if zero.
69         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
70         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
71         (SAVE_PID, RESTORE_PID): Define.
72         (__vfork): Use it.
73         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
74         Use relative path to avoid including NPTL i386/vfork.S.
75         (SAVE_PID, RESTORE_PID): Define.
76         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
77         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
78         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
79         tst-vfork2x.
80         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
81         * tst-vfork1.c: New test.
82         * tst-vfork2.c: New test.
83         * tst-vfork1x.c: New test.
84         * tst-vfork2x.c: New test.
85
86 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
87
88         * sysdeps/i386/tcb-offsets.sym: Add PID.
89         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
90         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
91         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
92
93 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
94
95         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
96
97 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
98
99         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
100         _rtld_global_ro.
101
102 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
103
104         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
105         _rtld_global_ro.
106
107         * tst-once4.c: Remove unnecessary macro definition.
108
109         * tst-mutex7.c (do_test): Limit thread stack size.
110         * tst-once2.c (do_test): Likewise.
111         * tst-tls3.c (do_test): Likewise.
112         * tst-tls1.c (do_test): Likewise.
113         * tst-signal3.c (do_test): Likewise.
114         * tst-kill6.c (do_test): Likewise.
115         * tst-key4.c (do_test): Likewise.
116         * tst-join4.c (do_test): Likewise.
117         * tst-fork1.c (do_test): Likewise.
118         * tst-context1.c (do_test): Likewise.
119         * tst-cond2.c (do_test): Likewise.
120         * tst-cond10.c (do_test): Likewise.
121         * tst-clock2.c (do_test): Likewise.
122         * tst-cancel10.c (do_test): Likewise.
123         * tst-basic2.c (do_test): Likewise.
124         * tst-barrier4.c (do_test): Likewise.
125
126 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
127
128         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
129
130 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
131
132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
133         (__pthread_cond_timedwait): Optimize wakeup test.
134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
135         (__pthread_cond_wait): Likewise.
136         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
137         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
138         Likewise.
139
140 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
141
142         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
143         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
144         the atomic instruction needed.
145         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
146         (__lll_mutex_lock_wait): Likewise.
147
148 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
149
150         * Makefile (tests): Add tst-cond14 and tst-cond15.
151         * tst-cond14.c: New file.
152         * tst-cond15.c: New file.
153
154 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
155
156         * sysdeps/pthread/createthread.c (create_thread): Remove use of
157         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
158         needs to be implemented differently to be useful.
159
160 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
161
162         * pthread_attr_setschedparam.c: Don't test priority against limits
163         here.  Set ATTR_FLAG_SCHED_SET flag.
164         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
165         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
166         from parent thread to child.  If attribute is used and scheduling
167         parameters are not inherited, copy parameters from attribute or
168         compute them.  Check priority value.
169         * pthread_getschedparam.c: If the parameters aren't known yet get
170         them from the kernel.
171         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
172         ATTR_FLAG_POLICY_SET flag for thread.
173         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
174         and ATTR_FLAG_POLICY_SET.
175
176         * sysdeps/pthread/createthread.c: Use tgkill if possible.
177
178         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
179         fail if stack address hasn't been set.  Just return 0.
180
181 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
182
183         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
184         libpthread for the files in this list.
185         (CFLAGS-tst-unload): Removed.
186         * tst-unload.c (do_test): Don't use complete path for
187         LIBPHREAD_SO.
188
189         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
190         tst-_res1mod2.
191
192 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
193
194         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
195         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
196         operation per round is needed.
197         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
198         (__lll_mutex_lock_wait): Likewise.
199
200 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
201
202         * tst-cancel9.c (cleanup): Don't print to stderr.
203
204 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
205
206         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
207
208 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
209
210         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
211         (__syscall_error_handler2): Call CDISABLE.
212         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
213         (__syscall_error_handler2): Call CDISABLE.
214
215         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
216         Release lock before the loop, don't reacquire it.
217
218         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
219
220 2004-02-19  Andreas Schwab  <schwab@suse.de>
221
222         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
223         Fix last change.
224
225 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
226
227         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
228         (pthread_barrier_wait): After wakeup, release lock only when the
229         last thread stopped using the barrier object.
230         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
231         (pthread_barrier_wait): Likewise.
232         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
233         Likewise.
234         * Makefile (tests): Add tst-barrier4.
235         * tst-barrier4.c: New file.
236
237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
238         (__pthread_cond_timedwait): Perform timeout test while holding
239         internal lock to prevent wakeup race.
240         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
241         * sysdeps/pthread/pthread_cond_timedwait.c
242         (__pthread_cond_timedwait): Likewise.
243         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
244         (__pthread_cond_timedwait): Likewise.
245
246 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
247
248         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
249         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
250         * Makefile (tests): Add tst-rwlock13.
251         * tst-rwlock13.c: New test.
252
253 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
254
255         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
256         (__condvar_tw_cleanup): Little optimization.
257         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
258
259 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
260
261         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
262         libpthread as "lib" parameter to SHLIB_COMPAT.
263         (__novmx_siglongjmp): Fix typo in function name.
264         (__novmx_longjmp): Fix typo in function name.
265
266 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
267
268         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
269         __builtin_expect.
270
271         * sysdeps/generic/pt-longjmp.c: Moved to...
272         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
273
274 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
275
276         * Makefile (libpthread-routines): Add pt-cleanup.
277         * pt-longjmp.c: Removed.
278         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
279         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
280         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
281         Version longjmp, siglongjmp for GLIBC_2.3.4.
282         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
283
284 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
285
286         * sysdeps/pthread/pthread_cond_timedwait.c
287         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
288         Reuse code.  Add __builtin_expects.
289
290         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
291         (__pthread_cond_timedwait): Get internal lock in case timeout has
292         passed before the futex syscall.
293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
294
295 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
296
297         * allocatestack.c: Pretty printing.
298
299         * sysdeps/pthread/createthread.c (create_thread): Don't add
300         CLONE_DETACHED bit if it is not necessary.
301
302 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
303
304         * pthread_getattr_np.c: Include ldsodefs.h.
305
306 2004-01-16  Richard Henderson  <rth@redhat.com>
307
308         * allocatestack.c: Don't declare __libc_stack_end.
309         * init.c (__pthread_initialize_minimal_internal): Likewise.
310         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
311
312 2004-01-15  Richard Henderson  <rth@redhat.com>
313
314         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
315         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
316         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
317         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
318         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
319         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
320         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
321         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
322
323 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
324
325         * init.c (pthread_functions): Make array const.
326
327 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
328
329         * allocatestack.c (__make_stacks_executable): Change interface.
330         Check parameters.  Pass parameter on to libc counterpart.
331         * pthreadP.h: Change declaration.
332
333 2004-01-13  Richard Henderson  <rth@redhat.com>
334
335         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
336         prototype form.
337         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
338         Likewise.
339
340         * sysdeps/alpha/Makefile: New file.
341         * sysdeps/alpha/tcb-offsets.sym: New file.
342         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
343         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
344
345         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
346         on powerpc version.
347
348 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
349
350         * Makefile (tests): Add tst-backtrace1.
351         * tst-backtrace1.c: New test.
352
353 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
354
355         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
356         register as second parameter to the REGISTER macro.
357         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
358         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
359         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
360         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
361         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
362         of thread register as second parameter to REGISTER macro in 64 case.
363
364 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
365
366         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
367         (CFLAGS-getpid.o): Defined.
368         (CFLAGS-getpid.os): Defined.
369
370 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
371
372         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
373         returned for main thread does not overlap with any other VMA.
374         Patch by Jakub Jelinek.
375
376 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
377
378         * tst-raise1.c: Include stdio.h.
379
380 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
381
382         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
383         setting with __ASSUME_TGKILL || defined __NR_tgkill.
384         If pid is 0, set it to selftid.
385         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
386         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
387         != 0, return self->tid without doing a syscall.
388         * descr.h (struct pthread): Move pid field after tid.
389
390         * Makefile (tests): Add tst-raise1.
391         * tst-raise1.c: New file.
392
393 2003-12-23  Roland McGrath  <roland@redhat.com>
394
395         * tst-oddstacklimit.c: New file.
396         * Makefile (tests): Add it.
397         (tst-oddstacklimit-ENV): New variable.
398
399         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
400         value up to page size for __default_stacksize.
401
402 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
403
404         * Makefile (tests): Add tst-eintr5.
405         * tst-eintr5.c: New file.
406
407         * eintr.c (eintr_source): Prevent sending signal to self.
408
409         * tst-eintr2.c (tf1): Improve error message.
410
411 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
412
413         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
414         * sysdeps/unix/sysv/linux/getpid.c: New file.
415         * pthread_cancel.c: Add comment explaining use of PID field.
416         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
417         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
418         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
419         temporarily to signal the field must not be relied on and updated
420         by getpid().
421         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
422         temporarily negative.
423         * sysdeps/unix/sysv/linux/raise.c: Likewise.
424
425 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
426
427         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
428         (eintr_source): If ARG != NULL, use pthread_kill.
429         * tst-eintr1.c: Adjust for this change.
430         * tst-eintr2.c: Likewise.
431         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
432         * tst-eintr3.c: New file.
433         * tst-eintr4.c: New file.
434
435 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
436
437         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
438         if CANCELSTATE_BITMASK is set.
439         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
440         Likewise.
441
442         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
443         (tests-reverse): Add tst-cancel23.
444         * tst-cancel22.c: New test.
445         * tst-cancel23.c: New test.
446
447 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
448
449         * tst-eintr1.c: Better error messages.
450
451         * Makefile (tests): Add tst-eintr2.
452         * tst-eintr2.c: New file.
453
454 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
455
456         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
457         (CFLAGS-tst-cancelx21.c): Set.
458         * tst-cancel21.c: New test.
459         * tst-cancelx21.c: New test.
460
461         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
462         comparison operand.
463         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
464         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
465         * pt-longjmp.c: Include jmpbuf-unwind.h.
466         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
467         _JMPBUF_UNWINDS.  Adjust compared pointers.
468         * init.c (__pthread_initialize_minimal_internal): Initialize
469         pd->stackblock_size.
470         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
471         * sysdeps/alpha/jmpbuf-unwind.h: New file.
472         * sysdeps/i386/jmpbuf-unwind.h: New file.
473         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
474         * sysdeps/s390/jmpbuf-unwind.h: New file.
475         * sysdeps/sh/jmpbuf-unwind.h: New file.
476         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
477         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
478         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
479         (_JMPBUF_CFA_UNWINDS): Remove.
480         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
481
482 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
483
484         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
485         (CFLAGS-tst-cancelx20.c): Set.
486         * tst-cancel20.c: New test.
487         * tst-cancelx20.c: New test.
488
489 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
490
491         * init.c (__pthread_initialize_minimal_internal): Don't treat
492         architectures with separate register stack special here when
493         computing default stack size.
494
495 2003-12-17  Roland McGrath  <roland@redhat.com>
496
497         * Makefile (tst-cancelx7-ARGS): New variable.
498         Reportd by Greg Schafer <gschafer@zip.com.au>.
499
500 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
501
502         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
503         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
504         (tst-stack3-ENV): Set.
505         ($(objpfx)tst-stack3-mem): New.
506         * tst-stack3.c: New test.
507
508 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
509
510         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
511         Add unwind directives.  Drop unused .regstk directive.
512         (_fini_EPILOG_BEGINS): Add unwind directives.
513
514 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
515
516         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
517         Assume parameter is a pointer.
518         (lll_futex_wake): Likewise.
519         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
520         Likewise.
521         (lll_futex_wake): Likewise.
522         Reported by Boris Hu.
523         * sysdeps/unix/sysv/linux/unregister-atfork.c
524         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
525
526         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
527
528 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
529
530         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
531         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
532         __rtld_lock_initialize for ld.so lock.
533         Patch in part by Adam Li <adam.li@intel.com>.
534
535 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
536
537         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
538         in $(gnulib).  Also, remove stale comment.
539
540 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
541
542         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
543         advantage of new syscall stub and optimize accordingly.
544
545         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
546         from SYS_futex, to match expectations of
547         sysdep.h:DO_INLINE_SYSCALL.
548         (lll_futex_clobbers): Remove.
549         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
550         (lll_futex_wake): Likewise.
551         (lll_futex_requeue): Likewise.
552         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
553         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
554         Jelinek).
555         (__lll_mutex_lock): Likewise.
556         (__lll_mutex_cond_lock): Likewise.
557         (__lll_mutex_timed_lock): Likewise.
558         (__lll_mutex_unlock): Likewise.
559         (__lll_mutex_unlock_force): Likewise.
560
561         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
562         comes before the include of <sysdep.h>.
563         (THREAD_SELF_SYSINFO): New macro.
564         (THREAD_SYSINFO): Likewise.
565         (INIT_SYSINFO): New macro.
566         (TLS_INIT_TP): Call INIT_SYSINFO.
567
568         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
569
570         * sysdeps/pthread/createthread.c (create_thread): Use
571         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
572         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
573         THREAD_SELF_SYSINFO instead of open code.
574         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
575         (THREAD_SYSINFO): Likewise.
576
577         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
578
579         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
580
581 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
582
583         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
584         instead of .init.  Patch by David Mosberger.
585
586 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
587
588         * sysdeps/pthread/configure.in: Remove broken declaration in C
589         cleanup handling check.
590
591 2003-11-30  Andreas Jaeger  <aj@suse.de>
592
593         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
594         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
595         Likewise.
596
597 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
598
599         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
600         * pthread_attr_destroy.c: Include shlib-compat.h.
601         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
602         is set in iattr->flags.
603         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
604
605 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
606
607         * Makefile (distribute): Add tst-cleanup4aux.c.
608
609         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
610         include.
611
612 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
613
614         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
615         pthread_cond_signal.
616
617         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
618         store mutex address if the current value is ~0l.
619         * sysdeps/pthread/pthread_cond_timedwait.c
620         (__pthread_cond_timedwait): Likewise.
621         * sysdeps/pthread/pthread_cond_broadcast.c
622         (__pthread_cond_broadcast): Don't use requeue for pshared
623         condvars.
624
625         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
626         (__pthread_cond_wait): Don't store mutex address if the current
627         value is ~0l.
628         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
629         (__pthread_cond_timedwait): Likewise.
630         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
631         (__pthread_cond_broadcast): Don't use requeue for pshared
632         condvars.
633
634         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
635         element with ~0l for pshared condvars, with NULL otherwise.
636
637         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
638         (__pthread_cond_wait): Don't store mutex address if the current
639         value is ~0l.
640         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
641         (__pthread_cond_timedwait): Likewise.
642         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
643         (__pthread_cond_broadcast): Don't use requeue for pshared
644         condvars.
645
646         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
647         * tst-cond12.c: New file.
648         * tst-cond13.c: New file.
649
650 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
651
652         * sysdeps/pthread/configure.in: Make missing forced unwind support
653         fatal.
654
655 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
656
657         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
658
659 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
660
661         * Makefile: Add magic to clean up correctly.
662
663 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
664
665         * unwind.c (FRAME_LEFT): Define.
666         (unwind_stop): Handle old style cleanups here.
667         (__pthread_unwind): Handle old style cleanups only if
668         !HAVE_FORCED_UNWIND.
669         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
670         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
671         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
672         ($(objpfx)tst-cleanupx4): Likewise.
673         * tst-cleanup4.c: New test.
674         * tst-cleanup4aux.c: New.
675         * tst-cleanupx4.c: New test.
676
677 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
678
679         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
680         lll_mutex_*lock macros to skip atomic operations on some archs.
681
682 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
683
684         * sysdeps/pthread/tst-timer.c (main): Initialize
685         sigev2.sigev_value as well.
686
687 2003-10-15  Roland McGrath  <roland@redhat.com>
688
689         * sysdeps/pthread/configure.in: Barf if visibility attribute support
690         is missing.
691         * sysdeps/pthread/configure: Regenerated.
692
693 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
694
695         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
696         locking macros.  No distinction between normal and mutex locking
697         anymore.
698         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
699         Merge bits from lowlevelmutex.S we still need.
700         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
701         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
702         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
703         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
704         new mutex implementation.
705         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
706         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
707         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
708         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
709         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
710         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
711         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
712         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
713         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
714         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
715         symbol for entry point to avoid cancellation.
716
717 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
718
719         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
720         changes.
721         (SAVE_OLDTYPE_0): Fix a typo.
722
723 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
724
725         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
726         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
727
728 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
729
730         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
731         correct offset.
732
733 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
734
735         * Makefile (tests): Add tst-cancel19.
736         * tst-cancel19.c: New test.
737
738 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
739
740         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
741         restoring of the old cancellation type.
742
743 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
744
745         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
746
747 2003-09-27  Wolfram Gloger  <wg@malloc.de>
748
749         * sysdeps/pthread/malloc-machine.h: New file
750
751 2003-09-24  Roland McGrath  <roland@redhat.com>
752
753         * allocatestack.c (__make_stacks_executable): Don't ignore return
754         value from _dl_make_stack_executable.
755
756 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
757
758         * allocatestack.c (__make_stacks_executable): Also change
759         permission of the currently unused stacks.
760
761         * allocatestack.c (change_stack_perm): Split out from
762         __make_stacks_executable.
763         (allocate_stack): If the required permission changed between the time
764         we started preparing the stack and queueing it, change the permission.
765         (__make_stacks_executable): Call change_stack_perm.
766
767         * Makefile: Build tst-execstack-mod locally.
768         * tst-execstack-mod.c: New file.
769
770 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
771
772         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
773
774 2003-09-23  Roland McGrath  <roland@redhat.com>
775
776         * tst-execstack.c: New file.
777         * Makefile (tests): Add it.
778         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
779         (LDFLAGS-tst-execstack): New variable.
780
781         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
782         whether to use PROT_EXEC for stack mmap.
783         (__make_stacks_executable): New function.
784         * pthreadP.h: Declare it.
785         * init.c (__pthread_initialize_minimal_internal): Set
786         GL(dl_make_stack_executable_hook) to that.
787
788 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
789
790         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
791         recommendation from AMD re avoidance of lock prefix.
792
793 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
794
795         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
796         lll_futex_timed_wait instead of lll_futex_wait.
797         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
798         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
799         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
800         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
801         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
802         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
803         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
804         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
805         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
806         Completely revamp the locking macros.  No distinction between
807         normal and mutex locking anymore.
808         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
809         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
810         __lll_lock_timedwait): Fix prototypes.
811         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
812         __lll_lock_timedwait): Likewise.
813         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
814         macros, add __builtin_expect.
815         (lll_mutex_timedlock): Likewise.  Fix return value.
816         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
817         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
818         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
819         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
820         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
821         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
822         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
823         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
824
825 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
826
827         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
828         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
829         operation if possible.
830
831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
832         like jumping over the lock prefix.
833
834 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
835
836         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
837         locking macros.  No distinction between normal and mutex locking
838         anymore.
839         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
840         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
841         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
842         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
843         locking.  Merge bits from lowlevelmutex.S we still need.
844         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
845         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
846         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
847         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
848         * Makefile (routines): Remove libc-lowlevelmutex.
849         (libpthread-rountines): Remove lowlevelmutex.
850         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
851         for new mutex implementation.
852         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
853         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
854         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
855         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
856         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
857         Likewise.
858         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
859         Likewise.
860         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
861         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
862         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
863         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
864         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
865         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
866         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
867         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
868         Likewise.
869         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
870         Likewise.
871         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
872         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
873         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
874         Don't use requeue.
875         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
876         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
877
878 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
879
880         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
881         in parameters of asm with output parameters.
882
883         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
884         type of DECR parameter to int.
885         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
886
887 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
888
889         * tst-attr3.c (tf, do_test): Print stack start/end/size and
890         guardsize for each thread.
891
892 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
893
894         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
895         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
896         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
897
898         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
899         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
900         NULL.
901         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
902         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
903         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
904         (pthread_getaffinity_np): Add hidden_def.
905
906         * Makefile (tests): Add tst-attr3.
907         * tst-attr3.c: New test.
908
909         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
910
911 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
912
913         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
914         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
915
916 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
917
918         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
919         * tst-align.c: Include tst-stack-align.h.
920         (tf, do_test): Use TEST_STACK_ALIGN macro.
921
922 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
923
924         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
925         variable.
926
927 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
928
929         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
930         stack-related values for the initial thread.
931
932 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
933
934         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
935
936 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
937
938         * pthread_mutex_lock.c: Minor code rearrangements.
939
940 2003-09-05  Roland McGrath  <roland@redhat.com>
941
942         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
943         Instead, include ../nptl_db/db_info.c to do its magic.
944         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
945         (__pthread_pthread_key_2ndlevel_size): Likewise.
946         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
947         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
948         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
949         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
950         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
951         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
952         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
953         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
954         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
955         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
956         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
957         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
958         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
959         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
960         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
961         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
962         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
963
964 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
965
966         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
967         of pthread_t to be compatible with LT.
968         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
969         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
970         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
971         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
972         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
973         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
974         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
975
976 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
977
978         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
979
980 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
981
982         * unwind-forcedunwind.c: Move to...
983         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
984         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
985         * sysdeps/pthread/jmpbuf-unwind.h: New file.
986         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
987         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
988         * unwind.c: Include jmpbuf-unwind.h.
989         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
990
991 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
992
993         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
994         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
995         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
996         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
997         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
998         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
999         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
1000         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
1001         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
1002         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
1003         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
1004         function.
1005         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
1006         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
1007         * Makefile (tests): Add tst-stack2.
1008         * tst-stack2.c: New test.
1009         * tst-stack1.c: Include limits.h and sys/param.h.
1010         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
1011
1012         * pthread_condattr_setpshared.c: Include errno.h.
1013         (pthread_condattr_setpshared): Return EINVAL if pshared
1014         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
1015
1016         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
1017         defined symbol for entry point to avoid cancellation.
1018         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1019         Likewise.
1020         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1021         Likewise.
1022         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1023         Likewise.
1024         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
1025         Likewise.
1026         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1027         Likewise.
1028         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
1029         __close_nocancel, __read_nocancel, __write_nocancel,
1030         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
1031         libpthread.so or librt.so, define to corresponding function
1032         without _nocancel suffix.
1033         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
1034         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
1035         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
1036
1037         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
1038
1039 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
1040
1041         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1042         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
1043
1044         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
1045         in subsections has a symbol associated with it.
1046
1047         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
1048         defined symbol for entry point to avoid cancellation.
1049         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
1050
1051 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1052
1053         * Makefile (tests): Add tst-tls5.
1054         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
1055         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
1056         ($(objpfx)tst-tls5): New.
1057         ($(objpfx)tst-tls6.out): Likewise.
1058         (tests): Depend on $(objpfx)tst-tls6.out.
1059         * tst-tls3.c: Include stdint.h and pthreaddef.h.
1060         (do_test): Check pthread_self () return value alignment.
1061         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
1062         (tf): Check pthread_self () return value alignment.
1063         * tst-tls5.c: New test.
1064         * tst-tls5.h: New.
1065         * tst-tls5mod.c: New.
1066         * tst-tls5moda.c: New.
1067         * tst-tls5modb.c: New.
1068         * tst-tls5modc.c: New.
1069         * tst-tls5modd.c: New.
1070         * tst-tls5mode.c: New.
1071         * tst-tls5modf.c: New.
1072         * tst-tls6.sh: New test.
1073
1074         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
1075         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
1076         * init.c (pthread_functions): Initialize them.
1077         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
1078         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
1079         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
1080         pthread_cond_timedwait@@GLIBC_2.3.2.
1081
1082 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1083
1084         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
1085         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
1086         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
1087         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
1088         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
1089         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1090
1091         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
1092
1093         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
1094         _POSIX_THREAD_PRIORITY_SCHEDULING.
1095         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1096
1097 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
1098
1099         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
1100         nested function, use static inline function from libio.h.
1101         Code by Richard Henderson.
1102
1103         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
1104         weak.
1105
1106 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
1107
1108         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
1109         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
1110         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
1111         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
1112         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
1113         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
1114         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
1115         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
1116         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
1117         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
1118         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
1119         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
1120         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
1121         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
1122         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
1123         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
1124         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
1125         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
1126         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
1127         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
1128         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
1129         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
1130         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
1131         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
1132         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
1133         * sysdeps/sparc/tls.h: New file.
1134         * sysdeps/sparc/tcb-offsets.sym: New file.
1135         * sysdeps/sparc/Makefile: New file.
1136         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
1137         * init.c [__sparc__] (__NR_set_tid_address): Define.
1138
1139 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
1140
1141         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
1142         _IO_release_lock): Define.
1143
1144 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
1145
1146         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
1147         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
1148
1149 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
1150
1151         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
1152         (__pthread_cleanup_class): Add missing return types of member
1153         functions.
1154
1155 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
1156
1157         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1158         (lll_mutex_unlock_force): Add memory barrier between store and futex
1159         syscall.
1160
1161 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
1162
1163         * tst-cancel4.c (do_test): Also unlink tempfname and remove
1164         tempmsg in first loop.
1165
1166 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
1167
1168         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1169         _POSIX_THREAD_PRIORITY_SCHEDULING.
1170         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1171
1172 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1173
1174         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
1175         (__rtld_lock_default_lock_recursive,
1176         __rtld_lock_default_unlock_recursive): Define.
1177         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
1178         __rtld_lock_unlock_recursive): Define using
1179         GL(_dl_rtld_*lock_recursive).
1180         * init.c (__pthread_initialize_minimal_internal): Initialize
1181         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
1182         Lock GL(_dl_load_lock) the same number of times as
1183         GL(_dl_load_lock) using non-mt implementation was nested.
1184
1185         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
1186         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
1187
1188 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
1189
1190         * tst-cancel17.c (do_test): Make len2 maximum of page size and
1191         PIPE_BUF.
1192
1193 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1194
1195         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
1196
1197 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
1198
1199         * sysdeps/pthread/createthread.c (do_clone): Move error handling
1200         to first syscall error check.  Move syscall error check for tkill
1201         into __ASSUME_CLONE_STOPPED #ifdef.
1202
1203 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
1204
1205         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
1206         is not defined, do explicit synchronization.
1207         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
1208         is not defined also unlock pd->lock for non-debugging case in case
1209         it is necessary.
1210         * pthread_create.c (start_thread): Always get and release pd->lock
1211         if __ASSUME_CLONE_STOPPED is not defined.
1212         (start_thread_debug): Removed.  Adjust users.
1213         * allocatestack.c (allocate_stack): Always initialize lock if
1214         __ASSUME_CLONE_STOPPED is not defined.
1215         * Makefile (tests): Add tst-sched1.
1216         * tst-sched1.c: New file.
1217
1218         * sysdeps/pthread/createthread.c (do_clone): Only use
1219         sched_setschduler and pass correct parameters.
1220
1221 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1222
1223         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
1224         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
1225         PTHREAD_STACK_MIN in comments.
1226
1227 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1228
1229         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1230         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
1231         argument.
1232         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
1233         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
1234         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
1235         (__pthread_cleanup_upto): Fix prototype.
1236         (_longjmp_unwind): Adjust caller.
1237         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
1238         Change second argument to const struct pointer.
1239         * tst-sem8.c (main): Remove unused s2 and s3 variables.
1240         * tst-sem9.c (main): Likewise.
1241         * unwind.c: Include string.h for strlen prototype.
1242
1243 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
1244
1245         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1246         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
1247         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
1248         Define HAVE_CMOV.
1249         Patch by Nicholas Miell <nmiell@attbi.com>.
1250
1251 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
1252
1253         * init.c (__pthread_initialize_minimal_internal): Initialize
1254         GL(dl_init_static_tls).
1255         * pthreadP.h (__pthread_init_static_tls): New prototype.
1256         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
1257         New functions.
1258         * Makefile (tests): Add tst-tls4.
1259         (modules-names): Add tst-tls4moda and tst-tls4modb.
1260         ($(objpfx)tst-tls4): Link against libdl and libpthread.
1261         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
1262         tst-tls4modb.so.
1263         * tst-tls4.c: New file.
1264         * tst-tls4moda.c: New file.
1265         * tst-tls4modb.c: New file.
1266
1267 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
1268
1269         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
1270         before __timer_dealloc.
1271         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
1272         Don't call list_unlink.
1273
1274 2003-07-29  Roland McGrath  <roland@redhat.com>
1275
1276         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
1277
1278 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
1279
1280         * tst-cancel17.c (do_test): Check if aio_cancel failed.
1281         Don't reuse struct aiocb A if it failed.
1282         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
1283         not just one byte, as that does not block.
1284
1285 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
1286
1287         * sysdeps/pthread/unwind-resume.c: New file.
1288         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
1289         unwind-resume in csu subdir.
1290         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
1291         exceptions.
1292         (librt-sysdep_routines, librt-shared-only-routines): Add
1293         rt-unwind-resume.
1294         * sysdeps/pthread/rt-unwind-resume.c: New file.
1295         * unwind-forcedunwind.c: New file.
1296         * Makefile (libpthread-routines): Add unwind-forcedunwind.
1297         (libpthread-shared-only-routines): Likewise.
1298         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
1299         * pthreadP.h (pthread_cancel_init): New prototype.
1300         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
1301
1302         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
1303         attr argument const struct pthread_attr *.
1304
1305         * res.c (__res_state): Return __resp.
1306         * descr.h: Include resolv.h.
1307         (struct pthread): Add res field.
1308         * pthread_create.c: Include resolv.h.
1309         (start_thread): Initialize __resp.
1310         * Makefile (tests): Add tst-_res1.
1311         (module-names): Add tst-_res1mod1, tst-_res1mod2.
1312         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
1313         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
1314         libpthread.
1315         * tst-_res1.c: New file.
1316         * tst-_res1mod1.c: New file.
1317         * tst-_res1mod2.c: New file.
1318
1319 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
1320
1321         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
1322
1323         * Makefile: Define various *-no-z-defs variables for test DSOs
1324         which has undefined symbols.
1325
1326 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
1327
1328         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1329         Retry if the stwcx fails to store once_control.
1330
1331 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
1332
1333         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
1334         pthread_attr_setaffinity.
1335         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
1336         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
1337         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
1338         * pthread_attr_destroy.c: Free cpuset element if allocated.
1339         * pthread_create.c: Pass iattr as additional parameter to
1340         create_thread.
1341         * sysdeps/pthread/createthread.c: If attribute is provided and
1342         a new thread is created with affinity set or scheduling parameters,
1343         start thread with CLONE_STOPPED.
1344         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
1345         pthread_attr_setaffinity.
1346         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
1347         cpuset element.
1348
1349 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
1350
1351         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
1352
1353 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
1354
1355         * sysdeps/pthread/configure.in: Require CFI directives also for
1356         ppc and s390.
1357
1358 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
1359
1360         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1361         Add cfi directives.
1362
1363 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1364
1365         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
1366         CLEANUP_JMP_BUF.
1367         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
1368         registers as variables.  Call __pthread_mutex_unlock_usercnt.
1369         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1370         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
1371         not self pointer in __writer.  Compare with TID to determine
1372         deadlocks.
1373         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1374         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1375         Likewise.
1376         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1377         Likewise.
1378         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
1379         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
1380         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
1381         macros also when compiling librt.
1382
1383 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
1384
1385         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
1386         -fasynchronous-unwind-tables.
1387         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1388         (PSEUDO): Add cfi directives.
1389         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
1390         Likewise.
1391         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1392         Likewise.
1393
1394 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
1395
1396         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
1397         __pthread_unregister_cancel): Add prototypes and hidden_proto.
1398         * unwind.c (__pthread_unwind_next): Add hidden_def.
1399         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
1400         Likewise.
1401         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1402         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1403         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1404         Likewise.
1405         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
1406         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1407         Likewise.
1408         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
1409         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
1410         __pthread_unregister_cancel and __pthread_unwind_next.
1411
1412 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1413
1414         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
1415         different symbol for the cancellation syscall wrapper and
1416         non-cancellation syscall wrapper.
1417         (PSEUDO_END): Define.
1418
1419 2003-07-05  Richard Henderson  <rth@redhat.com>
1420
1421         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
1422         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
1423         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
1424         return actual return value from the syscall, not 0.
1425
1426 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
1427
1428         * descr.h (struct pthread): Add pid field.
1429         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
1430         (__reclaim_stacks): Likewise.
1431         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
1432         also check for PID of the signal source.
1433         (__pthread_initialize_minimal_internal): Also initialize pid field
1434         of initial thread's descriptor.
1435         * pthread_cancel.c: Use tgkill instead of tkill if possible.
1436         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1437         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
1438         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1439         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1440
1441 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
1442
1443         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
1444         Fix use of parameter.
1445         (__libc_cleanup_pop): Likewise.
1446
1447 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
1448
1449         * init.c (sigcancel_handler): Change parameters to match handler
1450         for SA_SIGACTION.  Check signal number and code to recognize
1451         invalid invocations.
1452
1453 2003-07-03  Roland McGrath  <roland@redhat.com>
1454
1455         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
1456         Apply sizeof (struct pthread) bias to r13 value.
1457
1458 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
1459
1460         * sysdeps/pthread/configure.in: Require CFI directives.
1461
1462         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
1463         definition.
1464         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
1465         libpthread compilation.
1466         * unwind.c (__pthread_unwind): Add hidden_def.
1467         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
1468
1469 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
1470
1471         * libc-cancellation.c (__libc_cleanup_routine): Define.
1472         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
1473         (__pthread_cleanup_pop): Define.
1474
1475 2003-07-01  Richard Henderson  <rth@redhat.com>
1476
1477         * sysdeps/alpha/elf/pt-initfini.c: New file.
1478         * sysdeps/alpha/pthread_spin_lock.S: New file.
1479         * sysdeps/alpha/pthread_spin_trylock.S: New file.
1480         * sysdeps/alpha/pthreaddef.h: New file.
1481         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
1482         * sysdeps/alpha/tls.h: New file.
1483         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
1484         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
1485         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
1486         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
1487         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
1488         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
1489         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
1490         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
1491         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
1492         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
1493
1494 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
1495
1496         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
1497         cleanup support and unwind info.
1498
1499 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
1500
1501         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1502         Use correct cleanup handler registration.  Add unwind info.
1503         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
1504         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
1505         * tst-once3.c: Add cleanup handler and check it is called.
1506         * tst-once4.c: Likewise.
1507         * tst-oncex3.c: New file.
1508         * tst-oncex4.c: New file.
1509         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
1510
1511 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
1512
1513         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
1514
1515 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
1516
1517         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
1518         (tf_msgsnd): Likewise.
1519
1520         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
1521         premature returns a bit more.
1522
1523 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
1524
1525         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
1526         definition to the front.
1527
1528         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
1529         the cleanup functions to make the names unique.  Fix dwarf opcode
1530         un unwind table.
1531         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
1532         functions to make the names unique.  Fix CFA offset for two blocks.
1533
1534 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
1535
1536         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
1537         missing closing braces.
1538         Patch by Christophe Saout <christophe@saout.de>.
1539
1540 2003-06-24  Roland McGrath  <roland@redhat.com>
1541
1542         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
1543
1544 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
1545
1546         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
1547         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
1548
1549         * pthreadP.h: Declare __find_thread_by_id.
1550         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
1551         * pthread_clock_gettime.c: Allow using other thread's clock.
1552         * pthread_clock_settime.c: Likewise.
1553         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
1554         * Makefile: Add rules to build and run tst-clock2.
1555         * tst-clock2.c: New file.
1556
1557 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
1558
1559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
1560         to use exception-based cleanup handler.
1561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1562
1563         * tst-cond8.c (ch): Announce that we are done.
1564
1565         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
1566
1567         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
1568         Also test aio_suspend with timeout value.
1569
1570 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
1571
1572         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
1573         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
1574         attribute_hidden.
1575
1576         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
1577         (__pthread_mutex_lock_internal): Likewise.
1578         (__pthread_mutex_unlock_internal): Likewise.
1579         (__pthread_mutex_unlock_usercnt): Declare.
1580         * pthread_mutex_destroy.c: Always fail if used in any way.
1581         * pthread_mutex_init.c: Update comment.
1582         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
1583         * pthread_mutex_timedlock.c: Adjust __nusers.
1584         * pthread_mutex_trylock.c: Adjust __nusers.
1585         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
1586         and public interfaces are wrapper with pass additional parameter.
1587         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
1588         parameter zero.
1589         * tst-mutex8.c: New file.
1590         * Makefile (tests): Add tst-mutex8.
1591         * sysdeps/pthread/pthread_cond_timedwait.c: Call
1592         __pthread_mutex_unlock_usercnt.
1593         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1594         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1596         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1597         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1598         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
1599         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1600         Add __nusers.
1601         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1602         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1603         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1604         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1605         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1606
1607         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
1608         * pthread_mutex_timedlock.c: Likewise.
1609         * pthread_mutex_trylock.c: Adjust __nusers.
1610         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
1611         * tst-mutex9.c: New file.
1612         * Makefile (tests): Add tst-mutex9.
1613         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
1614         * sysdeps/ia64/tls.h: Likewise.
1615         * sysdeps/powerpc/tls.h: Likewise.
1616         * sysdeps/s390/tls.h: Likewise.
1617         * sysdeps/sh/tls.h: Likewise.
1618         * sysdeps/x86_64/tls.h: Likewise.
1619         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1620         Change type of __owner.
1621         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1622         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1623         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1624         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1625         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1626
1627 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
1628
1629         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
1630         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
1631
1632         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
1633         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
1634         instead of nr to lll_futex_wake.  Only set errno and return -1
1635         if err < 0.
1636
1637         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
1638         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
1639         return actual return value from the syscall, not 0.
1640
1641 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
1642
1643         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
1644         find a random value.
1645         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
1646         errno==EIDRM.
1647
1648         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
1649         compat_timer_settime.
1650         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
1651         compat_timer_gettime.
1652         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
1653         compat_timer_getoverrun.
1654         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
1655         compat_timer_delete.
1656
1657         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
1658         error-checking mutex detect busy mutexes.
1659
1660 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
1661
1662         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
1663         Add ax to clobber list.
1664         (lll_mutex_cond_lock): Likewise.
1665         (lll_mutex_unlock): Likewise.
1666         (lll_lock): Likewise.
1667         (lll_unlock): Likewise.
1668
1669         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
1670         * tst-cancel18.c: New file.
1671         * tst-cancelx18.c: New file.
1672
1673         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
1674         and tcdrain.
1675
1676         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
1677         * tst-cancel17.c: New file.
1678         * tst-cancelx17.c: New file.
1679
1680         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
1681         * sysdeps/unix/sysv/linux/sigwait.c: New file.
1682         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
1683
1684         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
1685
1686 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
1687
1688         * sysdeps/pthread/createthread.c (create_thread): Set
1689         header.multiple_threads unconditionally.
1690         * allocatestack.c (allocate_stack): Likewise.
1691         * descr.h (struct pthread): Add header.multiple_threads
1692         unconditionally.
1693         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
1694         Define for librt.  #error if neither libpthread, libc nor librt.
1695         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
1696         Likewise.
1697         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
1698         CDISABLE): Likewise.
1699         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
1700         CDISABLE): Likewise.
1701         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
1702         CDISABLE): Likewise.
1703         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
1704         CDISABLE): Likewise.  Access header.multiple_threads outside of
1705         libc and libpthread.
1706         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
1707         Likewise.
1708         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
1709         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
1710
1711 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
1712
1713         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
1714         Also test early cancellation before the thread reaches the cancellation
1715         point.
1716
1717         * Makefile: Compile forward.c with exceptions.
1718
1719         * sysdeps/unix/sysv/linux/sleep.c: New file.
1720
1721 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
1722
1723         * Makefile: Add CFLAGS definition to compile function wrappers
1724         duplicated from libc with exceptions.
1725         * tst-cancel4.c: Also check cancellation handlers.
1726
1727         * Makefile: Add rules to build and run tst-cancel16 and
1728         tst-cancelx16.  Add missing CFLAGS definitions.
1729         * tst-cancel16.c: New file.
1730         * tst-cancelx16.c: New file.
1731
1732 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
1733
1734         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
1735         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
1736         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
1737         (DL_SYSINFO_IMPLEMENTATION): Likewise.
1738
1739         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
1740         (LIBC_CANCEL_RESET): Likewise.
1741         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
1742         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
1743         librt-cancellation.
1744         (CFLAGS-libcrt-cancellation.c): Define.
1745         * sysdeps/pthread/librt-cancellation.c: New file.
1746         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
1747         macros also when compiling librt.
1748         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1749         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1750         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1751         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1752         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1753         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1754         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1755
1756         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
1757         compat_timer_create.
1758
1759 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
1760
1761         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
1762
1763         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
1764         __register_atfork.
1765         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
1766         Add libc_hidden_def.
1767
1768 2003-06-13  Roland McGrath  <roland@redhat.com>
1769
1770         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
1771         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
1772
1773 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
1774
1775         * allocatestack.c (queue_stack): Always inline.
1776         * ptreadhP.h (__do_cancel): Likewise.
1777
1778 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
1779
1780         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
1781         a typo.
1782
1783 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
1784
1785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1786         (__pthread_cond_signal): Remove incorrect second addition for
1787         cond_lock!=0.
1788
1789 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
1790
1791         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1792         (__pthread_cond_signal): Use correct futex pointer in
1793         __lll_mutex_lock_wait call.
1794
1795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1796         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
1797
1798 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
1799
1800         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
1801         cancelable.
1802         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
1803         Likewise.
1804
1805         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
1806         hand-written CFI generation code.  Since ENTRY/END also initiated
1807         CFI frames this caused two CFI sets to be generated.
1808
1809 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
1810
1811         * cleanup_routine.c: New file.
1812         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
1813         * sysdeps/pthread/pthread.h: Add support for fully exception-based
1814         cleanup handling.
1815         * Makefile (libpthread-routines): Add cleanup_routine.
1816         Add more CFLAGS variables to compile with exceptions.  Add comments
1817         why which file needs unwind tables.
1818         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
1819         tests.
1820         * tst-cancelx1.c: New file.
1821         * tst-cancelx2.c: New file.
1822         * tst-cancelx3.c: New file.
1823         * tst-cancelx4.c: New file.
1824         * tst-cancelx5.c: New file.
1825         * tst-cancelx6.c: New file.
1826         * tst-cancelx7.c: New file.
1827         * tst-cancelx8.c: New file.
1828         * tst-cancelx9.c: New file.
1829         * tst-cancelx10.c: New file.
1830         * tst-cancelx11.c: New file.
1831         * tst-cancelx12.c: New file.
1832         * tst-cancelx13.c: New file.
1833         * tst-cancelx14.c: New file.
1834         * tst-cancelx15.c: New file.
1835         * tst-cleanupx0.c: New file.
1836         * tst-cleanupx0.expect: New file.
1837         * tst-cleanupx1.c: New file.
1838         * tst-cleanupx2.c: New file.
1839         * tst-cleanupx3.c: New file.
1840
1841         * tst-cleanup0.c: Make standard compliant.
1842         * tst-cleanup1.c: Likewise.
1843
1844         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
1845         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1846         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1847         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1848         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1849         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1850         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
1851         CLEANUP_JMP_BUF.
1852         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1853         * tst-cancel12.c: New file.
1854         * tst-cancel13.c: New file.
1855         * tst-cancel14.c: New file.
1856         * tst-cancel15.c: New file.
1857         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
1858         and tst-cancel15.
1859
1860         * tst-cancel1.c: Add some comments.
1861
1862         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
1863         timeout correctly.
1864
1865 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
1866
1867         * Makefile (CFLAGS-pthread_cancel.c): Define.
1868
1869 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
1870
1871         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
1872         Change type of __writer element to int.
1873         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1874         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1875         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1876         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1877         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1878         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
1879         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1880         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
1881         Compare with TID to determine deadlocks.
1882         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
1883         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1884         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
1885         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1886         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1887         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1888         Likewise.
1889         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1890         Likewise.
1891         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1892         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1893         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1894         Likewise.
1895         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1896         Likewise.
1897         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1898         * Makefile (tests): Add tst-rwlock12.
1899         * tst-rwlock12.c: New file.
1900
1901 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
1902
1903         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
1904         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
1905         Remove bogus hidden_proto.
1906         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
1907         Likewise.
1908         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
1909         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
1910         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
1911         ___lll_mutex_timedlock): Likewise.
1912
1913 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
1914
1915         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1916         (__pthread_cond_signal): Add some code to eventually handle
1917         cond_lock!=0.
1918
1919 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
1920
1921         * Makefile (tests): Add tst-exec4.
1922         (tst-exec4-ARGS): Define.
1923         * tst-exec4.c: New file.
1924
1925 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
1926
1927         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1928         Also fail if tv_nsec < 0.
1929         (__lll_timedwait_tid): Likewise.
1930         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1931         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
1932         Likewise.
1933         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
1934         Likewise.
1935         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
1936         Likewise.
1937         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
1938         Likewise.
1939         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
1940         Likewise.
1941         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
1942         Likewise.
1943
1944         * Makefile (tests): Add tst-sem8 and tst-sem9.
1945         * tst-sem8.c: New file.
1946         * tst-sem9.c: New file.
1947         * sem_open.c: Fix creation of in_use record if the file exists but
1948         no internal record.
1949
1950         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
1951         definitions.
1952
1953         * sysdeps/pthread/timer_create.c (timer_create): In case
1954         evp==NULL, assign timer ID to sival_ptr.
1955
1956         * descr.h (struct pthread_unwind_buf): Change type of prev element to
1957         struct pthread_unwind_buf *.
1958         (struct pthread): Likewise for cleanup_jmp_buf element.
1959
1960         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
1961         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
1962         * unwind.c (__pthread_unwind_next): Likewise.
1963
1964 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
1965
1966         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1967         (lll_futex_timed_wait): Use int for futex value parameter.
1968         (lll_futex_wake): Likewise.
1969         (lll_futex_requeue): Likewise.
1970
1971         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
1972         Replace one memory operation with one register operation.
1973
1974         * tst-join4.c (do_test): Fix error message.
1975
1976         * tst-rwlock6.c (do_test): Use correct format specifier.
1977
1978         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1979         (__lll_mutex_lock_wait): Replace one memory operation with one
1980         register operation.
1981         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
1982         (__lll_mutex_lock_wait): Likewise.
1983
1984         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1985         (__lll_mutex_cond_lock): Add one to value parameter of
1986         __lll_lock_wait to reflect reality in the futex syscall.
1987         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1988         (lll_mutex_cond_lock): Likewise.
1989
1990 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
1991
1992         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
1993         New function.
1994         (lll_mutex_cond_lock): Define.
1995
1996 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
1997
1998         * Makefile (tests): Add tst-signal6.
1999         * tst-signal6.c: New file.
2000
2001         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
2002         (__lll_mutex_unlock_force): New function
2003         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2004
2005         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2006         (__lll_mutex_unlock_force): New function.
2007         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2008
2009         * tst-rwlock7.c (do_test): Use correct format specifier.
2010
2011         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
2012         Find break parameter in correct asm argument.
2013
2014 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
2015
2016         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
2017         Remove out4.
2018         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
2019         error occured.
2020         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2021         Add __mutex.
2022         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
2023         lll_futex_requeue, lll_mutex_unlock_force): Define.
2024
2025 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2026
2027         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2028         (pthread_cond_t): Add __mutex.
2029         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
2030         lll_futex_requeue, lll_mutex_unlock_force): Define.
2031
2032 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2033
2034         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
2035         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2036         Add __mutex field.
2037         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
2038         Define.
2039         (lll_futex_wait, lll_futex_wake): Define.
2040         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
2041         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
2042         FUTEX_REQUEUE instead of FUTEX_WAIT.
2043         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2044         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
2045         mutex which was used in condvar structure.  Call
2046         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
2047         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2048
2049         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
2050         include tcb-offsets.h.  Read wakeup value in locked region.
2051         Use the value of gbr register as THREAD_ID.
2052         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2053         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2054         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2055
2056         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
2057         macros.
2058
2059 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
2060
2061         * sysdeps/pthread/pthread_cond_broadcast.c
2062         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2063
2064 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
2065
2066         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
2067         typo in register name.
2068         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
2069         correctly.  Actually use requeue.  Little optimization.
2070         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
2071         mutex address early.  Handle cancellation state as 32-bit value.
2072         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2073         Remove unnecessary label.
2074
2075 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
2076
2077         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
2078         instead of FUTEX_WAIT.
2079         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
2080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2081         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2082         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2083         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2084         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
2085         used in condvar structure.  Call __pthread_mutex_cond_lock instead
2086         of __pthread_mutex_lock_internal.
2087         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2089         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2090         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
2091         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2092         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2093         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
2094         Add pthread_mutex_cond_lock.
2095         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
2096         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
2097         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
2098         lll_mutex_cond_lock.
2099         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2100         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2101         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2102         Add __mutex field.
2103         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2104         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2105
2106         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
2107         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2108
2109         * pthreadP.h: Declare __pthread_mutex_cond_lock.
2110         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
2111         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
2112         macro don't define aliases.
2113
2114         * cancellation.c: Remove __pthread_enable_asynccancel_2.
2115         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
2116         * sysdeps/pthread/pthread_cond_timedwait.c: Use
2117         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
2118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2119         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2120         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2122         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2123
2124 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
2125
2126         * sem_open.c: Fix one endless loop.  Implement correct semantics
2127         wrt opening the same semaphore more then once.
2128         * sem_close.c: Adjust for sem_open change.
2129         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
2130         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
2131         * Makefile (tests): Add tst-sem7.
2132         * tst-sem7.c: New file.
2133
2134 2003-05-16  Roland McGrath  <roland@redhat.com>
2135
2136         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
2137         uninitialized variable braino.
2138
2139 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
2140
2141         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
2142         test for syscall availability.
2143
2144         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
2145         __no_posix_timers to -1 if the syscalls don't exist.
2146
2147         * pthread_join.c (pthread_join): Set tid field of the joined
2148         thread to -1.  This isn't necessary but helps to recognize some
2149         error conditions with almost no cost.
2150
2151         * allocatestack.c (FREE_P): Also negative values indicate an
2152         unused stack.
2153
2154         * unwind.c: Include <unistd.h>.
2155
2156 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
2157
2158         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
2159
2160 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
2161
2162         * Makefile (crti-objs, crtn-objs): New variables.
2163         (omit-deps, extra-objs): Add crtn.
2164         ($(objpfx)libpthread.so): Depend on both crti and crtn
2165         and links to them in multidir.
2166         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
2167
2168 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
2169
2170         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2171         (lll_mutex_unlock): Use atomic_exchange_rel.
2172
2173 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
2174
2175         * cond-perf.c (cons): Add missing locking around setting of alldone.
2176
2177 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
2178
2179         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
2180         related macros.
2181         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2182
2183 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
2184
2185         * tst-sem6.c: New file.
2186         * Makefile (tests): Add tst-sem6.
2187
2188         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
2189         Use atomic_exchange_rel instead of atomic_exchange.
2190         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
2191         Likewise.
2192
2193         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
2194         code for lll_futex_wait and lll_futex_wake in static apps.  Use
2195         vsyscall is possible.
2196
2197         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
2198         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
2199         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
2200         pthread_setaffinity_np.
2201         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
2202         and pthread_setaffinity_np.
2203         * Makefile (libpthread-routines): Add pthread_getaffinity and
2204         pthread_setaffinity.
2205
2206         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
2207         use it in case mmap to allocate the stack fails.
2208         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
2209         ARCH_MAP_FLAGS here.
2210         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
2211         ARCH_RETRY_MMAP.
2212
2213 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
2214
2215         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
2216         handler implementation.  It is now lockless in fork().
2217         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2218         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2219         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
2220         declare the __fork_*_lists.
2221         (struct fork_handler): Include pointers to all three functions.
2222         Add next, refcntr and need_signal elements.
2223         (__fork_handlers): New declaration.
2224         (__register_atfork_malloc): Remove declaration.
2225         (HAVE_register_atfork_malloc): Remove definition.
2226         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
2227         __pthread_child_handler variable.
2228         (__libc_pthread_init): Use __register_atfork instead of explicitly
2229         adding to the list.
2230         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
2231         and lll_futex_wake.
2232         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2233
2234         * unwind.c (unwind_cleanup): Print error message and then abort.  This
2235         function must never be reached.
2236
2237         * cond-perf.c: New file.
2238
2239 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
2240
2241         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
2242
2243 2003-05-04  Roland McGrath  <roland@redhat.com>
2244
2245         * Makefile ($(objpfx)../libc.so): New target.
2246
2247 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
2248
2249         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2250         (pthread_condattr_t): Size is only an int, don't use long for
2251         alignment.
2252         (pthread_mutexattr_t): Likewise.
2253         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2254         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2255         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2256
2257 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
2258
2259         * sysdeps/i386/tls.h: Define THREAD_ID.
2260         * sysdeps/ia64/tls.h: Likewise.
2261         * sysdeps/powerpc/tls.h: Likewise.
2262         * sysdeps/s390/tls.h: Likewise.
2263         * sysdeps/sh/tls.h: Likewise.
2264         * sysdeps/x86_64/tls.h: Likewise.
2265         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
2266         record ownership.
2267         * pthread_mutex_timedlock.c: Likewise.
2268         * pthread_mutex_trylock.c: Likewise.
2269         * pthread_mutex_unlock.c: Likewise.
2270         * pthread_rwlock_trywrlock.c: Likewise.
2271         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
2272         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2273         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2274         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2275
2276         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
2277         flag.
2278
2279 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
2280
2281         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2282         (__SIZEOF_PTHREAD_COND_T): Define to 48.
2283         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
2284         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2285         Make __align long long instead of long.
2286         (pthread_rwlock_t): Formatting.
2287         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2288         (pthread_rwlock_t): Formatting.
2289         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2290         (pthread_cond_t): Make __align long long instead of long.
2291         (pthread_rwlock_t): Move __flags field to the same position as in
2292         linuxthreads.
2293
2294 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
2295
2296         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
2297         * tst-rwlock7.c (do_test): Likewise.
2298
2299 2003-04-26  Roland McGrath  <roland@redhat.com>
2300
2301         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
2302
2303 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
2304
2305         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
2306         sizeof (struct pthread).
2307         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
2308         1 struct pthread.
2309         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
2310         to 0.
2311         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
2312         struct pthread.
2313         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
2314         to 32-bit bytes.
2315         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
2316         tcbp.
2317         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
2318         unneccessarily.
2319         (NO_TLS_OFFSET): Define.
2320         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
2321         add TLS_TCB_SIZE unnecessarily.
2322
2323 2003-04-22  Roland McGrath  <roland@redhat.com>
2324
2325         * Makeconfig (shared-thread-library): Reverse link order to work
2326         around linker bug.
2327
2328 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
2329
2330         * semaphore.h: Fix typo in comment.
2331
2332 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
2333
2334         * sysdeps/pthread/sigfillset.c: New file.
2335
2336         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
2337         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
2338         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
2339         * sysdeps/pthread/sigaction.c: Likewise.
2340         * sysdeps/pthread/sigprocmask.c: New file.
2341         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
2342         __SIGRTMIN+1.
2343         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2344         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
2345         in this case.
2346
2347 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
2348
2349         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2350         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
2351
2352         * sysdeps/unix/sysv/linux/unregister-atfork.c
2353         (__unregister_atfork): Don't free memory not allocated dynamically.
2354
2355         * semaphore.h: Remove __THROW marker from cancellation points.
2356         * nptl/sysdeps/pthread/pthread.h: Likewise.
2357
2358 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
2359
2360         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
2361         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
2362         __THROW.
2363
2364 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
2365
2366         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
2367
2368 2003-04-15  Roland McGrath  <roland@redhat.com>
2369
2370         * forward.c (__pthread_unwind): Tweak to avoid warning.
2371
2372 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
2373
2374         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
2375
2376 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
2377
2378         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
2379         overflow CFA advance instructions.
2380         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2381
2382 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
2383
2384         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
2385         * sysdeps/i386/pthread_spin_lock.c: Likewise.
2386         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
2387         defined.
2388
2389         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
2390         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
2391         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
2392         DW_CFA_advance_loc for .Laddl-.Lsubl.
2393
2394 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
2395
2396         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
2397         position-independent unwind data for static libraries.
2398         Add missing unwind info.  Add comments.
2399
2400         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
2401         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2402         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2403         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2404
2405 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
2406
2407         * Makefile: Make sure all cancellation points are compiled with
2408         exception and asynchronous unwind tables.
2409
2410         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
2411         which mishandles loading of global object addresses in PIC.
2412         (THREAD_SETMEM_NC): Likewise.
2413
2414 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
2415
2416         * pthread.h: Define new data structure for cleanup buffer.  Declare
2417         new cleanup handler interfaces.
2418         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
2419         (struct pthread): Add cleanup_jmp_buf pointer.  Define
2420         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
2421         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
2422         it.  Declare old cleanup handler installation functions.
2423         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
2424         handling.
2425         * cleanup_defer.c: Likewise.
2426         * cleanup_compat.c: New file.  Old cleanup code.
2427         * cleanup_def_compat.c: New file.  Old cleanup code.
2428         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
2429         if own thread descriptor.
2430         * unwind.c: New file.
2431         * forward.c: Add __pthread_unwind.
2432         * init.c (pthread_functions): Add __pthread_unwind.
2433         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
2434         Add ptr___pthread_unwind.
2435         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
2436         and unwind function.
2437         * Makefile (libpthread-routines): Add cleanup_compat,
2438         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
2439         table generation if necessary.
2440         * version.c: Record whether unwind support is compiled in.
2441         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
2442         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
2443         handler interfaces.
2444         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
2445         complication to generate unwind information for syscall wrappers.
2446         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2447         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2448         __cleanup_fct_attribute.
2449
2450         * Makefile: Add rules to build and run tst-cleanup0.
2451         * tst-cleanup0.c: New file.
2452         * tst-cleanup0.expect: New file.
2453
2454         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
2455         caller.  Optimize to avoid often unecessary local variable.
2456
2457 2003-04-11  Roland McGrath  <roland@redhat.com>
2458
2459         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
2460         sets variable `multidir'; include that.
2461         (generated): Add it.
2462         ($(objpfx)$(multidir)/crti.o): New target.
2463         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
2464
2465 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
2466
2467         * tst-attr2.c (do_test): Add cast to avoid warning.
2468         * tst-mutex4.c (do_test): Likewise.
2469
2470 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
2471
2472         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
2473         in child.
2474
2475 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
2476
2477         * Makefile (tests): Add tst-detach1.
2478         * tst-detach1.c: New file.
2479
2480 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
2481
2482         * sysdeps/pthread/pthread.h: Remove duplicate
2483         pthread_cleanup_{push,pop} definitions.
2484
2485         * tst-barrier2.c: Eliminate warnings.
2486         * tst-cancel4.c: Likewise.
2487         * tst-cond4.c: Likewise.
2488         * tst-cond6.c: Likewise.
2489         * tst-detach1.c: Likewise.
2490         * tst-rwlock4.c: Likewise.
2491         * tst-rwlock6.c: Likewise.
2492         * tst-rwlock7.c: Likewise.
2493         * tst-sem3.c: Likewise.
2494         * tst-spin2.c: Likewise.
2495         * tst-umask1.c: Likewise.
2496
2497 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
2498
2499         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
2500
2501 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
2502
2503         * descr.h (struct pthread): Move cancelhandling member to the front.
2504
2505 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
2506
2507         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
2508         malloc_parent, and malloc_child statically.
2509         (__register_atfork_malloc): New function.
2510         (free_mem): Don't free any of the malloc_* variables on the list.
2511         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
2512         Define HAVE_register_atfork_malloc.
2513
2514 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
2515
2516         * sysdeps/pthread/createthread.c (create_thread): Add some more
2517         comments explaining when to set multiple_threads and when not.
2518
2519         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
2520         THREAD_ATOMIC_BIT_SET if not already defined.
2521         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
2522         THREAD_ATOMIC_BIT_SET:
2523         * sysdeps/x86_64/tls.h: Likewise.
2524         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
2525         THREAD_ATOMIC_CMPXCHG_VAL.
2526         (_pthread_cleanup_pop_restore): Likewise.
2527         * cancellation.c (__pthread_enable_asynccancel): Likewise.
2528         (__pthread_enable_asynccancel_2): Likewise.
2529         (__pthread_disable_asynccancel): Likewise.
2530         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
2531         (__libc_disable_asynccancel): Likewise.
2532         * init.c (sigcancel_handler): Likewise.
2533         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
2534         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
2535
2536 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
2537
2538         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
2539         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
2540         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
2541         * Makefile (tests): Add tst-cancel11.
2542         * tst-cancel11.c: New file.
2543
2544 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
2545
2546         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
2547         round, not the first.  Use specific_used flag instead of local
2548         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
2549         (__free_tcb): Don't call deallocate_tsd here.
2550         (start_thread): Call deallocate_tsd here.
2551         * pthread_setspecific.c: Set specific_used flag really only when
2552         needed.
2553         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
2554         * tst-tsd3.c: New file.
2555         * tst-tsd4.c: New file.
2556
2557 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
2558
2559         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
2560         Use atomic_exchange_and_add instead of __lll_add.
2561         (__lll_mutex_timedlock): Likewise.
2562         Patch by Ian Wienand.
2563
2564 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
2565
2566         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2567         (SINGLE_THREAD_P): Fix typo.
2568         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
2569
2570 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
2571
2572         * Makefile (tests): Add tst-align.
2573         * tst-align.c: New file.
2574         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
2575
2576         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
2577         function correctly.
2578
2579         * tst-tsd2.c: Add casts to avoid warnings.
2580
2581 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
2582
2583         * descr.h (struct pthread): Move most often used elements to the front.
2584
2585 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
2586
2587         * Makefile (libpthread-routines): Add pthread_atfork.
2588         (libpthread-static-only-routines): Add pthread_atfork.
2589
2590 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2591
2592         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
2593         of TLS_DTV_AT_TP.
2594         (INSTALL_DTV): Add parens.
2595         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
2596         Use passed descr instead of THREAD_SELF.
2597         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
2598         (__lll_mutex_timedlock_wait): Correct expected value after
2599         spurious wakeup.
2600         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
2601         Release lock before waking up the waiters.
2602         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
2603         criteria.  Reorderstruct passed to cleanup handler.  Fix
2604         handling of cancellation and failung pthread_mutex_unlock call.
2605         Use __pthread_enable_asynccancel_2 instead of
2606         __pthread_enable_asynccancel.
2607         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2608         Return result of lock re-get if it fails.
2609         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
2610         for __pthread_cleanup_push.
2611         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
2612         completely broken rwlock implementation.
2613         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2614         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2615         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2616         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2617         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2618         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
2619         versioned_symbol macro.
2620         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
2621         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2622
2623 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
2624
2625         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
2626         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
2627         and __helper_tid.
2628         (struct timer): Remove th and bar field.
2629         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
2630         debugging code.  Create only one helper thread.
2631         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
2632         helper thread.
2633         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2634         Renamed.  Define statically.  Use thread info from siginfo.
2635         (__helper_once): New variable.
2636         (__helper_tid): New variable.
2637         (__reset_helper_control): New function.
2638         (__start_helper_thread): New function.
2639
2640         * pthread_create.c (start_thread): Don't use setjmp inside
2641         __builtin_expect to work around gcc bug.
2642
2643         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
2644         timer_delete syscall fails, but not with ENOSYS, set
2645         __no_posix_timers.
2646
2647         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
2648         (timer_settime): Fix typo.
2649         * sysdeps/unix/sysv/linux/timer_getoverr.c
2650         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
2651
2652 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
2653
2654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
2655         offset of cleanupbuf.__prev.
2656
2657 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
2658
2659         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
2660         of included file.
2661
2662 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
2663
2664         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
2665         NULL provide default definition to syscall.
2666
2667 2003-03-25  Roland McGrath  <roland@redhat.com>
2668
2669         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
2670         (timer_id2ptr): Fix typo.
2671
2672 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
2673
2674         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
2675         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
2676         * sysdeps/ia64/pthreaddef.h: Likewise.
2677         * sysdeps/powerpc/pthreaddef.h: Likewise.
2678         * sysdeps/s390/pthreaddef.h: Likewise.
2679         * sysdeps/sh/pthreaddef.h: Likewise.
2680         * sysdeps/x86_64/pthreaddef.h: Likewise.
2681         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
2682         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
2683         being changed.
2684         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
2685         SIGTIMER is not unblocked.
2686         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
2687         RT signal taken.
2688         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
2689         be send.
2690         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
2691         pass pointer through as ID.
2692         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
2693         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
2694         * sysdeps/unix/sysv/linux/timer_create.c: New file.
2695         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
2696         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
2697         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
2698         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
2699         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
2700         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
2701         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
2702         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
2703         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
2704         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
2705         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
2706         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
2707         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
2708         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
2709         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
2710         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
2711         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
2712         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
2713         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
2714         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
2715         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
2716         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
2717         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
2718         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
2719         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
2720         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
2721         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
2722         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
2723         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
2724         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
2725
2726         * pthreadP.h: Remove FRAME_LEFT definition.
2727         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
2728         already left frame.  Programs which have this problem are not POSIX
2729         compliant.
2730         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
2731
2732 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
2733
2734         * sysdeps/pthread/tst-timer.c: Check return values of the
2735         functions we test.
2736
2737 2003-03-23  Roland McGrath  <roland@redhat.com>
2738
2739         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
2740         * tst-tls3mod.c: Likewise.
2741         * tst-tls1.c: Likewise.
2742         * tst-tls2.c: Likewise.
2743
2744         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
2745         undefined behavior.
2746
2747         * tst-join5.c (tf1, tf2): Add a cast.
2748
2749         * Makeconfig (includes): Append -I$(..)nptl to this variable.
2750
2751         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
2752         Don't test anything.
2753         * tst-cond4.c: Likewise.
2754         * tst-cond6.c: Likewise.
2755         * tst-flock2.c: Likewise.
2756         * tst-mutex4.c: Likewise.
2757         * tst-rwlock4.c: Likewise.
2758         * tst-signal1.c: Likewise.
2759         * tst-spin2.c: Likewise.
2760         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
2761
2762         * tst-mutex4.c: Use test-skeleton.c.
2763         * tst-spin2.c: Likewise.
2764         * tst-sysconf.c: Likewise.
2765         * tst-barrier2.c: Likewise.
2766         * tst-cond4.c: Likewise.
2767         * tst-cond6.c: Likewise.
2768         * tst-rwlock4.c: Likewise.
2769         * tst-unload.c: Likewise.
2770         * tst-flock2.c (do_test): Use return instead of exit.
2771
2772 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
2773
2774         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
2775
2776 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
2777
2778         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2779         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
2780         instead of __lll_compare_and_swap.
2781         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
2782         Likewise.
2783         Removed definition if __lll_compare_and_swap.
2784
2785         * cancellation.c: Adjust for new form of compare&exchange macros.
2786         * cleanup_defer.c: Likewise.
2787         * init.c: Likewise.
2788         * libc-cancellation.c: Likewise.
2789         * old_pthread_cond_broadcast.c: Likewise.
2790         * old_pthread_cond_signal.c: Likewise.
2791         * old_pthread_cond_timedwait.c: Likewise.
2792         * old_pthread_cond_wait.c: Likewise.
2793         * pthread_cancel.c: Likewise.
2794         * pthread_create.c: Likewise.
2795         * pthread_detach.c: Likewise.
2796         * pthread_join.c: Likewise.
2797         * pthread_key_delete.c: Likewise.
2798         * pthread_setcancelstate.c: Likewise.
2799         * pthread_setcanceltype.c: Likewise.
2800         * pthread_timedjoin.c: Likewise.
2801         * pthread_tryjoin.c: Likewise.
2802         * sysdeps/pthread/createthread.c: Likewise.
2803
2804 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
2805
2806         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
2807         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
2808         definitions.  Replace uses with calls to atomic_* functions.
2809         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2810         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
2811         __lll_test_and_set calls with atomic_exchange_and_add and
2812         atomic_exchange calls respectively.
2813         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2814         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2815         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
2816         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2817         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
2818         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
2819         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
2820
2821         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
2822         returns the old value.
2823
2824 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
2825
2826         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
2827         int for variable OLDVAL and correct inline assembler contraint.
2828         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
2829         type int for variable OLD.
2830
2831         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
2832         only for s390-32.
2833         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2834         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
2835         instead of multiple_threads field in the TCB.
2836
2837 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
2838
2839         * sysdeps/i386/i686/bits/atomic.h: Removed.
2840         * sysdeps/i386/i586/bits/atomic.h: Removed.
2841         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
2842         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
2843         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
2844         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
2845         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
2846         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
2847         * atomic.h: Removed.  Moved to glibc.
2848
2849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
2850         support for clock selection.
2851
2852         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
2853         signalling waiters.
2854
2855 2003-03-18  Roland McGrath  <roland@redhat.com>
2856
2857         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
2858         Add __lll_rel_instr first.  Add memory clobber.
2859         (lll_mutex_unlock): Use __lll_test_and_set.
2860         From Paul Mackerras <paulus@samba.org>.
2861
2862         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
2863         unconditionally.
2864         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2865         (SINGLE_THREAD_P):  Add `header.' prefix.
2866         From Paul Mackerras <paulus@samba.org>.
2867
2868         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
2869         pthread_timedjoin_np to ...
2870         (libpthread: GLIBC_2.3.3): ... here.
2871         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
2872
2873         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2874         Avoid shadowing VAL variable.
2875
2876         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
2877         New macro.
2878
2879 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
2880
2881         * Makefile (tests): Add tst-cond11.
2882         * tst-cond11.c: New file.
2883
2884         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
2885         struct passed to cleanup handler to eliminate one more
2886         instruction.
2887         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2888
2889         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2890         (pthrad_cond_t): Replace __unused field with __clock.
2891
2892         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
2893         waken all waiters in cleanup handler.
2894         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2896
2897         * pthread_condattr_getclock.c: New file.
2898         * pthread_condattr_setclock.c: New file.
2899         * sysdeps/pthread/pthread.h: Declare these new functions.
2900         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
2901         * Makefile (libpthread-routines): Add the new functions.
2902         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
2903         Renamed field to value.  Document use of the bits.
2904         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
2905         change.
2906         * pthread_condattr_setpshared.c: Likewise.
2907         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
2908         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
2909         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2910         Add __clock field.
2911         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2912         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2913         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2914         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2915         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
2916         Implement clock selection.
2917         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
2918         * pthread-errnos.sym: Add ENOSYS.
2919         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2920         _POSIX_CLOCK_SELECTION.
2921         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2922
2923         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
2924         invalid .size directive.
2925
2926 2003-03-17  Roland McGrath  <roland@redhat.com>
2927
2928         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2929         Formatting tweaks.
2930
2931 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
2932
2933         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
2934         Use __lll_add instead of spelling it out.  Use protected symbol names.
2935         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
2936         Use __lll_add.
2937         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
2938         Renamed from lll_compare_and_swap.  Use new name where necessary.
2939         (__lll_add): Defined.
2940         (__lll_dec_if_positive): Defined.
2941         (__lll_test_and_set): Defined.
2942         * sysdeps/ia64/pthread_spin_init.c: Removed.
2943         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
2944         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
2945         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
2946         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
2947         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
2948         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
2949         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
2950         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
2951         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2952         __sync_lock_release_si.
2953         Patch by Jakub Jelinek.
2954
2955         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2956         Fix timeout handling.
2957         (__lll_timedwait_tid): Likewise.
2958         (lll_unlock_wake_cb): Wake up other waiters if necessary.
2959         Patch by Jakub Jelinek.
2960
2961         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
2962
2963 2003-03-17  Roland McGrath  <roland@redhat.com>
2964
2965         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
2966         * sysdeps/pthread/pthread_spin_init.c: New file.
2967         * sysdeps/pthread/pthread_spin_unlock.c: New file.
2968         * sysdeps/powerpc/Makefile: New file.
2969         * sysdeps/powerpc/pthread_spin_lock.c: New file.
2970         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
2971         * sysdeps/powerpc/pthreaddef.h: New file.
2972         * sysdeps/powerpc/tcb-offsets.sym: New file.
2973         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
2974         * sysdeps/powerpc/tls.h: New file.
2975         * sysdeps/powerpc/bits/atomic.h: New file.
2976         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
2977         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
2978         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
2979
2980         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
2981         * sysdeps/unix/sysv/linux/sem_post.c: New file.
2982         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
2983         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
2984         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
2985         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
2986         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
2987         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
2988         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
2989         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
2990         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
2991         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
2992         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
2993         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
2994         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
2995
2996         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
2997         not gettimeofday.
2998         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
2999         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
3000         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
3001         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
3002         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
3003
3004 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3005
3006         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
3007         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3008         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3010         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
3011
3012 2003-03-16  Roland McGrath  <roland@redhat.com>
3013
3014         * tst-fork4.c: Include <string.h>.
3015         * tst-signal2.c: Likewise.
3016         * tst-mutex5.c (do_test): exit -> return.
3017         * tst-mutex2.c: Include <stdlib.h>.
3018
3019 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
3020
3021         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3022         (__lll_mutex_timedlock_wait): Correct expected value after
3023         spurious wakeup.  Otherwise we would never wait again.
3024
3025         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
3026         zone versus inline asm stupidity.  Use correct instructions.
3027
3028         * tst-rwlock6.c: Add some more status output.
3029
3030 2003-03-15  Roland McGrath  <roland@redhat.com>
3031
3032         * sysdeps/pthread/configure.in: New file.
3033         * sysdeps/pthread/configure: New file (generated).
3034
3035 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3036
3037         * allocatestack.c (allocate_stack): Store the exact stack size of
3038         user allocated stacks.
3039
3040 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
3041
3042         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3043         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
3044         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3045         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
3046         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3047         Use `header.' prefix.
3048         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3049
3050 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3051
3052         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
3053         __builtin_frame_address, use stack pointer.
3054
3055         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
3056         instead of __builtin_frame_pointer.
3057
3058 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3059
3060         * tst-basic1.c (do_test): Add cast to avoid warning.
3061         * tst-basic2.c (do_test): Likewise.
3062
3063         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
3064         amount of stack correction.
3065
3066         * tst-fork4.c: Use test-skeleton.c.
3067
3068 2003-03-14  Roland McGrath  <roland@redhat.com>
3069
3070         * init.c: Fix typo "#eli" for "#else".
3071
3072 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
3073
3074         * allocatestack.c (__stack_user): Use hidden_data_def.
3075         * pthread_create.c (__pthread_keys): Likewise.
3076
3077         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
3078
3079 2003-03-14  Roland McGrath  <roland@redhat.com>
3080
3081         * tst-fork4.c: New file.
3082         * Makefile (tests): Add it.
3083
3084         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
3085         we always define the padding space.
3086         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
3087         stopped supporting its own extensions fully.
3088         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
3089         struct also called `header', so `header.multiple_threads' is the field
3090         name to use on all machines.
3091         * allocatestack.c (allocate_stack): Use `header.' prefix.
3092         * sysdeps/pthread/createthread.c (create_thread): Likewise.
3093         * pthread_create.c (__pthread_create_2_1): Likewise.
3094         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
3095         (THREAD_SELF): Likewise.
3096         * sysdeps/x86_64/tls.h: Likewise.
3097         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
3098         (SINGLE_THREAD_P): Likewise.
3099         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
3100         (SINGLE_THREAD_P): Likewise.
3101         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3102         (SINGLE_THREAD_P): Likewise.
3103
3104         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
3105         value directly.
3106
3107 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3108
3109         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
3110         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
3111
3112         * pthread_create.c (start_thread): setjmp is expected to return 0.
3113
3114         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
3115         (THREAD_GETMEM_NC): Likewise.
3116
3117 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
3118
3119         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
3120         and the size of the stack which must be allocated is a multiple,
3121         allocate one more page.
3122         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
3123         MULTI_PAGE_ALIASING.
3124
3125 2003-03-13  Roland McGrath  <roland@redhat.com>
3126
3127         * pthread_create.c (start_thread): Set EXITING_BIT after the
3128         event-reporting (and destructors), not before.
3129
3130 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
3131
3132         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
3133         lll_futex_wake): Declare register variables as long int instead of
3134         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
3135         Make syscall arguments clobbered by the syscall.
3136         (lll_futex_wait): Define using lll_futex_timed_wait.
3137
3138         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
3139         to void *.
3140
3141         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
3142         PPID if [! NDEBUG].
3143
3144         * allocatestack.c (nptl_ncreated): Only declare if
3145         COLORING_INCREMENT != 0.
3146
3147         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
3148         (__libc_enable_asynccancel_2): Remove prototype.
3149
3150         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
3151         ctid to match kernel.
3152
3153 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3154
3155         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
3156         libc_multiple_threads.
3157         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
3158         __libc_multiple_threads to...
3159         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
3160
3161         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
3162         versioning.
3163         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3164         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3165
3166         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
3167         (__pthread_once_internal): Define.
3168
3169         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
3170         macros instead of .symver directly.
3171         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3172         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3173
3174         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
3175         * sysdeps/x86_64/tcb-offsets.sym: New file.
3176         * sysdeps/x86_64/Makefile: New file.
3177
3178         * sysdeps/i386/tcb-offsets.sym: Add SELF.
3179         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
3180         to access own pthread_t in TCB.
3181         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3182         Likewise.
3183         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3184         Likewise.
3185         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3186
3187 2003-03-12  Roland McGrath  <roland@redhat.com>
3188
3189         * pthread-errnos.sym: New file.
3190         * Makefile (gen-as-const-headers): New variable, list that file.
3191         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
3192         header <pthread-errnos.h> instead of defining errno values here.
3193         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3194         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3195         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
3196         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3198         Likewise.
3199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3200         Likewise.
3201         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3202         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3203         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3204         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3205         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3206         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3207         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3208         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3209         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3210         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3211         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3212         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
3213         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3214         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
3215         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3216         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3217         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3218         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3219         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3220         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3221         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
3222         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3223         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
3224         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
3225         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
3226         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3227         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3228
3229         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
3230         CLONE_CHILD_SETTID worked.
3231
3232 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3233
3234         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
3235         file.
3236         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
3237         file.
3238
3239         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3240         (pthread_cond_t): Add padding.
3241
3242         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
3243         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
3244         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
3245
3246         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
3247         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
3248         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
3249         (__pthread_rwlock_timedrdlock): Likewise.
3250         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
3251         (__pthread_rwlock_wrlock): Likewise.
3252         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
3253         (__pthread_rwlock_rdlock): Likewise.
3254
3255         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
3256
3257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
3258         result of lock re-get if it fails.
3259
3260 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
3261
3262         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
3263         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3264         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3265         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3267         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3268         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3269         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3270         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3271         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3272
3273         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
3274         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
3275
3276         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
3277         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
3278         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
3279         (create_thread): Likewise.
3280         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
3281         * init.c (__pthread_initialize_minimal_internal): Initialize
3282         __libc_multiple_threads_ptr if necessary.
3283         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
3284         __pthread_multiple_threads and __libc_multiple_threads_ptr.
3285         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
3286         __libc_multiple_threads.
3287         (__libc_pthread_init): Return pointer to __libc_pthread_init if
3288         necessary.
3289
3290         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
3291         (THREAD_SETMEM_NC): Likewise.
3292
3293         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
3294         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
3295         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
3296         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
3297
3298         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
3299         Eliminate one entire instruction.
3300
3301         * cancellation.c (__pthread_enable_asynccancel_2): New function.
3302         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
3303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3304         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
3305         instead of __pthread_enable_asynccancel.
3306         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
3307         (__pthread_cond_wait): Likewise.
3308         * sysdeps/pthread/pthread_cond_timedwait.c
3309         (__pthread_cond_timedwait): Likewise.
3310         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
3311
3312         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
3313         (__condvar_cleanup): Wake up all waiters in case we got signaled
3314         after being woken up but before disabling asynchronous
3315         cancellation.
3316         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
3317         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
3318         (__condvar_cleanup): Likewise.
3319
3320         * init.c (__NR_set_tid_address): If already defined, don't redefine.
3321         Make it an error if architecture has no #if case.  Add x86-64.
3322
3323         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
3324         pt-initfini.s generation.
3325
3326         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
3327         (TLS_INIT_TP): Fix typo.
3328
3329 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
3330
3331         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
3332         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
3333
3334         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
3335         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
3336         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
3337         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
3338         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
3339         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
3340         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
3341         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
3342
3343 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
3344
3345         * sysdeps/pthread/pthread_cond_timedwait.c
3346         (__pthread_cond_timedwait): Return the result of the final
3347         locking.  If it succeeds, the regular function return value.
3348
3349         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
3350         Return result of the final locking.
3351         * version.c (__nptl_main): Work around problems with the strange
3352         INTERNAL_SYSCALL macro on ppc32.
3353         * init.c (__pthread_initialize_minimal_internal): Unblock
3354         SIGCANCEL in case the parent blocked it.
3355         Reported by Paul Mackerras <paulus@samba.org>.
3356
3357         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
3358         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
3359         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
3360
3361 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
3362
3363         * sysdeps/pthread/pthread_cond_timedwait.c
3364         (__pthread_cond_timedwait): Unlock and fail if
3365         __pthread_mutex_unlock_internal failed.
3366
3367         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
3368         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
3369         Use ARCH_CLONE.
3370         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
3371         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
3372         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
3373         ALLOCATE_STACK): New macros.
3374         (TLS_TPADJ): New macro.
3375         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
3376         (allocate_stack): Handle TLS_DTV_AT_TP and
3377         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
3378         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
3379         Don't set PD->self.
3380         * init.c [__ia64__] (__NR_set_tid_address): Define.
3381
3382         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
3383         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
3384         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
3385         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
3386         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
3387         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
3388         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
3389         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
3390         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
3391         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
3392         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
3393         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
3394         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
3395         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
3396         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
3397         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
3398         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
3399         * sysdeps/ia64/bits/atomic.h: New file.
3400         * sysdeps/ia64/Makefile: New file.
3401         * sysdeps/ia64/pthread_spin_init.c: New file.
3402         * sysdeps/ia64/pthread_spin_lock.c: New file.
3403         * sysdeps/ia64/pthread_spin_trylock.c: New file.
3404         * sysdeps/ia64/pthread_spin_unlock.c: New file.
3405         * sysdeps/ia64/pthreaddef.h: New file.
3406         * sysdeps/ia64/tcb-offsets.sym: New file.
3407         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
3408         * sysdeps/ia64/tls.h: New file.
3409
3410         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
3411         to syscall instead of no arguments.
3412
3413 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
3414
3415         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
3416         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
3417         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
3418         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
3419
3420         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
3421         unused code.
3422
3423         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
3424
3425         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3426         lowlevelbarrier.sym.
3427         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
3428         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
3429         Include lowlevelbarrier.h and don't define offsets locally.
3430         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
3431
3432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3433         (__lll_mutex_lock_wait): Reverse order of first two parameters.
3434         (__lll_mutex_timedlock_wait): Likewise.
3435         (lll_mutex_lock): Adjust asm for that.
3436         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
3437         (lll_lock): Adjust asm for operand order change.
3438         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
3439         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
3440
3441         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
3442         Reverse order of parameters.
3443         (__lll_timedwait_tid): Remove regparms attribute.
3444         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
3445         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
3446
3447         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3448         (__lll_timedwait_tid): Remove one unnecessary instruction.
3449
3450         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
3451         __lll_mutex_timedlock_wait only for NOT_IN_libc.
3452         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
3453         lowlevelmutex.S.
3454
3455         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
3456         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
3457         for NOT_IN_libc.
3458         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
3459         l