diff options
Diffstat (limited to 'nptl')
61 files changed, 88 insertions, 644 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 0b1d6300ac..f96101aa9e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,184 +1,3 @@ -2007-01-10 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups. Define - FUTEX_CMP_REQUEUE and lll_futex_requeue. - -2006-12-28 David S. Miller <davem@davemloft.net> - - * shlib-versions: Fix sparc64 linux target specification. - -2007-01-10 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c: - Adjust include path for pthread_barrier_wait.c move. - -2006-12-21 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure - tid isn't reread from pd->tid in between ESRCH test and the syscall. - -2006-12-06 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle - 6 argument cancellable syscalls. - (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle - 6 argument cancellable syscalls. - (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define. - -2006-12-09 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/unix/sysv/linux/rtld-lowlevel.h - (__rtld_mrlock_initialize): Add missing closing parenthesis. - -2006-10-30 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use - __sync_lock_release instead of __sync_lock_release_si. - -2006-10-29 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): - Define. - (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld. - * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. - -2006-10-27 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/pthread/pthread_barrier_wait.c: Move to... - * pthread_barrier_wait.c: ...here. - * sysdeps/pthread/pthread_cond_broadcast.c: Move to... - * pthread_cond_broadcast.c: ...here. - * sysdeps/pthread/pthread_cond_signal.c: Move to... - * pthread_cond_signal.c: ...here. - * sysdeps/pthread/pthread_cond_timedwait.c: Move to... - * pthread_cond_timedwait.c: ...here. - * sysdeps/pthread/pthread_cond_wait.c: Move to... - * pthread_cond_wait.c: ...here. - * sysdeps/pthread/pthread_once.c: Move to... - * pthread_once.c: ...here. - * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to... - * pthread_rwlock_rdlock.c: ...here. - * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to... - * pthread_rwlock_timedrdlock.c: ...here. - * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to... - * pthread_rwlock_timedwrlock.c: ...here. - * sysdeps/pthread/pthread_rwlock_unlock.c: Move to... - * pthread_rwlock_unlock.c: ...here. - * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to... - * pthread_rwlock_wrlock.c: ...here. - * sysdeps/pthread/pthread_spin_destroy.c: Move to... - * pthread_spin_destroy.c: ...here. - * sysdeps/pthread/pthread_spin_init.c: Move to... - * pthread_spin_init.c: ...here. - * sysdeps/pthread/pthread_spin_unlock.c: Move to... - * pthread_spin_unlock.c: ...here. - * sysdeps/pthread/pthread_getcpuclockid.c: Move to... - * pthread_getcpuclockid.c: ...here. - - * init.c: USE_TLS support is now always enabled. - * tst-tls5.h: Likewise. - * sysdeps/alpha/tls.h: Likewise. - * sysdeps/i386/tls.h: Likewise. - * sysdeps/ia64/tls.h: Likewise. - * sysdeps/powerpc/tls.h: Likewise. - * sysdeps/s390/tls.h: Likewise. - * sysdeps/sh/tls.h: Likewise. - * sysdeps/sparc/tls.h: Likewise. - * sysdeps/x86_64/tls.h: Likewise. - -2006-10-27 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock, - __rtld_mrlock_change): Update oldval if atomic compare and exchange - failed. - - * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P): - Define to THREAD_SELF->header.multiple_threads. - * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P): - Likewise. - * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P): - Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P): - Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h - (SINGLE_THREAD_P): Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P): - Likewise. - -2006-10-26 Jakub Jelinek <jakub@redhat.com> - - * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3 - by default rather than 2_3_3. - -2006-10-17 Jakub Jelinek <jakub@redhat.com> - - * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock, - __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use - atomic_* instead of catomic_* macros. - -2006-10-12 Ulrich Drepper <drepper@redhat.com> - - [BZ #3285] - * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX. - * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise. - * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise. - * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX. - * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise. - * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise. - -2006-10-11 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for - cancelable syscalls with six parameters. - - * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_* - operations instead of atomic_*. - -2006-10-09 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file.. - -2006-10-07 Ulrich Drepper <drepper@redhat.com> - - * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file. - * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file. - * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: - New file. - * pthread_attr_setstack.c: Allow overwriting the version number of the - new symbol. - * pthread_attr_setstacksize.c: Likewise. - (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use - it. - * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add - pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6. - 2006-09-24 Ulrich Drepper <drepper@redhat.com> [BZ #3251] diff --git a/nptl/init.c b/nptl/init.c index dddc975a5e..14441153b8 100644 --- a/nptl/init.c +++ b/nptl/init.c @@ -73,7 +73,7 @@ int __set_robust_list_avail; static const char nptl_version[] __attribute_used__ = VERSION; -#ifndef SHARED +#if defined USE_TLS && !defined SHARED extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign); #endif diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c index be79e32082..622e4a2250 100644 --- a/nptl/pthread_attr_setstack.c +++ b/nptl/pthread_attr_setstack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,11 +23,6 @@ #include "pthreadP.h" -#ifndef NEW_VERNUM -# define NEW_VERNUM GLIBC_2_3_3 -#endif - - int __pthread_attr_setstack (attr, stackaddr, stacksize) pthread_attr_t *attr; @@ -59,9 +54,9 @@ strong_alias (__pthread_attr_setstack, pthread_attr_setstack) #else # include <shlib-compat.h> versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, - NEW_VERNUM); + GLIBC_2_3_3); -# if SHLIB_COMPAT(libpthread, GLIBC_2_2, NEW_VERNUM) +# if SHLIB_COMPAT(libpthread, GLIBC_2_2, GLIBC_2_3_3) int __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, @@ -76,9 +71,9 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, if (stacksize < 16384) return EINVAL; -# ifdef EXTRA_PARAM_CHECKS +# ifdef EXTRA_PARAM_CHECKS EXTRA_PARAM_CHECKS; -# endif +# endif iattr->stacksize = stacksize; iattr->stackaddr = (char *) stackaddr + stacksize; diff --git a/nptl/pthread_attr_setstacksize.c b/nptl/pthread_attr_setstacksize.c index 0974538986..f84a9f68e3 100644 --- a/nptl/pthread_attr_setstacksize.c +++ b/nptl/pthread_attr_setstacksize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,10 +22,6 @@ #include <limits.h> #include "pthreadP.h" -#ifndef NEW_VERNUM -# define NEW_VERNUM GLIBC_2_3_3 -#endif - int __pthread_attr_setstacksize (attr, stacksize) @@ -51,9 +47,9 @@ strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize) #else # include <shlib-compat.h> versioned_symbol (libpthread, __pthread_attr_setstacksize, - pthread_attr_setstacksize, NEW_VERNUM); + pthread_attr_setstacksize, GLIBC_2_3_3); -# if SHLIB_COMPAT(libpthread, GLIBC_2_1, NEW_VERNUM) +# if SHLIB_COMPAT(libpthread, GLIBC_2_1, GLIBC_2_3_3) int __old_pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) @@ -67,10 +63,6 @@ __old_pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) if (stacksize < 16384) return EINVAL; -# ifdef STACKSIZE_ADJUST - STACKSIZE_ADJUST; -# endif - iattr->stacksize = stacksize; return 0; diff --git a/nptl/shlib-versions b/nptl/shlib-versions index 06ac620f06..5e18753be2 100644 --- a/nptl/shlib-versions +++ b/nptl/shlib-versions @@ -1,5 +1,5 @@ mips.*-.*-linux.* libpthread=0 GLIBC_2.0 GLIBC_2.2 -sparc64.*-.*-linux.* libpthread=0 GLIBC_2.2 +sparc64-.*-linux.* libpthread=0 GLIBC_2.2 sh.*-.*-linux.* libpthread=0 GLIBC_2.2 ia64.*-.*-linux.* libpthread=0 GLIBC_2.2 hppa.*-.*-linux.* libpthread=0 GLIBC_2.2 diff --git a/nptl/sysdeps/alpha/tls.h b/nptl/sysdeps/alpha/tls.h index be2430f676..20f780c5f5 100644 --- a/nptl/sysdeps/alpha/tls.h +++ b/nptl/sysdeps/alpha/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/Alpha version. - Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,6 +48,9 @@ typedef union dtv # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +# define USE_TLS 1 + #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h index d5b3797e69..a870a848cf 100644 --- a/nptl/sysdeps/i386/tls.h +++ b/nptl/sysdeps/i386/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. nptl/i386 version. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -65,6 +65,9 @@ typedef struct # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +#define USE_TLS 1 + /* Alignment requirement for the stack. For IA-32 this is governed by the SSE memory functions. */ #define STACK_ALIGN 16 diff --git a/nptl/sysdeps/ia64/pthread_spin_unlock.c b/nptl/sysdeps/ia64/pthread_spin_unlock.c index 50d9c5f6a8..6232764b13 100644 --- a/nptl/sysdeps/ia64/pthread_spin_unlock.c +++ b/nptl/sysdeps/ia64/pthread_spin_unlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -23,6 +23,6 @@ int pthread_spin_unlock (pthread_spinlock_t *lock) { - __sync_lock_release ((int *) lock); + __sync_lock_release_si ((int *) lock); return 0; } diff --git a/nptl/sysdeps/ia64/tls.h b/nptl/sysdeps/ia64/tls.h index 22a8b08144..69101ad8c4 100644 --- a/nptl/sysdeps/ia64/tls.h +++ b/nptl/sysdeps/ia64/tls.h @@ -61,6 +61,9 @@ register struct pthread *__thread_self __asm__("r13"); # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +#define USE_TLS 1 + /* Alignment requirement for the stack. */ #define STACK_ALIGN 16 diff --git a/nptl/sysdeps/powerpc/tls.h b/nptl/sysdeps/powerpc/tls.h index ddaafe23d0..976a271362 100644 --- a/nptl/sysdeps/powerpc/tls.h +++ b/nptl/sysdeps/powerpc/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/PowerPC version. - Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,6 +48,9 @@ typedef union dtv # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +# define USE_TLS 1 + #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/nptl/pthread_barrier_wait.c b/nptl/sysdeps/pthread/pthread_barrier_wait.c index c6b563f242..c6b563f242 100644 --- a/nptl/pthread_barrier_wait.c +++ b/nptl/sysdeps/pthread/pthread_barrier_wait.c diff --git a/nptl/pthread_cond_broadcast.c b/nptl/sysdeps/pthread/pthread_cond_broadcast.c index 2b8b5460f4..2b8b5460f4 100644 --- a/nptl/pthread_cond_broadcast.c +++ b/nptl/sysdeps/pthread/pthread_cond_broadcast.c diff --git a/nptl/pthread_cond_signal.c b/nptl/sysdeps/pthread/pthread_cond_signal.c index 5a9bbcad91..5a9bbcad91 100644 --- a/nptl/pthread_cond_signal.c +++ b/nptl/sysdeps/pthread/pthread_cond_signal.c diff --git a/nptl/pthread_cond_timedwait.c b/nptl/sysdeps/pthread/pthread_cond_timedwait.c index fdbf43eae8..fdbf43eae8 100644 --- a/nptl/pthread_cond_timedwait.c +++ b/nptl/sysdeps/pthread/pthread_cond_timedwait.c diff --git a/nptl/pthread_cond_wait.c b/nptl/sysdeps/pthread/pthread_cond_wait.c index f5f5cec5a8..f5f5cec5a8 100644 --- a/nptl/pthread_cond_wait.c +++ b/nptl/sysdeps/pthread/pthread_cond_wait.c diff --git a/nptl/pthread_getcpuclockid.c b/nptl/sysdeps/pthread/pthread_getcpuclockid.c index 8506f94eb4..8506f94eb4 100644 --- a/nptl/pthread_getcpuclockid.c +++ b/nptl/sysdeps/pthread/pthread_getcpuclockid.c diff --git a/nptl/pthread_once.c b/nptl/sysdeps/pthread/pthread_once.c index 9b2cef8645..9b2cef8645 100644 --- a/nptl/pthread_once.c +++ b/nptl/sysdeps/pthread/pthread_once.c diff --git a/nptl/pthread_rwlock_rdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c index e225d7030d..e225d7030d 100644 --- a/nptl/pthread_rwlock_rdlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c index 80ea83a3dd..80ea83a3dd 100644 --- a/nptl/pthread_rwlock_timedrdlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c index 97c0598f96..97c0598f96 100644 --- a/nptl/pthread_rwlock_timedwrlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/sysdeps/pthread/pthread_rwlock_unlock.c index 9cae8b6c22..9cae8b6c22 100644 --- a/nptl/pthread_rwlock_unlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_unlock.c diff --git a/nptl/pthread_rwlock_wrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c index 822aeed79c..822aeed79c 100644 --- a/nptl/pthread_rwlock_wrlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c diff --git a/nptl/pthread_spin_destroy.c b/nptl/sysdeps/pthread/pthread_spin_destroy.c index 4d0109cf02..4d0109cf02 100644 --- a/nptl/pthread_spin_destroy.c +++ b/nptl/sysdeps/pthread/pthread_spin_destroy.c diff --git a/nptl/pthread_spin_init.c b/nptl/sysdeps/pthread/pthread_spin_init.c index c2275085e8..c2275085e8 100644 --- a/nptl/pthread_spin_init.c +++ b/nptl/sysdeps/pthread/pthread_spin_init.c diff --git a/nptl/pthread_spin_unlock.c b/nptl/sysdeps/pthread/pthread_spin_unlock.c index f97cadfbd0..f97cadfbd0 100644 --- a/nptl/pthread_spin_unlock.c +++ b/nptl/sysdeps/pthread/pthread_spin_unlock.c diff --git a/nptl/sysdeps/s390/tls.h b/nptl/sysdeps/s390/tls.h index 6f6f17b975..89ff095d52 100644 --- a/nptl/sysdeps/s390/tls.h +++ b/nptl/sysdeps/s390/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/s390 version. - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -66,6 +66,9 @@ typedef struct # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +#define USE_TLS 1 + /* Alignment requirement for the stack. For IA-32 this is governed by the SSE memory functions. */ #define STACK_ALIGN 16 diff --git a/nptl/sysdeps/sh/tls.h b/nptl/sysdeps/sh/tls.h index d9aa1073b8..49d105518a 100644 --- a/nptl/sysdeps/sh/tls.h +++ b/nptl/sysdeps/sh/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/SH version. - Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -56,6 +56,9 @@ typedef struct # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +# define USE_TLS 1 + #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/nptl/sysdeps/sparc/tls.h b/nptl/sysdeps/sparc/tls.h index 4fbe426595..127bbf695f 100644 --- a/nptl/sysdeps/sparc/tls.h +++ b/nptl/sysdeps/sparc/tls.h @@ -60,6 +60,9 @@ typedef struct # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +#define USE_TLS 1 + #ifndef __ASSEMBLER__ /* Get system call information. */ # include <sysdep.h> diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h index 9b27b1ff48..e0718780cc 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h +++ b/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h @@ -87,6 +87,3 @@ /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h index be4469c69d..6dadfda206 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h @@ -26,6 +26,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h index aa42768f70..f3f7718e3e 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -167,9 +167,3 @@ extern int __local_multiple_threads attribute_hidden; # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h index 4b7b29787e..b639ba44af 100644 --- a/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h +++ b/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h @@ -87,6 +87,3 @@ /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/i386/bits/semaphore.h index 934493c308..e6c5d845ce 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/bits/semaphore.h @@ -28,6 +28,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h index 1cd4b9b8b6..147f5c8470 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -58,7 +58,6 @@ # define SAVE_OLDTYPE_3 SAVE_OLDTYPE_2 # define SAVE_OLDTYPE_4 SAVE_OLDTYPE_2 # define SAVE_OLDTYPE_5 SAVE_OLDTYPE_2 -# define SAVE_OLDTYPE_6 SAVE_OLDTYPE_2 # define PUSHCARGS_0 /* No arguments to push. */ # define DOCARGS_0 /* No arguments to frob. */ @@ -102,14 +101,6 @@ # define _POPCARGS_5 _POPCARGS_4; popl %edi; \ cfi_adjust_cfa_offset (-4); cfi_restore (edi); -# define PUSHCARGS_6 _PUSHCARGS_6 -# define DOCARGS_6 _DOARGS_6 (44) -# define POPCARGS_6 _POPCARGS_6 -# define _PUSHCARGS_6 pushl %ebp; cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (ebp, 0); _PUSHCARGS_5 -# define _POPCARGS_6 _POPCARGS_5; popl %ebp; \ - cfi_adjust_cfa_offset (-4); cfi_restore (ebp); - # ifdef IS_IN_libpthread # define CENABLE call __pthread_enable_asynccancel; # define CDISABLE call __pthread_disable_asynccancel @@ -131,7 +122,6 @@ # define POPSTATE_3 POPSTATE_2 # define POPSTATE_4 POPSTATE_3 # define POPSTATE_5 POPSTATE_4 -# define POPSTATE_6 POPSTATE_5 # ifndef __ASSEMBLER__ # define SINGLE_THREAD_P \ @@ -147,9 +137,3 @@ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h index 83db31efcb..f837250b95 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h @@ -87,6 +87,3 @@ /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/ia64/bits/semaphore.h index 0684aebe24..2329e98667 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/bits/semaphore.h @@ -28,6 +28,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h index c4d52860dd..63aaa96eb0 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -220,9 +220,3 @@ __GC_##name: \ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/Versions b/nptl/sysdeps/unix/sysv/linux/powerpc/Versions index 6b5a0362da..9977847984 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/Versions +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/Versions @@ -2,8 +2,4 @@ libpthread { GLIBC_2.3.4 { longjmp; siglongjmp; } - GLIBC_2.6 { - # Changed PTHREAD_STACK_MIN. - pthread_attr_setstack; pthread_attr_setstacksize; - } } diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h deleted file mode 100644 index 02e2d17343..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Minimum guaranteed maximum values for system limits. Linux/PPC version. - Copyright (C) 1993-1998,2000,2002-2004,2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* The kernel header pollutes the namespace with the NR_OPEN symbol - and defines LINK_MAX although filesystems have different maxima. A - similar thing is true for OPEN_MAX: the limit can be changed at - runtime and therefore the macro must not be defined. Remove this - after including the header if necessary. */ -#ifndef NR_OPEN -# define __undef_NR_OPEN -#endif -#ifndef LINK_MAX -# define __undef_LINK_MAX -#endif -#ifndef OPEN_MAX -# define __undef_OPEN_MAX -#endif - -/* The kernel sources contain a file with all the needed information. */ -#include <linux/limits.h> - -/* Have to remove NR_OPEN? */ -#ifdef __undef_NR_OPEN -# undef NR_OPEN -# undef __undef_NR_OPEN -#endif -/* Have to remove LINK_MAX? */ -#ifdef __undef_LINK_MAX -# undef LINK_MAX -# undef __undef_LINK_MAX -#endif -/* Have to remove OPEN_MAX? */ -#ifdef __undef_OPEN_MAX -# undef OPEN_MAX -# undef __undef_OPEN_MAX -#endif - -/* The number of data keys per process. */ -#define _POSIX_THREAD_KEYS_MAX 128 -/* This is the value this implementation supports. */ -#define PTHREAD_KEYS_MAX 1024 - -/* Controlling the iterations of destructors for thread-specific data. */ -#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 -/* Number of iterations this implementation does. */ -#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS - -/* The number of threads per process. */ -#define _POSIX_THREAD_THREADS_MAX 64 -/* We have no predefined limit on the number of threads. */ -#undef PTHREAD_THREADS_MAX - -/* Maximum amount by which a process can descrease its asynchronous I/O - priority level. */ -#define AIO_PRIO_DELTA_MAX 20 - -/* Minimum size for a thread. At least two pages for systems with 64k - pages. */ -#define PTHREAD_STACK_MIN 131072 - -/* Maximum number of timer expiration overruns. */ -#define DELAYTIMER_MAX 2147483647 - -/* Maximum tty name length. */ -#define TTY_NAME_MAX 32 - -/* Maximum login name length. This is arbitrary. */ -#define LOGIN_NAME_MAX 256 - -/* Maximum host name length. */ -#define HOST_NAME_MAX 64 - -/* Maximum message queue priority level. */ -#define MQ_PRIO_MAX 32768 - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h index c7f121ba5b..8123b418b5 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h @@ -33,6 +33,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h index 3752abc870..dcbc0d6520 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h @@ -128,9 +128,3 @@ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h index 707765ab58..83eb444ece 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h @@ -117,9 +117,3 @@ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c b/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c deleted file mode 100644 index 2cb0a13bcb..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c +++ /dev/null @@ -1,2 +0,0 @@ -#define NEW_VERNUM GLIBC_2_6 -#include <nptl/pthread_attr_setstack.c> diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c b/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c deleted file mode 100644 index 9472dd17ef..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c +++ /dev/null @@ -1,8 +0,0 @@ -#define NEW_VERNUM GLIBC_2_6 -#define STACKSIZE_ADJUST \ - do { \ - size_t ps = __getpagesize (); \ - if (stacksize < 2 * ps) \ - stacksize = 2 * ps; \ - } while (0) -#include <nptl/pthread_attr_setstacksize.c> diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c index 75089365c3..9115d6f40b 100644 --- a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -33,15 +33,7 @@ __pthread_kill (threadid, signo) struct pthread *pd = (struct pthread *) threadid; /* Make sure the descriptor is valid. */ - if (DEBUGGING_P && INVALID_TD_P (pd)) - /* Not a valid thread handle. */ - return ESRCH; - - /* Force load of pd->tid into local variable or register. Otherwise - if a thread exits between ESRCH test and tgkill, we might return - EINVAL, because pd->tid would be cleared by the kernel. */ - pid_t tid = atomic_forced_read (pd->tid); - if (__builtin_expect (tid <= 0, 0)) + if (INVALID_TD_P (pd)) /* Not a valid thread handle. */ return ESRCH; @@ -61,15 +53,15 @@ __pthread_kill (threadid, signo) int val; #if __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), - tid, signo); + pd->tid, signo); #else # ifdef __NR_tgkill val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), - tid, signo); + pd->tid, signo); if (INTERNAL_SYSCALL_ERROR_P (val, err) && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS) # endif - val = INTERNAL_SYSCALL (tkill, err, 2, tid, signo); + val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, signo); #endif return (INTERNAL_SYSCALL_ERROR_P (val, err) diff --git a/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h b/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h deleted file mode 100644 index 6b3d3682da..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h +++ /dev/null @@ -1,153 +0,0 @@ -/* Defintions for lowlevel handling in ld.so. - Copyright (C) 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _RTLD_LOWLEVEL_H -#define _RTLD_LOWLEVEL_H 1 - -#include <atomic.h> -#include <lowlevellock.h> - - -/* Special multi-reader lock used in ld.so. */ -#define __RTLD_MRLOCK_WRITER 1 -#define __RTLD_MRLOCK_RWAIT 2 -#define __RTLD_MRLOCK_WWAIT 4 -#define __RTLD_MRLOCK_RBITS \ - ~(__RTLD_MRLOCK_WRITER | __RTLD_MRLOCK_RWAIT | __RTLD_MRLOCK_WWAIT) -#define __RTLD_MRLOCK_INC 8 -#define __RTLD_MRLOCK_TRIES 5 - - -typedef int __rtld_mrlock_t; - - -#define __rtld_mrlock_define(CLASS,NAME) \ - CLASS __rtld_mrlock_t NAME; - - -#define _RTLD_MRLOCK_INITIALIZER 0 -#define __rtld_mrlock_initialize(NAME) \ - (void) ((NAME) = 0) - - -#define __rtld_mrlock_lock(lock) \ - do { \ - __label__ out; \ - while (1) \ - { \ - int oldval; \ - for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries) \ - { \ - oldval = lock; \ - while (__builtin_expect ((oldval \ - & (__RTLD_MRLOCK_WRITER \ - | __RTLD_MRLOCK_WWAIT)) \ - == 0, 1)) \ - { \ - int newval = ((oldval & __RTLD_MRLOCK_RBITS) \ - + __RTLD_MRLOCK_INC); \ - int ret = atomic_compare_and_exchange_val_acq (&(lock), \ - newval, \ - oldval); \ - if (__builtin_expect (ret == oldval, 1)) \ - goto out; \ - oldval = ret; \ - } \ - atomic_delay (); \ - } \ - if ((oldval & __RTLD_MRLOCK_RWAIT) == 0) \ - { \ - atomic_or (&(lock), __RTLD_MRLOCK_RWAIT); \ - oldval |= __RTLD_MRLOCK_RWAIT; \ - } \ - lll_futex_wait (lock, oldval); \ - } \ - out:; \ - } while (0) - - -#define __rtld_mrlock_unlock(lock) \ - do { \ - int oldval = atomic_exchange_and_add (&(lock), -__RTLD_MRLOCK_INC); \ - if (__builtin_expect ((oldval \ - & (__RTLD_MRLOCK_RBITS | __RTLD_MRLOCK_WWAIT)) \ - == (__RTLD_MRLOCK_INC | __RTLD_MRLOCK_WWAIT), 0)) \ - /* We have to wake all threads since there might be some queued \ - readers already. */ \ - lll_futex_wake (&(lock), 0x7fffffff); \ - } while (0) - - -/* There can only ever be one thread trying to get the exclusive lock. */ -#define __rtld_mrlock_change(lock) \ - do { \ - __label__ out; \ - while (1) \ - { \ - int oldval; \ - for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries) \ - { \ - oldval = lock; \ - while (__builtin_expect ((oldval & __RTLD_MRLOCK_RBITS) == 0, 1)) \ - { \ - int newval = ((oldval & __RTLD_MRLOCK_RWAIT) \ - + __RTLD_MRLOCK_WRITER); \ - int ret = atomic_compare_and_exchange_val_acq (&(lock), \ - newval, \ - oldval); \ - if (__builtin_expect (ret == oldval, 1)) \ - goto out; \ - oldval = ret; \ - } \ - atomic_delay (); \ - } \ - atomic_or (&(lock), __RTLD_MRLOCK_WWAIT); \ - oldval |= __RTLD_MRLOCK_WWAIT; \ - lll_futex_wait (lock, oldval); \ - } \ - out:; \ - } while (0) - - -#define __rtld_mrlock_done(lock) \ - do { \ - int oldval = atomic_exchange_and_add (&(lock), -__RTLD_MRLOCK_WRITER); \ - if (__builtin_expect ((oldval & __RTLD_MRLOCK_RWAIT) != 0, 0)) \ - lll_futex_wake (&(lock), 0x7fffffff); \ - } while (0) - - -/* Function to wait for variable become zero. Used in ld.so for - reference counters. */ -#define __rtld_waitzero(word) \ - do { \ - while (1) \ - { \ - int val = word; \ - if (val == 0) \ - break; \ - lll_futex_wait (&(word), val); \ - } \ - } while (0) - - -#define __rtld_notify(word) \ - lll_futex_wake (&(word), 1) - -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/semaphore.h index 111462f0fb..ead2663047 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/semaphore.h @@ -32,6 +32,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h index 6b0240243a..09dac2c90b 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -45,13 +45,7 @@ L(pseudo_cancel): \ bas %r14,0(%r1,%r13); \ lr %r0,%r2; \ LM_##args \ - .if SYS_ify (syscall_name) < 256; \ - svc SYS_ify (syscall_name); \ - .else; \ - lhi %r1,SYS_ify (syscall_name); \ - svc 0; \ - .endif; \ - LR7_##args \ + DO_CALL(syscall_name, args); \ l %r1,2f-0b(%r13); \ lr %r12,%r2; \ lr %r2,%r0; \ @@ -95,7 +89,6 @@ L(pseudo_end): #define STM_3 stm %r2,%r4,8(%r15); #define STM_4 stm %r2,%r5,8(%r15); #define STM_5 stm %r2,%r5,8(%r15); -#define STM_6 stm %r2,%r7,8(%r15); #define LM_0 /* Nothing */ #define LM_1 l %r2,8+96(%r15); @@ -103,18 +96,6 @@ L(pseudo_end): #define LM_3 lm %r2,%r4,8+96(%r15); #define LM_4 lm %r2,%r5,8+96(%r15); #define LM_5 lm %r2,%r5,8+96(%r15); -#define LM_6 lm %r2,%r5,8+96(%r15); \ - cfi_offset (%r7, -68); \ - l %r7,96+96(%r15); - -#define LR7_0 /* Nothing */ -#define LR7_1 /* Nothing */ -#define LR7_2 /* Nothing */ -#define LR7_3 /* Nothing */ -#define LR7_4 /* Nothing */ -#define LR7_5 /* Nothing */ -#define LR7_6 l %r7,28+96(%r15); \ - cfi_restore (%r7); # ifndef __ASSEMBLER__ # define SINGLE_THREAD_P \ @@ -132,9 +113,3 @@ L(pseudo_end): # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h index 70d5a86429..f8eb6a9ebc 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -42,13 +42,7 @@ L(pseudo_cancel): \ brasl %r14,CENABLE; \ lgr %r0,%r2; \ LM_##args \ - .if SYS_ify (syscall_name) < 256; \ - svc SYS_ify (syscall_name); \ - .else; \ - lghi %r1,SYS_ify (syscall_name); \ - svc 0; \ - .endif; \ - LR7_##args \ + DO_CALL(syscall_name, args); \ lgr %r13,%r2; \ lgr %r2,%r0; \ brasl %r14,CDISABLE; \ @@ -91,7 +85,6 @@ L(pseudo_end): #define STM_3 stmg %r2,%r4,16(%r15); #define STM_4 stmg %r2,%r5,16(%r15); #define STM_5 stmg %r2,%r5,16(%r15); -#define STM_6 stmg %r2,%r7,16(%r15); #define LM_0 /* Nothing */ #define LM_1 lg %r2,16+160(%r15); @@ -99,18 +92,6 @@ L(pseudo_end): #define LM_3 lmg %r2,%r4,16+160(%r15); #define LM_4 lmg %r2,%r5,16+160(%r15); #define LM_5 lmg %r2,%r5,16+160(%r15); -#define LM_6 lmg %r2,%r5,16+160(%r15); \ - cfi_offset (%r7, -104); \ - lg %r7,160+160(%r15); - -#define LR7_0 /* Nothing */ -#define LR7_1 /* Nothing */ -#define LR7_2 /* Nothing */ -#define LR7_3 /* Nothing */ -#define LR7_4 /* Nothing */ -#define LR7_5 /* Nothing */ -#define LR7_6 lg %r7,56+160(%r15); \ - cfi_restore (%r7); # if defined IS_IN_libpthread || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -145,9 +126,3 @@ extern int __local_multiple_threads attribute_hidden; # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sh/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/sh/bits/semaphore.h index 934493c308..e6c5d845ce 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/sh/bits/semaphore.h @@ -28,6 +28,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h index a8065c6a8c..9a967eaf53 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -161,9 +161,3 @@ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h index 2576f121c3..e082ea8f04 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h @@ -87,6 +87,3 @@ /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/semaphore.h index 8fd7d344ea..7f3a328326 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/semaphore.h @@ -33,6 +33,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c index 55d20eb8f8..7613863bba 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c @@ -1 +1 @@ -#include "../../../../../../../pthread_barrier_wait.c" +#include "../../../../../../pthread/pthread_barrier_wait.c" diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h index f0349906b2..75a4eb9469 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -104,9 +104,3 @@ __##syscall_name##_nocancel: \ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h index 2c76d01715..dd263a597c 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h @@ -102,9 +102,3 @@ __##syscall_name##_nocancel: \ # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h index e973bc5bfb..57edbbbfb3 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h @@ -33,6 +33,9 @@ /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) + typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h index 4030bb7fb8..97085bf018 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -35,7 +35,6 @@ #define SYS_futex 202 #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 -#define FUTEX_CMP_REQUEUE 4 #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 @@ -151,7 +150,7 @@ LLL_STUB_UNWIND_INFO_END #define lll_futex_wait(futex, val) \ ({ \ int __status; \ - register __typeof (val) _val __asm ("edx") = (val); \ + register __typeof (val) _val asm ("edx") = (val); \ __asm __volatile ("xorq %%r10, %%r10\n\t" \ "syscall" \ : "=a" (__status) \ @@ -164,22 +163,22 @@ LLL_STUB_UNWIND_INFO_END #define lll_futex_timed_wait(futex, val, timeout) \ ({ \ - register const struct timespec *__to __asm ("r10") = timeout; \ + register const struct timespec *__to __asm__ ("r10") = timeout; \ int __status; \ - register __typeof (val) _val __asm ("edx") = (val); \ + register __typeof (val) _val asm ("edx") = (val); \ __asm __volatile ("syscall" \ : "=a" (__status) \ : "0" (SYS_futex), "D" (futex), "S" (FUTEX_WAIT), \ "d" (_val), "r" (__to) \ : "memory", "cc", "r11", "cx"); \ - -__status; \ + __status; \ }) #define lll_futex_wake(futex, nr) \ do { \ int __ignore; \ - register __typeof (nr) _nr __asm ("edx") = (nr); \ + register __typeof (nr) _nr asm ("edx") = (nr); \ __asm __volatile ("syscall" \ : "=a" (__ignore) \ : "0" (SYS_futex), "D" (futex), "S" (FUTEX_WAKE), \ @@ -424,21 +423,6 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden; : "cx", "r11", "cc", "memory"); }) -/* Returns non-zero if error happened, zero if success. */ -#define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val) \ - ({ int __res; \ - register int __nr_move __asm ("r10") = nr_move; \ - register void *__mutex __asm ("r8") = mutex; \ - register int __val __asm ("r9") = val; \ - __asm __volatile ("syscall" \ - : "=a" (__res) \ - : "0" (__NR_futex), "D" ((void *) ftx), \ - "S" (FUTEX_CMP_REQUEUE), "d" (nr_wake), \ - "r" (__nr_move), "r" (__mutex), "r" (__val) \ - : "cx", "r11", "cc", "memory"); \ - __res < 0; }) - - #define lll_mutex_islocked(futex) \ (futex != LLL_MUTEX_LOCK_INITIALIZER) diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h index 3e741da794..97debaba99 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -136,9 +136,3 @@ extern int __local_multiple_threads attribute_hidden; # define NO_CANCELLATION 1 #endif - -#ifndef __ASSEMBLER__ -# define RTLD_SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) -#endif diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h index 7618573e0b..65ff0639b6 100644 --- a/nptl/sysdeps/x86_64/tls.h +++ b/nptl/sysdeps/x86_64/tls.h @@ -62,6 +62,9 @@ typedef struct # error "TLS support is required." #endif +/* Signal that TLS support is available. */ +#define USE_TLS 1 + /* Alignment requirement for the stack. */ #define STACK_ALIGN 16 diff --git a/nptl/tst-tls5.h b/nptl/tst-tls5.h index 9a76ab7827..b7c14eb82c 100644 --- a/nptl/tst-tls5.h +++ b/nptl/tst-tls5.h @@ -2,7 +2,7 @@ #include <stdlib.h> #include <tls.h> -#if HAVE___THREAD +#if USE_TLS && HAVE___THREAD struct tls_obj { |