diff options
Diffstat (limited to 'libpthread/linuxthreads/sysdeps')
148 files changed, 841 insertions, 2456 deletions
diff --git a/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c b/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c index ee2558210..6cdc69d58 100644 --- a/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ /* This file is compiled into assembly code which is then munged by a sed script into two files: crti.s and crtn.s. diff --git a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c b/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c index d54a2a98b..cdf4be99c 100644 --- a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h b/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h index 97c38394b..b47343ba7 100644 --- a/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h @@ -17,8 +17,7 @@ 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. */ + see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/alpha/tls.h b/libpthread/linuxthreads/sysdeps/alpha/tls.h index 3eb9438ce..51c7fea8b 100644 --- a/libpthread/linuxthreads/sysdeps/alpha/tls.h +++ b/libpthread/linuxthreads/sysdeps/alpha/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c b/libpthread/linuxthreads/sysdeps/arm/pspinlock.c index 9deb0b1b1..691085270 100644 --- a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/arm/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h index 9ffc8bdc4..0a455b97d 100644 --- a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h new file mode 100644 index 000000000..ba6a1e04b --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h @@ -0,0 +1,8 @@ +#include <sysdep.h> + +/* No multi-thread handling enabled. */ +#define SINGLE_THREAD_P (1) +#define RTLD_SINGLE_THREAD_P (1) +#define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ +#define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ +#define LIBC_CANCEL_HANDLED() /* Nothing. */ diff --git a/libpthread/linuxthreads/sysdeps/arm/tls.h b/libpthread/linuxthreads/sysdeps/arm/tls.h index 8057a5413..df8d97009 100644 --- a/libpthread/linuxthreads/sysdeps/arm/tls.h +++ b/libpthread/linuxthreads/sysdeps/arm/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h b/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h index b93bc47f0..5735d0ea2 100644 --- a/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h @@ -15,8 +15,8 @@ # define PT_EI __extern_always_inline #endif -static inline int -_test_and_set (int *p, int v) __THROW +static __inline__ int +_test_and_set (int *p, int v) { int result; @@ -52,7 +52,7 @@ register char * stack_pointer __asm__ ("sp"); PT_EI int __compare_and_swap(long int *p, long int oldval, long int newval) { - int result; + long int result; __asm__ __volatile__( "/* Inline compare and swap */\n" diff --git a/libpthread/linuxthreads/sysdeps/cris/pspinlock.c b/libpthread/linuxthreads/sysdeps/cris/pspinlock.c index 402e838c0..7e3e62959 100644 --- a/libpthread/linuxthreads/sysdeps/cris/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/cris/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h index 33cf57908..9b2acb761 100644 --- a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c b/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c index 71a537fd6..1a6aa64a9 100644 --- a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h b/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h index 780af7b96..85c453c77 100644 --- a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h b/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h index 222d44a3f..2e52abe2e 100644 --- a/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 @@ -25,7 +24,7 @@ #ifndef PT_EI # define PT_EI __extern_always_inline #endif -#include "kernel-features.h" +#include <bits/kernel-features.h> #ifndef __ASSEMBLER__ extern long int testandset (int *spinlock); diff --git a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c b/libpthread/linuxthreads/sysdeps/i386/pspinlock.c index c9c62724b..7936735f9 100644 --- a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/i386/pspinlock.c @@ -13,14 +13,13 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> #include "internals.h" -#include <kernel-features.h> +#include <bits/kernel-features.h> /* This implementation is similar to the one used in the Linux kernel. diff --git a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h index f96452599..82a5cf077 100644 --- a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #if defined __pentiumpro__ || defined __pentium4__ || defined __athlon__ || \ defined __k8__ @@ -32,10 +31,9 @@ # define PT_EI __extern_always_inline #endif -/* extern long int testandset (int *spinlock); extern int __compare_and_swap (long int *p, long int oldval, long int newval); -*/ + /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ #define CURRENT_STACK_FRAME __builtin_frame_address (0) diff --git a/libpthread/linuxthreads/sysdeps/i386/tls.h b/libpthread/linuxthreads/sysdeps/i386/tls.h index 2abd3a093..d79bf0779 100644 --- a/libpthread/linuxthreads/sysdeps/i386/tls.h +++ b/libpthread/linuxthreads/sysdeps/i386/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H @@ -46,9 +45,7 @@ typedef struct dtv_t *dtv; void *self; /* Pointer to the thread descriptor. */ int multiple_threads; -#ifdef NEED_DL_SYSINFO uintptr_t sysinfo; -#endif } tcbhead_t; #else /* __ASSEMBLER__ */ diff --git a/libpthread/linuxthreads/sysdeps/i386/useldt.h b/libpthread/linuxthreads/sysdeps/i386/useldt.h index fa9a2a528..067e5e242 100644 --- a/libpthread/linuxthreads/sysdeps/i386/useldt.h +++ b/libpthread/linuxthreads/sysdeps/i386/useldt.h @@ -16,8 +16,7 @@ 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. */ + see <http://www.gnu.org/licenses/>. */ #ifndef __ASSEMBLER__ #include <stddef.h> /* For offsetof. */ @@ -87,7 +86,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); because we inherited the value set up in the main thread by TLS setup. We need to extract that value and set up the same segment in this thread. */ -#if defined (USE_TLS) && USE_TLS +#ifdef __UCLIBC_HAS_TLS__ # define DO_SET_THREAD_AREA_REUSE(nr) 1 #else /* Without TLS, we do the initialization of the main thread, where NR == 0. */ diff --git a/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c b/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c index fa10c7b37..d5e52ff6b 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h index e36468a74..55bdd5df5 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym b/libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym index f7793f766..1000ad0a9 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym +++ b/libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym @@ -2,7 +2,7 @@ #include <tls.h> -- -#ifdef USE_TLS +#ifdef __UCLIBC_HAS_TLS__ MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads) - sizeof (struct _pthread_descr_struct) #else MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) diff --git a/libpthread/linuxthreads/sysdeps/ia64/tls.h b/libpthread/linuxthreads/sysdeps/ia64/tls.h index 0311a9ccb..c86073f26 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/tls.h +++ b/libpthread/linuxthreads/sysdeps/ia64/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c index 35b851faf..af77c2a9d 100644 --- a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> @@ -28,10 +27,15 @@ __pthread_spin_lock (pthread_spinlock_t *lock) unsigned int val; do - __asm__ __volatile__ ("tas %1; sne %0" - : "=dm" (val), "=m" (*lock) - : "m" (*lock) - : "cc"); + __asm__ __volatile__ ( +#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__m68000) + "tas %1; sne %0" +#else + "bset #7,%1; sne %0" +#endif + : "=dm" (val), "=m" (*lock) + : "m" (*lock) + : "cc"); while (val); return 0; @@ -44,7 +48,12 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { unsigned int val; - __asm__ __volatile__ ("tas %1; sne %0" + __asm__ __volatile__ ( +#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__m68000) + "tas %1; sne %0" +#else + "bset #7,%1; sne %0" +#endif : "=dm" (val), "=m" (*lock) : "m" (*lock) : "cc"); diff --git a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h index a13c06946..1eb9fd57b 100644 --- a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h @@ -16,8 +16,7 @@ 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. */ + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 @@ -29,12 +28,18 @@ #endif /* Spinlock implementation; required. */ +PT_EI long int testandset (int *spinlock); PT_EI long int testandset (int *spinlock) { char ret; - __asm__ __volatile__("tas %1; sne %0" + __asm__ __volatile__( +#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__m68000) + "tas %1; sne %0" +#else + "bset #7,%1; sne %0" +#endif : "=dm"(ret), "=m"(*spinlock) : "m"(*spinlock) : "cc"); @@ -51,6 +56,7 @@ register char * stack_pointer __asm__ ("%sp"); /* Compare-and-swap for semaphores. */ +#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__mc68000) #define HAS_COMPARE_AND_SWAP PT_EI int __compare_and_swap (long int *p, long int oldval, long int newval) @@ -64,5 +70,5 @@ __compare_and_swap (long int *p, long int oldval, long int newval) return ret; } - +#endif #endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/mips/pspinlock.c b/libpthread/linuxthreads/sysdeps/mips/pspinlock.c index a106c0f77..7b9205ef0 100644 --- a/libpthread/linuxthreads/sysdeps/mips/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/mips/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> @@ -23,8 +22,6 @@ #include <sys/tas.h> #include "internals.h" -#include <sgidefs.h> - /* This implementation is similar to the one used in the Linux kernel. */ int __pthread_spin_lock (pthread_spinlock_t *lock) diff --git a/libpthread/linuxthreads/sysdeps/mips/pt-machine.h b/libpthread/linuxthreads/sysdeps/mips/pt-machine.h index 0ab7ac13f..74e8807eb 100644 --- a/libpthread/linuxthreads/sysdeps/mips/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/mips/pt-machine.h @@ -18,8 +18,7 @@ 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. */ + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/mips/tls.h b/libpthread/linuxthreads/sysdeps/mips/tls.h index 15dda696d..4e7887a74 100644 --- a/libpthread/linuxthreads/sysdeps/mips/tls.h +++ b/libpthread/linuxthreads/sysdeps/mips/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/or1k/pt-machine.h b/libpthread/linuxthreads/sysdeps/or1k/pt-machine.h new file mode 100644 index 000000000..c6c8ee470 --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/or1k/pt-machine.h @@ -0,0 +1,55 @@ +/* Machine-dependent pthreads configuration and inline functions. + OpenRISC version. + Copyright (C) 2001, 2002, 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 + 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. */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#include <features.h> +#include <sys/syscall.h> + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +PT_EI long int testandset(int*); + +#define OR1K_ATOMIC_XCHG 1 + +PT_EI long int +testandset (int *spinlock) +{ + int err; + int oldvalue = 1; + + err = INLINE_SYSCALL(or1k_atomic, 3, OR1K_ATOMIC_XCHG, spinlock, &oldvalue); + + return (oldvalue); +} + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#define CURRENT_STACK_FRAME stack_pointer() +static inline char *stack_pointer(void) +{ + unsigned long ret; + __asm__ __volatile__ ("l.ori %0, r1, 0" : "=r" (ret)); + return (char *)ret; +} +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c index 15fd545c1..875aa3876 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h index bfb13df67..a2b8b61e6 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h @@ -16,8 +16,7 @@ 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. */ + not, see <http://www.gnu.org/licenses/>. */ /* These routines are from Appendix G of the 'PowerPC 601 RISC Microprocessor User's Manual', by IBM and Motorola. */ diff --git a/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c index 19161c6e1..f588c62c7 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h index d7ed84108..b9193a871 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU Library 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. */ + not, see <http://www.gnu.org/licenses/>. */ /* These routines are from Appendix G of the 'PowerPC 601 RISC Microprocessor User's Manual', by IBM and Motorola. */ diff --git a/libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym b/libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym index 7c5cca01e..7940cf620 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym +++ b/libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym @@ -3,7 +3,7 @@ -- This line separates the #include lines from conditionals. -# ifdef USE_TLS +# ifdef __UCLIBC_HAS_TLS__ -- Abuse tls.h macros to derive offsets relative to the thread register. # undef __thread_register diff --git a/libpthread/linuxthreads/sysdeps/powerpc/tls.h b/libpthread/linuxthreads/sysdeps/powerpc/tls.h index 1ae0b60ff..8555b239d 100644 --- a/libpthread/linuxthreads/sysdeps/powerpc/tls.h +++ b/libpthread/linuxthreads/sysdeps/powerpc/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/pthread/.cvsignore b/libpthread/linuxthreads/sysdeps/pthread/.cvsignore deleted file mode 100644 index 7ee8f5969..000000000 --- a/libpthread/linuxthreads/sysdeps/pthread/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -.cvsignore -*.os diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h b/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h index a19ec077e..b9e4acf30 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ /* Initial value of a spinlock. Most platforms should use zero, unless they only implement a "test and clear" operation instead of diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h index 2299b3af5..855efff12 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_LIBC_LOCK_H #define _BITS_LIBC_LOCK_H 1 @@ -293,7 +292,7 @@ typedef pthread_key_t __libc_key_t; library. */ extern int __pthread_mutex_init (pthread_mutex_t *__mutex, - __const pthread_mutexattr_t *__mutex_attr); + const pthread_mutexattr_t *__mutex_attr); extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); @@ -312,7 +311,7 @@ extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, #ifdef __USE_UNIX98 extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, - __const pthread_rwlockattr_t *__attr); + const pthread_rwlockattr_t *__attr); extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); @@ -331,7 +330,7 @@ extern int __pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)); extern int __pthread_setspecific (pthread_key_t __key, - __const void *__pointer); + const void *__pointer); extern void *__pthread_getspecific (pthread_key_t __key); diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h index fa6eb4be2..7cc5f9cf6 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h @@ -13,18 +13,16 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_LIBC_TSD_H #define _BITS_LIBC_TSD_H 1 #include <linuxthreads/descr.h> +#ifdef __UCLIBC_HAS_TLS__ #include <tls.h> -#if USE_TLS && HAVE___THREAD - /* When __thread works, the generic definition is what we want. */ # include <sysdeps/generic/bits/libc-tsd.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h index 4ea6d8ac5..8d01c8908 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h @@ -19,6 +19,9 @@ #ifndef _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H 1 +#define __need_size_t +#include <stddef.h> + #define __need_schedparam #include <bits/sched.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h index 45264ac9c..0e900d2d5 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_H # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." diff --git a/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c b/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c index c3b3087e4..8bdfff485 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c +++ b/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c @@ -14,26 +14,25 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <linuxthreads/internals.h> #include <sysdep-cancel.h> -#if ! USE___THREAD && !RTLD_PRIVATE_ERRNO +#if !defined __UCLIBC_HAS_TLS__ && !RTLD_PRIVATE_ERRNO #undef errno extern int errno; #endif int * -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ weak_const_function #endif __errno_location (void) { -#if ! USE___THREAD && !defined NOT_IN_libc +#if !defined __UCLIBC_HAS_TLS__ && !defined NOT_IN_libc if (! SINGLE_THREAD_P) { pthread_descr self = thread_self(); diff --git a/libpthread/linuxthreads/sysdeps/pthread/flockfile.c b/libpthread/linuxthreads/sysdeps/pthread/flockfile.c index 918cb84f6..538e368a0 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/flockfile.c +++ b/libpthread/linuxthreads/sysdeps/pthread/flockfile.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <pthread.h> #include <stdio.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c b/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c index 21c1ea01e..d814258d8 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c +++ b/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c b/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c index f941fc985..f45479936 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c +++ b/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <pthread.h> #include <stdio.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c b/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c index 1c64e6c2b..6acb179c5 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c +++ b/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> @@ -23,7 +22,7 @@ #include <time.h> #include <internals.h> #include <spinlock.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> #include <kernel-posix-cpu-timers.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c b/libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c index fbc557616..634c75245 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c +++ b/libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c @@ -12,16 +12,17 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <netdb.h> +#ifdef __UCLIBC_HAS_TLS__ #include <tls.h> +#endif #include <linuxthreads/internals.h> #include <sysdep-cancel.h> -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ # undef h_errno extern int h_errno; #endif @@ -31,7 +32,7 @@ int * weak_const_function __h_errno_location (void) { -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ if (! SINGLE_THREAD_P) { pthread_descr self = thread_self(); diff --git a/libpthread/linuxthreads/sysdeps/pthread/kernel-features.h b/libpthread/linuxthreads/sysdeps/pthread/kernel-features.h deleted file mode 100644 index 88a71828b..000000000 --- a/libpthread/linuxthreads/sysdeps/pthread/kernel-features.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Set flags signalling availability of kernel features based on given - kernel version number. - Copyright (C) 1999-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 - 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. */ - -/* This file must not contain any C code. At least it must be protected - to allow using the file also in assembler files. */ - -#if defined __mips__ -# include <sgidefs.h> -#endif - -#include <linux/version.h> -#define __LINUX_KERNEL_VERSION LINUX_VERSION_CODE - -/* Real-time signal became usable in 2.1.70. */ -#if __LINUX_KERNEL_VERSION >= 131398 -# define __ASSUME_REALTIME_SIGNALS 1 -#endif - -/* Beginning with 2.5.63 support for realtime and monotonic clocks and - timers based on them is available. */ -#if __LINUX_KERNEL_VERSION >= 132415 -# define __ASSUME_POSIX_TIMERS 1 -#endif - -/* On x86, the set_thread_area syscall was introduced in 2.5.29, but its - semantics was changed in 2.5.30, and again after 2.5.31. */ -#if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__ -# define __ASSUME_SET_THREAD_AREA_SYSCALL 1 -#endif - -/* We can use the LDTs for threading with Linux 2.3.99 and newer. */ -#if __LINUX_KERNEL_VERSION >= 131939 -# define __ASSUME_LDT_WORKS 1 -#endif - -/* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way - and the vfork syscall made it into the official kernel. */ -#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ -# define __ASSUME_STD_AUXV 1 -# define __ASSUME_VFORK_SYSCALL 1 -#endif - -/* The vfork syscall on x86 and arm was definitely available in 2.4. */ -#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__) -# define __ASSUME_VFORK_SYSCALL 1 -#endif - -/* Starting with version 2.6.4-rc1 the getdents syscall returns d_type - * information as well and in between 2.6.5 and 2.6.8 most compat wrappers - * were fixed too. Except s390{,x} which was fixed in 2.6.11. */ -#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \ - || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__) -# define __ASSUME_GETDENTS32_D_TYPE 1 -#endif - -/* These features were surely available with 2.4.12. */ -#if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__ -# define __ASSUME_MMAP2_SYSCALL 1 -# define __ASSUME_TRUNCATE64_SYSCALL 1 -# define __ASSUME_STAT64_SYSCALL 1 -# define __ASSUME_FCNTL64 1 -# define __ASSUME_VFORK_SYSCALL 1 -#endif diff --git a/libpthread/linuxthreads/sysdeps/pthread/list.h b/libpthread/linuxthreads/sysdeps/pthread/list.h index 75decfbb7..232988fd6 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/list.h +++ b/libpthread/linuxthreads/sysdeps/pthread/list.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _LIST_H #define _LIST_H 1 diff --git a/libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h b/libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h index 5191f8c77..f70729fd7 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h +++ b/libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _MALLOC_MACHINE_H #define _MALLOC_MACHINE_H diff --git a/libpthread/linuxthreads/sysdeps/pthread/not-cancel.h b/libpthread/linuxthreads/sysdeps/pthread/not-cancel.h index 4373917df..b46d2ab49 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/not-cancel.h +++ b/libpthread/linuxthreads/sysdeps/pthread/not-cancel.h @@ -1,5 +1,5 @@ /* Uncancelable versions of cancelable interfaces. Linux version. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -14,19 +14,48 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -#include <sys/syscall.h> -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(func, numargs, args...) syscall(__NR_ ## func, args) +#include <sys/types.h> +#include <sysdep.h> /* Uncancelable open. */ +#if defined __NR_openat && !defined __NR_open +#define open_not_cancel(name, flags, mode) \ + INLINE_SYSCALL (openat, 4, (int) (AT_FDCWD), (const char *) (name), \ + (flags), (mode)) +#define open_not_cancel_2(name, flags) \ + INLINE_SYSCALL (openat, 3, (int) (AT_FDCWD), (const char *) (name), \ + (flags)) +#else #define open_not_cancel(name, flags, mode) \ INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode)) #define open_not_cancel_2(name, flags) \ INLINE_SYSCALL (open, 2, (const char *) (name), (flags)) +#endif + +/* Uncancelable openat. */ +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +extern int __openat_nocancel (int fd, const char *fname, int oflag, + mode_t mode) attribute_hidden; +extern int __openat64_nocancel (int fd, const char *fname, int oflag, + mode_t mode) attribute_hidden; +#else +# define __openat_nocancel(fd, fname, oflag, mode) \ + openat (fd, fname, oflag, mode) +# define __openat64_nocancel(fd, fname, oflag, mode) \ + openat64 (fd, fname, oflag, mode) +#endif + +#define openat_not_cancel(fd, fname, oflag, mode) \ + __openat_nocancel (fd, fname, oflag, mode) +#define openat_not_cancel_3(fd, fname, oflag) \ + __openat_nocancel (fd, fname, oflag, 0) +#define openat64_not_cancel(fd, fname, oflag, mode) \ + __openat64_nocancel (fd, fname, oflag, mode) +#define openat64_not_cancel_3(fd, fname, oflag) \ + __openat64_nocancel (fd, fname, oflag, 0) /* Uncancelable close. */ #define close_not_cancel(fd) \ @@ -60,3 +89,25 @@ # define waitpid_not_cancel(pid, stat_loc, options) \ INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL) #endif + +/* Uncancelable pause. */ +#ifdef __NR_pause +# define pause_not_cancel() \ + INLINE_SYSCALL (pause, 0) +#else +# define pause_not_cancel() \ + __pause_nocancel () +#endif + +/* Uncancelable nanosleep. */ +#ifdef __NR_nanosleep +# define nanosleep_not_cancel(requested_time, remaining) \ + INLINE_SYSCALL (nanosleep, 2, requested_time, remaining) +#else +# define nanosleep_not_cancel(requested_time, remaining) \ + __nanosleep_nocancel (requested_time, remaining) +#endif + +/* Uncancelable sigsuspend. */ +#define sigsuspend_not_cancel(set) \ + __sigsuspend_nocancel (set) diff --git a/libpthread/linuxthreads/sysdeps/pthread/posix-timer.h b/libpthread/linuxthreads/sysdeps/pthread/posix-timer.h index 5486f7d6a..4ac64d9ac 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/posix-timer.h +++ b/libpthread/linuxthreads/sysdeps/pthread/posix-timer.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <limits.h> #include <signal.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c b/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c index 15aeb2166..86d4c84e9 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c @@ -23,8 +23,7 @@ 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + see <http://www.gnu.org/licenses/>. */ /* This file is compiled into assembly code which is then munged by a sed script into two files: crti.s and crtn.s. diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h b/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h index 258e1fc23..6d8663dcb 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h +++ b/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _PTHREAD_FUNCTIONS_H #define _PTHREAD_FUNCTIONS_H 1 @@ -72,10 +71,12 @@ struct pthread_functions void (*ptr_pthread_cleanup_upto) (__jmp_buf target, char *targetframe); pthread_descr (*ptr_pthread_thread_self) (void); +#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__ int (*ptr_pthread_internal_tsd_set) (int key, const void *pointer); void * (*ptr_pthread_internal_tsd_get) (int key); void ** __attribute__ ((__const__)) (*ptr_pthread_internal_tsd_address) (int key); +#endif int (*ptr_pthread_sigaction) (int sig, const struct sigaction * act, struct sigaction *oact); int (*ptr_pthread_sigwait) (const sigset_t *set, int *sig); @@ -95,4 +96,6 @@ struct pthread_functions /* Variable in libc.so. */ extern struct pthread_functions __libc_pthread_functions attribute_hidden; +extern int * __libc_pthread_init (const struct pthread_functions *functions); + #endif /* pthread-functions.h */ diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h index 0fa3be131..df01c111f 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h +++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h @@ -161,9 +161,9 @@ enum if ATTR is NULL), and call function START_ROUTINE with given arguments ARG. */ extern int pthread_create (pthread_t *__restrict __threadp, - __const pthread_attr_t *__restrict __attr, + const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), - void *__restrict __arg) __THROW; + void *__restrict __arg) __THROWNL; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self (void) __THROW; @@ -201,16 +201,16 @@ extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) __THROW; /* Return in *DETACHSTATE the `detachstate' attribute in *ATTR. */ -extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, int *__detachstate) __THROW; /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, - __const struct sched_param *__restrict + const struct sched_param *__restrict __param) __THROW; /* Return in *PARAM the scheduling parameters of *ATTR. */ -extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __THROW; @@ -220,7 +220,7 @@ extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) __THROW; /* Return in *POLICY the scheduling policy of *ATTR. */ -extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __THROW; @@ -229,7 +229,7 @@ extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) __THROW; /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ -extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __THROW; @@ -238,7 +238,7 @@ extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) __THROW; /* Return in *SCOPE the scheduling contention scope of *ATTR. */ -extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __scope) __THROW; #ifdef __USE_UNIX98 @@ -247,11 +247,12 @@ extern int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize) __THROW; /* Get the size of the guard area at the bottom of the thread. */ -extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict +extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, size_t *__restrict __guardsize) __THROW; #endif +#if 0 /* uClibc: deprecated stuff disabled. def __UCLIBC_SUSV3_LEGACY__ */ /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The @@ -260,9 +261,10 @@ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __THROW; /* Return the previously set address for the stack. */ -extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __THROW; +#endif #ifdef __USE_XOPEN2K /* The following two interfaces are intended to replace the last two. They @@ -272,7 +274,7 @@ extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __THROW; /* Return the previously set address for the stack. */ -extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __THROW; #endif @@ -284,13 +286,13 @@ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __THROW; /* Return the currently used minimal stack size. */ -extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __THROW; #ifdef __USE_GNU /* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread TH. It shall be called on unitialized ATTR + already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW; #endif @@ -300,7 +302,7 @@ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW; /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam (pthread_t __target_thread, int __policy, - __const struct sched_param *__param) + const struct sched_param *__param) __THROW; /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ @@ -322,27 +324,27 @@ extern int pthread_setconcurrency (int __level) __THROW; /* Initialize MUTEX using attributes in *MUTEX_ATTR, or use the default values if later is NULL. */ extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, - __const pthread_mutexattr_t *__restrict + const pthread_mutexattr_t *__restrict __mutex_attr) __THROW; /* Destroy MUTEX. */ extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW; /* Try to lock MUTEX. */ -extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW; +extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROWNL; /* Wait until lock for MUTEX becomes available and lock it. */ -extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW; +extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROWNL; #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, - __const struct timespec *__restrict - __abstime) __THROW; + const struct timespec *__restrict + __abstime) __THROWNL; #endif /* Unlock MUTEX. */ -extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW; +extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROWNL; /* Functions for handling mutex attributes. */ @@ -355,7 +357,7 @@ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW; extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW; /* Get the process-shared flag of the mutex attribute ATTR. */ -extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * +extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW; @@ -371,7 +373,7 @@ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __THROW; /* Return in *KIND the mutex kind attribute in *ATTR. */ -extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict +extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __THROW; #endif @@ -381,17 +383,17 @@ extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init (pthread_cond_t *__restrict __cond, - __const pthread_condattr_t *__restrict + const pthread_condattr_t *__restrict __cond_attr) __THROW; /* Destroy condition variable COND. */ extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW; /* Wake up one thread waiting for condition variable COND. */ -extern int pthread_cond_signal (pthread_cond_t *__cond) __THROW; +extern int pthread_cond_signal (pthread_cond_t *__cond) __THROWNL; /* Wake up all threads waiting for condition variables COND. */ -extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW; +extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROWNL; /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. */ @@ -404,7 +406,7 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, (00:00:00 GMT, January 1, 1970). */ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, - __const struct timespec *__restrict + const struct timespec *__restrict __abstime); /* Functions for handling condition variable attributes. */ @@ -416,7 +418,7 @@ extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW; extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW; /* Get the process-shared flag of the condition variable attribute ATTR. */ -extern int pthread_condattr_getpshared (__const pthread_condattr_t * +extern int pthread_condattr_getpshared (const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW; @@ -431,40 +433,40 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, - __const pthread_rwlockattr_t *__restrict + const pthread_rwlockattr_t *__restrict __attr) __THROW; /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW; /* Acquire read lock for RWLOCK. */ -extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROW; +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROWNL; /* Try to acquire read lock for RWLOCK. */ -extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW; +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL; # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, - __const struct timespec *__restrict - __abstime) __THROW; + const struct timespec *__restrict + __abstime) __THROWNL; # endif /* Acquire write lock for RWLOCK. */ -extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROW; +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROWNL; /* Try to acquire write lock for RWLOCK. */ -extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW; +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL; # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, - __const struct timespec *__restrict - __abstime) __THROW; + const struct timespec *__restrict + __abstime) __THROWNL; # endif /* Unlock RWLOCK. */ -extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROW; +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROWNL; /* Functions for handling read-write lock attributes. */ @@ -476,7 +478,7 @@ extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW; extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW; /* Return current setting of process-shared attribute of ATTR in PSHARED. */ -extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW; @@ -485,7 +487,7 @@ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) __THROW; /* Return current setting of reader/writer preference. */ -extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr, +extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *__attr, int *__pref) __THROW; /* Set reader/write preference. */ @@ -506,19 +508,19 @@ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW; /* Wait until spinlock LOCK is retrieved. */ -extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROW; +extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROWNL; /* Try to lock spinlock LOCK. */ -extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROW; +extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROWNL; /* Release spinlock LOCK. */ -extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW; +extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROWNL; /* Barriers are a also a new feature in 1003.1j-2000. */ extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, - __const pthread_barrierattr_t *__restrict + const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __THROW; extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __THROW; @@ -527,14 +529,14 @@ extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __THROW; extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __THROW; -extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW; extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) __THROW; -extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROW; +extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROWNL; #endif @@ -554,7 +556,7 @@ extern int pthread_key_delete (pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific (pthread_key_t __key, - __const void *__pointer) __THROW; + const void *__pointer) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific (pthread_key_t __key) __THROW; diff --git a/libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c b/libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c index a2a56b8d9..ee5522036 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c +++ b/libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c @@ -19,13 +19,6 @@ #include "pthread.h" #include "internals.h" -/* These functions are not declared anywhere since they shouldn't be - used at another place but here. */ -extern void __libc_siglongjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); -extern void __libc_longjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); - #ifdef SHARED void siglongjmp (sigjmp_buf env, int val) { diff --git a/libpthread/linuxthreads/sysdeps/pthread/res-state.c b/libpthread/linuxthreads/sysdeps/pthread/res-state.c index 016e20b4e..6b4354972 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/res-state.c +++ b/libpthread/linuxthreads/sysdeps/pthread/res-state.c @@ -12,28 +12,27 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <resolv.h> #include <tls.h> #include <linuxthreads/internals.h> #include <sysdep-cancel.h> -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ # undef _res extern struct __res_state _res; #endif /* When threaded, _res may be a per-thread variable. */ struct __res_state * -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ weak_const_function #endif __res_state (void) { -#if ! USE___THREAD +#ifndef __UCLIBC_HAS_TLS__ if (! SINGLE_THREAD_P) { pthread_descr self = thread_self(); diff --git a/libpthread/linuxthreads/sysdeps/pthread/sigaction.c b/libpthread/linuxthreads/sysdeps/pthread/sigaction.c index 0a0a9e29f..eecb8c395 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/sigaction.c +++ b/libpthread/linuxthreads/sysdeps/pthread/sigaction.c @@ -13,9 +13,10 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Somebody please explain what's going on here. --vda */ /* This is tricky. GCC doesn't like #include_next in the primary source file and even if it did, the first #include_next is this diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_create.c b/libpthread/linuxthreads/sysdeps/pthread/timer_create.c index 7f7e886c8..36fce3567 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_create.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_create.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_delete.c b/libpthread/linuxthreads/sysdeps/pthread/timer_delete.c index 48ba1f272..a529d7392 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_delete.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_delete.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c b/libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c index f3e22215b..6d753e30d 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c b/libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c index 723a61632..6bd2b84e2 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_routines.c b/libpthread/linuxthreads/sysdeps/pthread/timer_routines.c index 25b4630ee..9f6096ba5 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_routines.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_routines.c @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/timer_settime.c b/libpthread/linuxthreads/sysdeps/pthread/timer_settime.c index 592b5271b..da0908b0b 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/timer_settime.c +++ b/libpthread/linuxthreads/sysdeps/pthread/timer_settime.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/tst-timer.c b/libpthread/linuxthreads/sysdeps/pthread/tst-timer.c index 7417bcd5f..0a679d9c6 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/tst-timer.c +++ b/libpthread/linuxthreads/sysdeps/pthread/tst-timer.c @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> diff --git a/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h b/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h index 92619e5b4..b957dedc9 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h +++ b/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h @@ -6,7 +6,7 @@ #include <bits/uClibc_page.h> #ifdef IS_IN_libpthread -#include "kernel-features.h" +#include <bits/kernel-features.h> #ifndef __GLIBC_HAVE_LONG_LONG # define __GLIBC_HAVE_LONG_LONG @@ -42,8 +42,6 @@ extern int __cxa_atexit (void (*func) (void *), void *arg, void *d); /* Use a funky version in a probably vein attempt at preventing gdb * from dlopen()'ing glibc's libthread_db library... */ -#define STRINGIFY(s) STRINGIFY2 (s) -#define STRINGIFY2(s) #s -#define VERSION STRINGIFY(__UCLIBC_MAJOR__) "." STRINGIFY(__UCLIBC_MINOR__) "." STRINGIFY(__UCLIBC_SUBLEVEL__) +#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__) #endif diff --git a/libpthread/linuxthreads/sysdeps/s390/pspinlock.c b/libpthread/linuxthreads/sysdeps/s390/pspinlock.c deleted file mode 100644 index 98be504e1..000000000 --- a/libpthread/linuxthreads/sysdeps/s390/pspinlock.c +++ /dev/null @@ -1,91 +0,0 @@ -/* POSIX spinlock implementation. S/390 version. - Copyright (C) 2000, 2004 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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. */ - -#include <errno.h> -#include <pthread.h> -#include "internals.h" - -/* This implementation is similar to the one used in the Linux kernel. - But the kernel is byte instructions for the memory access. This is - faster but unusable here. The problem is that only 128 - threads/processes could use the spinlock at the same time. If (by - a design error in the program) a thread/process would hold the - spinlock for a time long enough to accumulate 128 waiting - processes, the next one will find a positive value in the spinlock - and assume it is unlocked. We cannot accept that. */ - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__(" basr 1,0\n" - "0: slr 0,0\n" - " cs 0,1,%1\n" - " jl 0b\n" - : "=m" (*lock) - : "m" (*lock) : "0", "1", "cc" ); - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - int oldval; - - __asm__ __volatile__(" slr %1,%1\n" - " basr 1,0\n" - "0: cs %1,1,%0" - : "=m" (*lock), "=&d" (oldval) - : "m" (*lock) : "1", "cc" ); - return oldval == 0 ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__(" xc 0(4,%0),0(%0)\n" - " bcr 15,0" - : : "a" (lock) : "memory" ); - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/s390/s390-32/pt-machine.h b/libpthread/linuxthreads/sysdeps/s390/s390-32/pt-machine.h deleted file mode 100644 index d52d600ad..000000000 --- a/libpthread/linuxthreads/sysdeps/s390/s390-32/pt-machine.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - S390 version. - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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. */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - -/* For multiprocessor systems, we want to ensure all memory accesses - are completed before we reset a lock. On other systems, we still - need to make sure that the compiler has flushed everything to memory. */ -#define MEMORY_BARRIER() __asm__ __volatile__ ("bcr 15,0" : : : "memory") - -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__( - " la 1,%1\n" - " lhi 0,1\n" - " l %0,%1\n" - "0: cs %0,0,0(1)\n" - " jl 0b" - : "=&d" (ret), "+m" (*spinlock) - : : "0", "1", "cc"); - - return ret; -} - - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME stack_pointer -register char * stack_pointer __asm__ ("15"); - -#ifdef USE_TLS -/* Return the thread descriptor for the current thread. */ -# define THREAD_SELF ((pthread_descr) __builtin_thread_pointer ()) - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) __builtin_set_thread_pointer (descr) -#else -/* Return the thread descriptor for the current thread. - S/390 registers uses access register 0 as "thread register". */ -#define THREAD_SELF ({ \ - register pthread_descr __self; \ - __asm__ ("ear %0,%%a0" : "=d" (__self) ); \ - __self; \ -}) - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) ({ \ - __asm__ ("sar %%a0,%0" : : "d" (descr) ); \ -}) -#endif - -/* Access to data in the thread descriptor is easy. */ -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* We want the OS to assign stack addresses. */ -#define FLOATING_STACKS 1 - -/* Maximum size of the stack if the rlimit is unlimited. */ -#define ARCH_STACK_MAX_SIZE 8*1024*1024 - -/* Compare-and-swap for semaphores. */ - -#define HAS_COMPARE_AND_SWAP - -PT_EI int -__compare_and_swap(long int *p, long int oldval, long int newval) -{ - int retval; - - __asm__ __volatile__( - " la 1,%1\n" - " lr 0,%2\n" - " cs 0,%3,0(1)\n" - " ipm %0\n" - " srl %0,28\n" - "0:" - : "=&d" (retval), "+m" (*p) - : "d" (oldval) , "d" (newval) - : "cc", "0", "1" ); - return retval == 0; -} - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/s390/s390-64/pt-machine.h b/libpthread/linuxthreads/sysdeps/s390/s390-64/pt-machine.h deleted file mode 100644 index 187e1f872..000000000 --- a/libpthread/linuxthreads/sysdeps/s390/s390-64/pt-machine.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - 64 bit S/390 version. - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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. */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - -/* For multiprocessor systems, we want to ensure all memory accesses - are completed before we reset a lock. On other systems, we still - need to make sure that the compiler has flushed everything to memory. */ -#define MEMORY_BARRIER() __asm__ __volatile__ ("bcr 15,0" : : : "memory") - -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__( - " la 1,%1\n" - " lhi 0,1\n" - " l %0,%1\n" - "0: cs %0,0,0(1)\n" - " jl 0b" - : "=&d" (ret), "+m" (*spinlock) - : : "0", "1", "cc"); - - return ret; -} - - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME stack_pointer -register char * stack_pointer __asm__ ("15"); - -#ifdef USE_TLS -/* Return the thread descriptor for the current thread. */ -# define THREAD_SELF ((pthread_descr) __builtin_thread_pointer ()) - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) __builtin_set_thread_pointer (descr) -#else -/* Return the thread descriptor for the current thread. - 64 bit S/390 uses access register 0 and 1 as "thread register". */ -#define THREAD_SELF ({ \ - register pthread_descr __self; \ - __asm__ (" ear %0,%%a0\n" \ - " sllg %0,%0,32\n" \ - " ear %0,%%a1\n" \ - : "=d" (__self) ); \ - __self; \ -}) - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) ({ \ - __asm__ (" sar %%a1,%0\n" \ - " srlg 0,%0,32\n" \ - " sar %%a0,0\n" \ - : : "d" (descr) : "0" ); \ -}) -#endif - -/* Access to data in the thread descriptor is easy. */ -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* We want the OS to assign stack addresses. */ -#define FLOATING_STACKS 1 - -/* Maximum size of the stack if the rlimit is unlimited. */ -#define ARCH_STACK_MAX_SIZE 8*1024*1024 - -/* Compare-and-swap for semaphores. */ - -#define HAS_COMPARE_AND_SWAP - -PT_EI int -__compare_and_swap(long int *p, long int oldval, long int newval) -{ - int retval; - - __asm__ __volatile__( - " lgr 0,%2\n" - " csg 0,%3,%1\n" - " ipm %0\n" - " srl %0,28\n" - "0:" - : "=&d" (retval), "+m" (*p) - : "d" (oldval) , "d" (newval) - : "cc", "0"); - return retval == 0; -} - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/s390/tcb-offsets.sym b/libpthread/linuxthreads/sysdeps/s390/tcb-offsets.sym deleted file mode 100644 index aee6be257..000000000 --- a/libpthread/linuxthreads/sysdeps/s390/tcb-offsets.sym +++ /dev/null @@ -1,4 +0,0 @@ -#include <sysdep.h> -#include <tls.h> - -MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) diff --git a/libpthread/linuxthreads/sysdeps/s390/tls.h b/libpthread/linuxthreads/sysdeps/s390/tls.h deleted file mode 100644 index f750f2d6f..000000000 --- a/libpthread/linuxthreads/sysdeps/s390/tls.h +++ /dev/null @@ -1,145 +0,0 @@ -/* Definitions for thread-local data handling. linuxthreads/s390 version. - Copyright (C) 2002, 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 - 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 _TLS_H -#define _TLS_H - -#ifndef __ASSEMBLER__ - -# include <pt-machine.h> -# include <stdbool.h> -# include <stddef.h> - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - -typedef struct -{ - void *tcb; /* Pointer to the TCB. Not necessary the - thread descriptor used by libpthread. */ - dtv_t *dtv; - void *self; /* Pointer to the thread descriptor. */ - int multiple_threads; -} tcbhead_t; - -#else /* __ASSEMBLER__ */ -# include <tcb-offsets.h> -#endif /* __ASSEMBLER__ */ - -/* TLS is always supported if the tools support it. There are no - kernel dependencies. To avoid bothering with the TLS support code - at all, use configure --without-tls. - - We need USE_TLS to be consistently defined, for ldsodefs.h - conditionals. */ - -#ifdef HAVE_TLS_SUPPORT - -/* Signal that TLS support is available. */ -# define USE_TLS 1 - -# ifndef __ASSEMBLER__ -/* Get system call information. */ -# include <sysdep.h> - - -/* Get the thread descriptor definition. */ -# include <linuxthreads/descr.h> - -/* This is the size of the initial TCB. */ -# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) - -/* The TCB can have any size and the memory following the address the - thread pointer points to is unspecified. Allocate the TCB there. */ -# define TLS_TCB_AT_TP 1 - - -/* Install the dtv pointer. The pointer passed is to the element with - index -1 which contain the length. */ -# define INSTALL_DTV(descr, dtvp) \ - ((tcbhead_t *) (descr))->dtv = (dtvp) + 1 - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(dtv) \ - (((tcbhead_t *) __builtin_thread_pointer ())->dtv = (dtv)) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(descr) \ - (((tcbhead_t *) (descr))->dtv) - -/* Code to initially initialize the thread pointer. This might need - special attention since 'errno' is not yet available and if the - operation can cause a failure 'errno' must not be touched. - - The value of this macro is null if successful, or an error string. */ -# define TLS_INIT_TP(descr, secondcall) \ - ({ \ - void *_descr = (descr); \ - tcbhead_t *head = _descr; \ - \ - head->tcb = _descr; \ - /* For now the thread descriptor is at the same address. */ \ - head->self = _descr; \ - \ - __builtin_set_thread_pointer (_descr); \ - NULL; \ - }) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - (((tcbhead_t *) __builtin_thread_pointer ())->dtv) - -# endif /* __ASSEMBLER__ */ - -#else /* HAVE_TLS_SUPPORT && (FLOATING_STACKS || !IS_IN_libpthread) */ - -# ifndef __ASSEMBLER__ - -/* Get the thread descriptor definition. */ -# include <linuxthreads/descr.h> - -# define NONTLS_INIT_TP \ - do { \ - static const tcbhead_t nontls_init_tp \ - = { .multiple_threads = 0 }; \ - INIT_THREAD_SELF (&nontls_init_tp, 0); \ - } while (0) - -# endif /* __ASSEMBLER__ */ - -#endif /* HAVE_TLS_SUPPORT && (FLOATING_STACKS || !IS_IN_libpthread) */ - -#endif /* tls.h */ diff --git a/libpthread/linuxthreads/sysdeps/sh/pspinlock.c b/libpthread/linuxthreads/sysdeps/sh/pspinlock.c index c4e333a74..2f039de53 100644 --- a/libpthread/linuxthreads/sysdeps/sh/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sh/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/sh/pt-machine.h b/libpthread/linuxthreads/sysdeps/sh/pt-machine.h index 793f80b2d..7d1484e71 100644 --- a/libpthread/linuxthreads/sysdeps/sh/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/sh/pt-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym b/libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym index 328eb0573..6324a016c 100644 --- a/libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym +++ b/libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym @@ -2,7 +2,7 @@ #include <tls.h> -- -#ifdef USE_TLS +#ifdef __UCLIBC_HAS_TLS__ MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads) TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) #else diff --git a/libpthread/linuxthreads/sysdeps/sh/tls.h b/libpthread/linuxthreads/sysdeps/sh/tls.h index 350d129db..512e3181e 100644 --- a/libpthread/linuxthreads/sysdeps/sh/tls.h +++ b/libpthread/linuxthreads/sysdeps/sh/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c index 72a9af5b1..4de152be3 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c @@ -1,14 +1,87 @@ -#include <features.h> -#include <bits/wordsize.h> +/* POSIX spinlock implementation. SPARC32 version. + Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. -#if __WORDSIZE == 32 + 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. -# if defined(__CONFIG_SPARC_V9B__) -# include "sparc32/sparcv9b/pspinlock.c" -# else -# include "sparc32/pspinlock.c" -# endif + 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. -#else -# include "sparc64/pspinlock.c" -#endif + 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, see <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <pthread.h> +#include "internals.h" + +/* This implementation is similar to the one used in the Linux kernel. */ +int +__pthread_spin_lock (pthread_spinlock_t *lock) +{ + __asm__ __volatile__ + ("1: ldstub [%0], %%g2\n" + " orcc %%g2, 0x0, %%g0\n" + " bne,a 2f\n" + " ldub [%0], %%g2\n" + ".subsection 2\n" + "2: orcc %%g2, 0x0, %%g0\n" + " bne,a 2b\n" + " ldub [%0], %%g2\n" + " b,a 1b\n" + ".previous" + : /* no outputs */ + : "r" (lock) + : "g2", "memory", "cc"); + return 0; +} +weak_alias (__pthread_spin_lock, pthread_spin_lock) + + +int +__pthread_spin_trylock (pthread_spinlock_t *lock) +{ + int result; + __asm__ __volatile__ + ("ldstub [%1], %0" + : "=r" (result) + : "r" (lock) + : "memory"); + return result == 0 ? 0 : EBUSY; +} +weak_alias (__pthread_spin_trylock, pthread_spin_trylock) + + +int +__pthread_spin_unlock (pthread_spinlock_t *lock) +{ + *lock = 0; + return 0; +} +weak_alias (__pthread_spin_unlock, pthread_spin_unlock) + + +int +__pthread_spin_init (pthread_spinlock_t *lock, int pshared) +{ + /* We can ignore the `pshared' parameter. Since we are busy-waiting + all processes which can access the memory location `lock' points + to can use the spinlock. */ + *lock = 0; + return 0; +} +weak_alias (__pthread_spin_init, pthread_spin_init) + + +int +__pthread_spin_destroy (pthread_spinlock_t *lock) +{ + /* Nothing to do. */ + return 0; +} +weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h index ab90810f1..d502c759a 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h @@ -1,8 +1,82 @@ -#include <features.h> -#include <bits/wordsize.h> +/* Machine-dependent pthreads configuration and inline functions. + sparc version. + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson <rth@tamu.edu>. -#if __WORDSIZE == 32 -# include "sparc32/pt-machine.h" -#else -# include "sparc64/pt-machine.h" + 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, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#ifndef PT_EI +# define PT_EI __extern_always_inline #endif + +extern long int testandset (int *spinlock); +extern int __compare_and_swap (long int *p, long int oldval, long int newval); + +/* Spinlock implementation; required. */ +PT_EI long int +testandset (int *spinlock) +{ + int ret; + + __asm__ __volatile__("ldstub %1,%0" + : "=r"(ret), "=m"(*spinlock) + : "m"(*spinlock)); + + return ret; +} + + +/* Memory barrier; default is to do nothing */ +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory") + + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64)) +register char *stack_pointer __asm__("%sp"); + + +/* Registers %g6 and %g7 are reserved by the ABI for "system use". + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */ +struct _pthread_descr_struct; +register struct _pthread_descr_struct *__thread_self __asm__("%g7"); + +/* Return the thread descriptor for the current thread. */ +#define THREAD_SELF __thread_self + +/* Initialize the thread-unique value. */ +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr)) + +/* Access to data in the thread descriptor is easy. */ +#define THREAD_GETMEM(descr, member) \ + ((void) sizeof (descr), THREAD_SELF->member) +#define THREAD_GETMEM_NC(descr, member) \ + ((void) sizeof (descr), THREAD_SELF->member) +#define THREAD_SETMEM(descr, member, value) \ + ((void) sizeof (descr), THREAD_SELF->member = (value)) +#define THREAD_SETMEM_NC(descr, member, value) \ + ((void) sizeof (descr), THREAD_SELF->member = (value)) + +/* We want the OS to assign stack addresses. */ +#define FLOATING_STACKS 1 + +/* Maximum size of the stack if the rlimit is unlimited. */ +#define ARCH_STACK_MAX_SIZE 8*1024*1024 + +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c deleted file mode 100644 index 812c7ff2a..000000000 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c +++ /dev/null @@ -1,88 +0,0 @@ -/* POSIX spinlock implementation. SPARC32 version. - Copyright (C) 2000 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. */ - -#include <errno.h> -#include <pthread.h> -#include "internals.h" - -/* This implementation is similar to the one used in the Linux kernel. */ -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ - ("1: ldstub [%0], %%g2\n" - " orcc %%g2, 0x0, %%g0\n" - " bne,a 2f\n" - " ldub [%0], %%g2\n" - ".subsection 2\n" - "2: orcc %%g2, 0x0, %%g0\n" - " bne,a 2b\n" - " ldub [%0], %%g2\n" - " b,a 1b\n" - ".previous" - : /* no outputs */ - : "r" (lock) - : "g2", "memory", "cc"); - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - int result; - __asm__ __volatile__ - ("ldstub [%1], %0" - : "=r" (result) - : "r" (lock) - : "memory"); - return result == 0 ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h deleted file mode 100644 index 43c05f2a6..000000000 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - sparc version. - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson <rth@tamu.edu>. - - 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. */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__("ldstub %1,%0" - : "=r"(ret), "=m"(*spinlock) - : "m"(*spinlock)); - - return ret; -} - - -/* Memory barrier; default is to do nothing */ -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory") - - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64)) -register char *stack_pointer __asm__("%sp"); - - -/* Registers %g6 and %g7 are reserved by the ABI for "system use". - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */ -struct _pthread_descr_struct; -register struct _pthread_descr_struct *__thread_self __asm__("%g7"); - -/* Return the thread descriptor for the current thread. */ -#define THREAD_SELF __thread_self - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr)) - -/* Access to data in the thread descriptor is easy. */ -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* We want the OS to assign stack addresses. */ -#define FLOATING_STACKS 1 - -/* Maximum size of the stack if the rlimit is unlimited. */ -#define ARCH_STACK_MAX_SIZE 8*1024*1024 - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c deleted file mode 100644 index 7e55df414..000000000 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c +++ /dev/null @@ -1,94 +0,0 @@ -/* POSIX spinlock implementation. SPARC v9 version. - Copyright (C) 2000 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. */ - -#include <errno.h> -#include <pthread.h> -#include "internals.h" - - -/* This implementation is similar to the one used in the Linux kernel. */ -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ - ("1: ldstub [%0], %%g2\n" - " brnz,pn %%g2, 2f\n" - " membar #StoreLoad | #StoreStore\n" - ".subsection 2\n" - "2: ldub [%0], %%g2\n" - " brnz,pt %%g2, 2b\n" - " membar #LoadLoad\n" - " b,a,pt %%xcc, 1b\n" - ".previous" - : /* no outputs */ - : "r" (lock) - : "g2", "memory"); - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - int result; - __asm__ __volatile__ - ("ldstub [%1], %0\n" - "membar #StoreLoad | #StoreStore" - : "=r" (result) - : "r" (lock) - : "memory"); - return result == 0 ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ - ("membar #StoreStore | #LoadStore\n" - "stb %%g0, [%0]" - : - : "r" (lock) - : "memory"); - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c deleted file mode 100644 index e0c350e6b..000000000 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c +++ /dev/null @@ -1,93 +0,0 @@ -/* POSIX spinlock implementation. SPARC64 version. - Copyright (C) 2000 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. */ - -#include <errno.h> -#include <pthread.h> -#include "internals.h" - -/* This implementation is similar to the one used in the Linux kernel. */ -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ - ("1: ldstub [%0], %%g5\n" - " brnz,pn %%g5, 2f\n" - " membar #StoreLoad | #StoreStore\n" - ".subsection 2\n" - "2: ldub [%0], %%g5\n" - " brnz,pt %%g5, 2b\n" - " membar #LoadLoad\n" - " b,a,pt %%xcc, 1b\n" - ".previous" - : /* no outputs */ - : "r" (lock) - : "g5", "memory"); - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - int result; - __asm__ __volatile__ - ("ldstub [%1], %0\n" - "membar #StoreLoad | #StoreStore" - : "=r" (result) - : "r" (lock) - : "memory"); - return result == 0 ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ - ("membar #StoreStore | #LoadStore\n" - "stb %%g0, [%0]" - : - : "r" (lock) - : "memory"); - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h deleted file mode 100644 index 815d70e8d..000000000 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - Sparc v9 version. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson <rth@tamu.edu>. - - 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. */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__("ldstub %1,%0" - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock)); - - return ret; -} - - -/* Memory barrier; default is to do nothing */ -#define MEMORY_BARRIER() \ - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory") -/* Read barrier. */ -#define READ_MEMORY_BARRIER() \ - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory") -/* Write barrier. */ -#define WRITE_MEMORY_BARRIER() \ - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory") - - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128)) -register char *stack_pointer __asm__ ("%sp"); - - -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The - TLS ABI specifies %g7 as the thread pointer. */ -struct _pthread_descr_struct; -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7"); - -/* Return the thread descriptor for the current thread. */ -#define THREAD_SELF __thread_self - -/* Initialize the thread-unique value. */ -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr)) - - -/* Compare-and-swap for semaphores. */ - -#define HAS_COMPARE_AND_SWAP -PT_EI int -__compare_and_swap (long int *p, long int oldval, long int newval) -{ - long int readval; - - __asm__ __volatile__ ("casx [%4], %2, %0" - : "=r"(readval), "=m"(*p) - : "r"(oldval), "m"(*p), "r"(p), "0"(newval)); - MEMORY_BARRIER(); - return readval == oldval; -} - -/* Access to data in the thread descriptor is easy. */ -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* We want the OS to assign stack addresses. */ -#define FLOATING_STACKS 1 - -/* Maximum size of the stack if the rlimit is unlimited. */ -#define ARCH_STACK_MAX_SIZE 32*1024*1024 - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/sparc/tls.h b/libpthread/linuxthreads/sysdeps/sparc/tls.h index 2df97d61e..1e31c2e63 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/tls.h +++ b/libpthread/linuxthreads/sysdeps/sparc/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/.cvsignore b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/.cvsignore deleted file mode 100644 index 7ee8f5969..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -.cvsignore -*.os diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h index f62f7d6e9..3d3d2219f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h @@ -14,12 +14,11 @@ You should have received a copy of the GNU Library 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. */ + see <http://www.gnu.org/licenses/>. */ #include <limits.h> -extern inline int __libc_use_alloca (size_t size) +__extern_always_inline int __libc_use_alloca (size_t size) { return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1) || __libc_alloca_cutoff (size)); diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c index b9ada6417..69bc0d79a 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <signal.h> @@ -70,6 +69,7 @@ __libc_current_sigrtmax (void) strong_alias (__libc_current_sigrtmax, __libc_current_sigrtmax_private) libc_hidden_def (__libc_current_sigrtmax) +#if 0 /* Allocate real-time signal with highest/lowest available priority. Please note that we don't use a lock since we assume this function to be called at program start. */ @@ -85,3 +85,4 @@ __libc_allocate_rtsig (int high) return high ? current_rtmin++ : current_rtmax--; } strong_alias (__libc_allocate_rtsig, __libc_allocate_rtsig_private) +#endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h index 96893c59d..001403a19 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index a2724885e..6d917e7f5 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_H # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S index 91e5c8678..754fc5b1c 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h index 9ea779e0d..8ce43153d 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #ifndef __ASSEMBLER__ @@ -118,7 +117,7 @@ __LABEL($syscall_error) \ # define __local_multiple_threads __libc_multiple_threads # endif -# ifdef PIC +# ifdef __PIC__ # define CENABLE bsr ra, __local_enable_asynccancel !samegp # define CDISABLE bsr ra, __local_disable_asynccancel !samegp # else @@ -130,7 +129,7 @@ __LABEL($syscall_error) \ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P \ __builtin_expect (__local_multiple_threads == 0, 1) -# elif defined(PIC) +# elif defined(__PIC__) # define SINGLE_THREAD_P(reg) ldl reg, __local_multiple_threads(gp) !gprel # else # define SINGLE_THREAD_P(reg) \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S index cfaae1060..80fdcc6fb 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> @@ -30,7 +29,7 @@ __vfork: #ifdef SHARED ldq t0, __libc_pthread_functions(gp) !gprel - bne t0, HIDDEN_JUMPTARGET (__fork) !samegp + bne t0, HIDDEN_JUMPTARGET (fork) !samegp #else .weak pthread_create ldq t0, pthread_create(gp) !literal @@ -50,7 +49,7 @@ $do_fork: cfi_adjust_cfa_offset(16) stq ra, 0(sp) cfi_offset(ra, -16) - jsr ra, HIDDEN_JUMPTARGET (__fork) + jsr ra, HIDDEN_JUMPTARGET (fork) ldgp gp, 0(ra) ldq ra, 0(sp) addq sp, 16, sp diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h new file mode 100644 index 000000000..2c1eba65f --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h @@ -0,0 +1,129 @@ +/* Copyright (C) 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Phil Blundell <pb@nexus.co.uk>, 2003. + + 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, see + <http://www.gnu.org/licenses/>. */ + +#include <tls.h> +#include <pt-machine.h> +#ifndef __ASSEMBLER__ +# include <linuxthreads/internals.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread + +/* We push lr onto the stack, so we have to use ldmib instead of ldmia + to find the saved arguments. */ +# ifdef __PIC__ +# undef DOARGS_5 +# undef DOARGS_6 +# undef DOARGS_7 +# define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $8]; +# define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmib ip, {r4, r5}; +# define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmib ip, {r4, r5, r6}; +# endif + +# undef PSEUDO_RET +# define PSEUDO_RET \ + ldrcc pc, [sp], $4; \ + ldr lr, [sp], $4; \ + b PLTJMP(SYSCALL_ERROR) + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .section ".text"; \ + PSEUDO_PROLOGUE; \ + ENTRY (name); \ + SINGLE_THREAD_P; \ + bne .Lpseudo_cancel; \ + DO_CALL (syscall_name, args); \ + cmn r0, $4096; \ + RETINSTR(cc, lr); \ + b PLTJMP(SYSCALL_ERROR); \ + .Lpseudo_cancel: \ + str lr, [sp, $-4]!; \ + DOCARGS_##args; /* save syscall args around CENABLE. */ \ + CENABLE; \ + mov ip, r0; /* put mask in safe place. */ \ + UNDOCARGS_##args; /* restore syscall args. */ \ + swi SYS_ify (syscall_name); /* do the call. */ \ + str r0, [sp, $-4]!; /* save syscall return value. */ \ + mov r0, ip; /* get mask back. */ \ + CDISABLE; \ + ldr r0, [sp], $4; /* retrieve return value. */ \ + UNDOC2ARGS_##args; /* fix register damage. */ \ + cmn r0, $4096; + +# define DOCARGS_0 +# define UNDOCARGS_0 +# define UNDOC2ARGS_0 + +# define DOCARGS_1 str r0, [sp, #-4]!; +# define UNDOCARGS_1 ldr r0, [sp], #4; +# define UNDOC2ARGS_1 + +# define DOCARGS_2 str r1, [sp, #-4]!; str r0, [sp, #-4]!; +# define UNDOCARGS_2 ldr r0, [sp], #4; ldr r1, [sp], #4; +# define UNDOC2ARGS_2 + +# define DOCARGS_3 str r2, [sp, #-4]!; str r1, [sp, #-4]!; str r0, [sp, #-4]!; +# define UNDOCARGS_3 ldr r0, [sp], #4; ldr r1, [sp], #4; ldr r2, [sp], #4 +# define UNDOC2ARGS_3 + +# define DOCARGS_4 stmfd sp!, {r0-r3} +# define UNDOCARGS_4 ldmfd sp!, {r0-r3} +# define UNDOC2ARGS_4 + +# define DOCARGS_5 stmfd sp!, {r0-r3} +# define UNDOCARGS_5 ldmfd sp, {r0-r3}; str r4, [sp, #-4]!; ldr r4, [sp, #24] +# define UNDOC2ARGS_5 ldr r4, [sp], #20 + +# ifdef IS_IN_libpthread +# define CENABLE bl PLTJMP(__pthread_enable_asynccancel) +# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel) +# define __local_multiple_threads __pthread_multiple_threads +# else +# define CENABLE bl PLTJMP(__libc_enable_asynccancel) +# define CDISABLE bl PLTJMP(__libc_disable_asynccancel) +# define __local_multiple_threads __libc_multiple_threads +# endif + +# ifndef __ASSEMBLER__ +extern int __local_multiple_threads attribute_hidden; +# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) +# else +# if !defined __PIC__ +# define SINGLE_THREAD_P \ + ldr ip, =__local_multiple_threads; \ + ldr ip, [ip]; \ + teq ip, #0; +# define PSEUDO_PROLOGUE +# else +# define SINGLE_THREAD_P \ + ldr ip, 1b; \ +2: \ + ldr ip, [pc, ip]; \ + teq ip, #0; +# define PSEUDO_PROLOGUE \ + 1: .word __local_multiple_threads - 2f - 8; +# endif +# endif + +#elif !defined __ASSEMBLER__ + +/* This code should never be used but we define it anyhow. */ +# define SINGLE_THREAD_P (1) + +#endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S index 6dfeca86d..3d9e49a0f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S @@ -1,6 +1,6 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com> + Contributed by Philip Blundell <philb@gnu.org>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,13 +13,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include <kernel-features.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -27,43 +27,51 @@ and the process ID of the new process to the old process. */ ENTRY (__vfork) - basr %r1,0 -0: + +#ifdef __NR_vfork + #ifdef SHARED - al %r1,4f-0b(%r1) - l %r1,0(%r1) - ltr %r1,%r1 + ldr ip, 1f + ldr r0, 2f +3: add ip, pc, ip + ldr r0, [ip, r0] #else - icm %r1,15,4f-0b(%r1) + ldr r0, 1f #endif - jne 1f + movs r0, r0 + bne HIDDEN_JUMPTARGET (fork) - /* Do vfork system call. */ - svc SYS_ify (vfork) + DO_CALL (vfork, 0) + cmn a1, #4096 + RETINSTR(cc, lr) + +#ifndef __ASSUME_VFORK_SYSCALL + /* Check if vfork syscall is known at all. */ + cmn a1, #ENOSYS + bne PLTJMP(C_SYMBOL_NAME(__syscall_error)) +#endif - /* Check for error. */ - lhi %r4,-4095 - clr %r2,%r4 - jnl SYSCALL_ERROR_LABEL +#endif + +#ifndef __ASSUME_VFORK_SYSCALL + /* If we don't have vfork, fork is close enough. */ + DO_CALL (fork, 0) + cmn a1, #4096 + RETINSTR(cc, lr) +#elif !defined __NR_vfork +# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined" +#endif + b PLTJMP(C_SYMBOL_NAME(__syscall_error)) - /* Normal return. */ - br %r14 -1: - basr %r1,0 -2: - al %r1,3f-2b(%r1) - br %r1 -3: - .long HIDDEN_JUMPTARGET(__fork)-2b -4: #ifdef SHARED - .long __libc_pthread_functions-0b +1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8 +2: .word __libc_pthread_functions(GOTOFF) #else .weak pthread_create - .long pthread_create +1: .word pthread_create #endif -PSEUDO_END(__vfork) +PSEUDO_END (__vfork) libc_hidden_def (__vfork) weak_alias (__vfork, vfork) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c index 9fa912b90..cae12182f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <unistd.h> @@ -22,52 +21,19 @@ #include <sysdep.h> #include <alloca.h> #include <sys/syscall.h> -#include <bp-checks.h> - -extern int __syscall_execve (const char *__unbounded file, - char *__unbounded const *__unbounded argv, - char *__unbounded const *__unbounded envp); -extern void __pthread_kill_other_threads_np (void); -weak_extern (__pthread_kill_other_threads_np) +extern int __syscall_execve(const char *file, + char *const *argv, + char *const *envp); +extern void __pthread_kill_other_threads_np(void); +weak_extern(__pthread_kill_other_threads_np) int -__execve (file, argv, envp) - const char *file; - char *const argv[]; - char *const envp[]; +__execve(const char *file, char *const argv[], char *const envp[]) { - /* If this is a threaded application kill all other threads. */ - if (__pthread_kill_other_threads_np) - __pthread_kill_other_threads_np (); -#if __BOUNDED_POINTERS__ - { - char *const *v; - int i; - char *__unbounded *__unbounded ubp_argv; - char *__unbounded *__unbounded ubp_envp; - char *__unbounded *__unbounded ubp_v; - - for (v = argv; *v; v++) - ; - i = v - argv + 1; - ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i); - for (v = argv, ubp_v = ubp_argv; --i; v++, ubp_v++) - *ubp_v = CHECK_STRING (*v); - *ubp_v = 0; - - for (v = envp; *v; v++) - ; - i = v - envp + 1; - ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i); - for (v = envp, ubp_v = ubp_envp; --i; v++, ubp_v++) - *ubp_v = CHECK_STRING (*v); - *ubp_v = 0; - - return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp); - } -#else - return INLINE_SYSCALL (execve, 3, file, argv, envp); -#endif + /* If this is a threaded application kill all other threads. */ + if (__pthread_kill_other_threads_np) + __pthread_kill_other_threads_np(); + return INLINE_SYSCALL(execve, 3, file, argv, envp); } -weak_alias (__execve, execve) +weak_alias(__execve, execve) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c index e15b99b82..8f954d8d9 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <fork.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h index 85477eb48..8245d9ef0 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <list.h> #include <bits/libc-lock.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h index 9b1340028..e367fb9d8 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ /* Initial value of a spinlock. PA-RISC only implements atomic load and clear so this must be non-zero. */ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h index 6a53da2a0..e6b71f441 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _MALLOC_MACHINE_H #define _MALLOC_MACHINE_H diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c index 27f850cf8..60607ad4f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c @@ -23,8 +23,7 @@ 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + see <http://www.gnu.org/licenses/>. */ /* This file is compiled into assembly code which is then munged by a sed script into two files: crti.s and crtn.s. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h index 134977e07..8a7bd9705 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #ifndef __ASSEMBLER__ @@ -104,7 +103,7 @@ # define POPARGS_6 POPARGS_5 ldw -54(%sr0,%sp), %r21 ASM_LINE_SEP # ifdef IS_IN_libpthread -# ifdef PIC +# ifdef __PIC__ # define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP # define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ @@ -116,7 +115,7 @@ bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP # endif # elif !defined NOT_IN_libc -# ifdef PIC +# ifdef __PIC__ # define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP # define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ @@ -128,7 +127,7 @@ bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP # endif # else -# ifdef PIC +# ifdef __PIC__ # define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP # define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \ @@ -167,7 +166,7 @@ nop ASM_LINE_SEP \ ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0 ASM_LINE_SEP \ Lstp: ASM_LINE_SEP -# ifdef PIC +# ifdef __PIC__ /* Slower version uses GOT to get value of __local_multiple_threads */ # define SINGLE_THREAD_P \ addil LT%__local_multiple_threads, %r19 ASM_LINE_SEP \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h index a5dbeff1e..d330e664e 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <tls.h> #include <pt-machine.h> @@ -101,7 +100,7 @@ # define CENABLE call __pthread_enable_asynccancel; # define CDISABLE call __pthread_disable_asynccancel # elif defined IS_IN_librt -# ifdef PIC +# ifdef __PIC__ # define CENABLE pushl %ebx; \ call __i686.get_pc_thunk.bx; \ addl $_GLOBAL_OFFSET_TABLE_, %ebx; \ @@ -139,7 +138,7 @@ #endif # ifndef __ASSEMBLER__ -# if defined FLOATING_STACKS && USE___THREAD && defined PIC +# if defined FLOATING_STACKS && defined __UCLIBC_HAS_TLS__ && defined __PIC__ # define SINGLE_THREAD_P \ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ p_header.data.multiple_threads) == 0, 1) @@ -153,9 +152,9 @@ extern int __local_multiple_threads # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) # endif # else -# if !defined PIC +# if !defined __PIC__ # define SINGLE_THREAD_P cmpl $0, __local_multiple_threads -# elif defined FLOATING_STACKS && USE___THREAD +# elif defined FLOATING_STACKS && defined __UCLIBC_HAS_TLS__ # define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET # else # if !defined NOT_IN_libc || defined IS_IN_libpthread @@ -165,7 +164,7 @@ extern int __local_multiple_threads movl __local_multiple_threads@GOT(%ecx), %ecx;\ cmpl $0, (%ecx) # endif -# if !defined HAVE_HIDDEN || !USE___THREAD +# if !defined HAVE_HIDDEN || !defined __UCLIBC_HAS_TLS__ # define SINGLE_THREAD_P \ SETUP_PIC_REG (cx); \ addl $_GLOBAL_OFFSET_TABLE_, %ecx; \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S index c7a120d23..83ad9f3b5 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S @@ -13,14 +13,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -32,7 +31,7 @@ ENTRY (__vfork) #ifdef __NR_vfork # ifdef SHARED -# if !defined HAVE_HIDDEN || !USE___THREAD +# if !defined HAVE_HIDDEN || !defined __UCLIBC_HAS_TLS__ SETUP_PIC_REG (cx) # else call __i686.get_pc_thunk.cx @@ -44,7 +43,7 @@ ENTRY (__vfork) movl $pthread_create, %eax testl %eax, %eax # endif - jne HIDDEN_JUMPTARGET (__fork) + jne HIDDEN_JUMPTARGET (fork) /* Pop the return PC value into ECX. */ popl %ecx diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h index 629b1f89c..ad12181ff 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h index 30a0cc191..88f286145 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <signal.h> #include <sysdep.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c index af8a63c16..025566587 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c @@ -23,8 +23,7 @@ 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + see <http://www.gnu.org/licenses/>. */ /* This file is compiled into assembly code which is then munged by a sed script into two files: crti.s and crtn.s. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c index 0b96e3d5b..edb08439a 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h index dd9637d2b..595644044 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #include <tls.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S index 54acedad4..9b5fa767f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> @@ -38,7 +37,7 @@ ENTRY(__vfork) #endif ld8 r14 = [r14];; cmp.ne p6, p7 = 0, r14 -(p6) br.cond.spnt.few HIDDEN_JUMPTARGET (__fork);; +(p6) br.cond.spnt.few HIDDEN_JUMPTARGET (fork);; alloc r2=ar.pfs,0,0,2,0 mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD mov out1=0 /* Standard sp value. */ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c index 4b9031570..3e04f515f 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <setjmp.h> #include <stddef.h> @@ -32,3 +31,4 @@ _longjmp_unwind (jmp_buf env, int val) (env->__jmpbuf, __builtin_frame_address (0)), (void) 0); } +libc_hidden_def(_longjmp_unwind) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h index bb798e40d..54b99d688 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #ifndef __ASSEMBLER__ @@ -77,7 +76,7 @@ # define UNDOCARGS_5 UNDOCARGS_4; move.l (%sp)+, %d5; # ifdef IS_IN_libpthread -# ifdef PIC +# ifdef __PIC__ # define CENABLE jbsr __pthread_enable_asynccancel@PLTPC # define CDISABLE jbsr __pthread_disable_asynccancel@PLTPC # else @@ -85,7 +84,7 @@ # define CDISABLE jbsr __pthread_disable_asynccancel # endif # elif !defined NOT_IN_libc -# ifdef PIC +# ifdef __PIC__ # define CENABLE jbsr __libc_enable_asynccancel@PLTPC # define CDISABLE jbsr __libc_disable_asynccancel@PLTPC # else @@ -93,7 +92,7 @@ # define CDISABLE jbsr __libc_disable_asynccancel # endif # else -# ifdef PIC +# ifdef __PIC__ # define CENABLE jbsr __librt_enable_asynccancel@PLTPC # define CDISABLE jbsr __librt_disable_asynccancel@PLTPC # else @@ -114,7 +113,7 @@ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) # else -# if !defined PIC +# if !defined __PIC__ # define SINGLE_THREAD_P tst.l __local_multiple_threads # else # define SINGLE_THREAD_P tst.l (__local_multiple_threads, %pc) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S index 49b8a3c0a..2a4d3862c 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S @@ -13,14 +13,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -35,7 +34,7 @@ ENTRY (__vfork) .weak pthread_create movel #pthread_create, %d0 #endif - jbne HIDDEN_JUMPTARGET (__fork) + jbne HIDDEN_JUMPTARGET (fork) #ifdef __NR_vfork @@ -56,7 +55,7 @@ ENTRY (__vfork) movel %a0,%sp@- # ifdef __ASSUME_VFORK_SYSCALL -# ifndef PIC +# ifndef __PIC__ jbra SYSCALL_ERROR_LABEL # endif # else diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h index fc5177425..10c82a61c 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h @@ -15,9 +15,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #ifndef __ASSEMBLER__ @@ -31,7 +30,7 @@ # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ .align 2; \ - 99: \ + 99: move a0, v0; \ PTR_LA t9,__syscall_error; \ /* manual cpreturn. */ \ REG_L gp, STKOFF_GP(sp); \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h index 1fff78239..4e6dec775 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #ifndef __ASSEMBLER__ @@ -28,7 +27,8 @@ # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ .align 2; \ - 99: la t9,__syscall_error; \ + 99: move a0, v0; \ + la t9,__syscall_error; \ jr t9; \ ENTRY (name) \ .set noreorder; \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S index 7bbab5c59..09dcfa683 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ /* vfork() is just a special case of clone(). */ @@ -80,6 +79,7 @@ NESTED(__vfork,FRAMESZ,sp) /* Something bad happened -- no child created. */ L(error): + move a0, v0 #ifdef __PIC__ PTR_LA t9, __syscall_error RESTORE_GP64 diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c index 6cd0f09c1..13daefee6 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> @@ -76,7 +75,7 @@ __attribute__ ((noinline)) change_sigmask (int how, sigset_t *oss) { sigset_t ss; - sigfillset (&ss); + __sigfillset (&ss); return pthread_sigmask (how, &ss, oss); } @@ -163,8 +162,7 @@ init_mq_netlink (void) return; /* Make sure the descriptor is closed on exec. */ - if (fcntl (netlink_socket, F_SETFD, FD_CLOEXEC) != 0) - goto errout; + fcntl (netlink_socket, F_SETFD, FD_CLOEXEC); } int err = 1; @@ -213,7 +211,6 @@ init_mq_netlink (void) if (err != 0) { - errout: close_not_cancel_no_status (netlink_socket); netlink_socket = -1; } diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h index 865da8e8c..6c3dc12a0 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #include <tls.h> @@ -89,7 +88,7 @@ # else # define CENABLE bl JUMPTARGET(__librt_enable_asynccancel) # define CDISABLE bl JUMPTARGET(__librt_disable_asynccancel) -# if defined HAVE_AS_REL16 && defined PIC +# if defined HAVE_AS_REL16 && defined __PIC__ # undef CGOTSETUP # define CGOTSETUP \ bcl 20,31,1f; \ @@ -122,7 +121,7 @@ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) # else -# if !defined PIC +# if !defined __PIC__ # define SINGLE_THREAD_P \ lis 10,__local_multiple_threads@ha; \ lwz 10,__local_multiple_threads@l(10); \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S index 724d4cc54..4b16829be 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S @@ -12,14 +12,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -66,7 +65,7 @@ ENTRY (__vfork) # endif .Lhidden_fork: - b HIDDEN_JUMPTARGET(__fork) + b HIDDEN_JUMPTARGET(fork) #endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h index 0c7467676..901982ec8 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #include <tls.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S index b408e31b7..47c91dfd4 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S @@ -12,14 +12,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -42,7 +41,7 @@ ENTRY (__vfork) ld 10,.LC0@toc(2) ld 10,0(10) cmpwi 10,0 - bne- HIDDEN_JUMPTARGET(__fork) + bne- HIDDEN_JUMPTARGET(fork) # else .weak pthread_create lis 10,pthread_create@highest @@ -80,7 +79,7 @@ ENTRY (__vfork) # ifndef SHARED .Lhidden_fork: - b HIDDEN_JUMPTARGET(__fork) + b HIDDEN_JUMPTARGET(fork) .Lsyscall_error: b JUMPTARGET(__syscall_error) # endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c index 7c9fe36e2..83f678c8b 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> @@ -24,7 +23,7 @@ #include <sys/syscall.h> #include <linuxthreads/internals.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> void __pthread_sigsuspend (const sigset_t *set) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c index 61209cfaf..1e11a4812 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <signal.h> #include <unistd.h> @@ -40,4 +39,3 @@ raise (sig) #endif } libc_hidden_def (raise) -weak_alias (raise, gsignal) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c index 2dce262a3..338d421e3 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stdlib.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h deleted file mode 100644 index bee7639f0..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ /dev/null @@ -1,72 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version. - 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 - 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 _BITS_TYPES_H -# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* See <bits/types.h> for the meaning of these macros. This file exists so - that <bits/types.h> need not vary across different GNU platforms. */ - -#define __DEV_T_TYPE __UQUAD_TYPE -#define __UID_T_TYPE __U32_TYPE -#define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE -#define __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __UWORD_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE -#define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#define __DADDR_T_TYPE __S32_TYPE -#define __SWBLK_T_TYPE __SLONGWORD_TYPE -#define __KEY_T_TYPE __S32_TYPE -#define __CLOCKID_T_TYPE __S32_TYPE -#define __TIMER_T_TYPE __S32_TYPE -#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE -#define __FSID_T_TYPE struct { int __val[2]; } -#if defined __GNUC__ && __GNUC__ <= 2 -/* Compatibility with g++ 2.95.x. */ -#define __SSIZE_T_TYPE __SWORD_TYPE -#else -/* size_t is unsigned long int on s390 -m31. */ -#define __SSIZE_T_TYPE __SLONGWORD_TYPE -#endif - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 - - -#endif /* bits/typesizes.h */ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c deleted file mode 100644 index b7d901c4c..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Special .init and .fini section support for S/390. - Copyright (C) 2000, 2001 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the - .init and .fini sections and defines global symbols for - those addresses, so they can be called as functions. - - * crtn.s puts the corresponding function epilogues - in the .init and .fini sections. */ - -__asm__ ("\ -\n\ -#include \"defs.h\"\n\ -\n\ -/*@HEADER_ENDS*/\n\ -\n\ -/*@TESTS_BEGIN*/\n\ -\n\ -/*@TESTS_END*/\n\ -\n\ -/*@_init_PROLOG_BEGINS*/\n\ -\n\ - .section .init\n\ -#NO_APP\n\ - .align 4\n\ -.globl _init\n\ - .type _init,@function\n\ -_init:\n\ -# leaf function 0\n\ -# automatics 0\n\ -# outgoing args 0\n\ -# need frame pointer 0\n\ -# call alloca 0\n\ -# has varargs 0\n\ -# incoming args (stack) 0\n\ -# function length 36\n\ - STM 6,15,24(15)\n\ - BRAS 13,.LTN1_0\n\ -.LT1_0:\n\ -.LC13:\n\ - .long __pthread_initialize_minimal@PLT-.LT1_0\n\ -.LC14:\n\ - .long __gmon_start__@GOT\n\ -.LC15:\n\ - .long _GLOBAL_OFFSET_TABLE_-.LT1_0\n\ -.LTN1_0:\n\ - LR 1,15\n\ - AHI 15,-96\n\ - ST 1,0(15)\n\ - L 12,.LC15-.LT1_0(13)\n\ - AR 12,13\n\ - L 1,.LC13-.LT1_0(13)\n\ - LA 1,0(1,13)\n\ - BASR 14,1\n\ - L 1,.LC14-.LT1_0(13)\n\ - L 1,0(1,12)\n\ - LTR 1,1\n\ - JE .L22\n\ - BASR 14,1\n\ -.L22:\n\ -#APP\n\ - .align 4,0x07\n\ - END_INIT\n\ -\n\ -/*@_init_PROLOG_ENDS*/\n\ -\n\ -/*@_init_EPILOG_BEGINS*/\n\ - .align 4\n\ - .section .init\n\ -#NO_APP\n\ - .align 4\n\ - L 4,152(15)\n\ - LM 6,15,120(15)\n\ - BR 4\n\ -#APP\n\ - END_INIT\n\ -\n\ -/*@_init_EPILOG_ENDS*/\n\ -\n\ -/*@_fini_PROLOG_BEGINS*/\n\ - .section .fini\n\ -#NO_APP\n\ - .align 4\n\ -.globl _fini\n\ - .type _fini,@function\n\ -_fini:\n\ -# leaf function 0\n\ -# automatics 0\n\ -# outgoing args 0\n\ -# need frame pointer 0\n\ -# call alloca 0\n\ -# has varargs 0\n\ -# incoming args (stack) 0\n\ -# function length 30\n\ - STM 6,15,24(15)\n\ - BRAS 13,.LTN2_0\n\ -.LT2_0:\n\ -.LC17:\n\ - .long _GLOBAL_OFFSET_TABLE_-.LT2_0\n\ -.LTN2_0:\n\ - LR 1,15\n\ - AHI 15,-96\n\ - ST 1,0(15)\n\ - L 12,.LC17-.LT2_0(13)\n\ - AR 12,13\n\ -#APP\n\ - .align 4,0x07\n\ - END_FINI\n\ -\n\ -/*@_fini_PROLOG_ENDS*/\n\ -\n\ -/*@_fini_EPILOG_BEGINS*/\n\ - .align 4\n\ - .section .fini\n\ -#NO_APP\n\ - .align 4\n\ - L 4,152(15)\n\ - LM 6,15,120(15)\n\ - BR 4\n\ -#APP\n\ - END_FINI\n\ -\n\ -/*@_fini_EPILOG_ENDS*/\n\ -\n\ -/*@TRAILER_BEGINS*/\ -"); diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h deleted file mode 100644 index 06f7aed7d..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h +++ /dev/null @@ -1,137 +0,0 @@ -/* 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. - - 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. */ - -#include <sysdep.h> -#include <tls.h> -#ifndef __ASSEMBLER__ -# include <linuxthreads/internals.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -# if !defined NOT_IN_libc || defined IS_IN_libpthread - -# define PSEUDO_CANCEL(name, syscall_name, args) \ -L(pseudo_cancel): \ - STM_##args \ - stm %r12,%r15,48(%r15); \ - lr %r14,%r15; \ - ahi %r15,-96; \ - st %r14,0(%r15); \ - basr %r13,0; \ -0: l %r1,1f-0b(%r13); \ - bas %r14,0(%r1,%r13); \ - lr %r0,%r2; \ - LM_##args \ - DO_CALL(syscall_name, args); \ - l %r1,2f-0b(%r13); \ - lr %r12,%r2; \ - lr %r2,%r0; \ - bas %r14,0(%r1,%r13); \ - lr %r2,%r12; \ - lm %r12,%r15,48+96(%r15); \ - j L(pseudo_check); \ -1: .long CENABLE-0b; \ -2: .long CDISABLE-0b; - -# else /* !libc.so && !libpthread.so */ - -# define PSEUDO_CANCEL(name, syscall_name, args) \ -L(pseudo_cancel): \ - STM_##args \ - stm %r11,%r15,44(%r15); \ - lr %r14,%r15; \ - ahi %r15,-96; \ - st %r14,0(%r15); \ - basr %r13,0; \ -0: l %r12,3f-0b(%r13); \ - l %r1,1f-0b(%r13); \ - la %r12,0(%r12,%r13); \ - bas %r14,0(%r1,%r13); \ - lr %r0,%r2; \ - LM_##args \ - DO_CALL(syscall_name, args); \ - l %r1,2f-0b(%r13); \ - lr %r11,%r2; \ - lr %r2,%r0; \ - bas %r14,0(%r1,%r13); \ - lr %r2,%r11; \ - lm %r11,%r15,44+96(%r15); \ - j L(pseudo_check); \ -1: .long CENABLE@PLT-0b; \ -2: .long CDISABLE@PLT-0b; \ -3: .long _GLOBAL_OFFSET_TABLE_-0b; - -# endif - -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .text; \ -PSEUDO_CANCEL(name, syscall_name, args) \ -ENTRY(name) \ - SINGLE_THREAD_P(%r1) \ - jne L(pseudo_cancel); \ - DO_CALL(syscall_name, args); \ -L(pseudo_check): \ - lhi %r4,-4095; \ - clr %r2,%r4; \ - jnl SYSCALL_ERROR_LABEL; \ -L(pseudo_end): - -# ifdef IS_IN_libpthread -# define CENABLE __pthread_enable_asynccancel -# define CDISABLE __pthread_disable_asynccancel -# elif !defined NOT_IN_libc -# define CENABLE __libc_enable_asynccancel -# define CDISABLE __libc_disable_asynccancel -# else -# define CENABLE __librt_enable_asynccancel -# define CDISABLE __librt_disable_asynccancel -# endif - -#define STM_0 /* Nothing */ -#define STM_1 st %r2,8(%r15); -#define STM_2 stm %r2,%r3,8(%r15); -#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 LM_0 /* Nothing */ -#define LM_1 l %r2,8+96(%r15); -#define LM_2 lm %r2,%r3,8+96(%r15); -#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); - -# ifndef __ASSEMBLER__ -# define SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - p_header.data.multiple_threads) == 0, 1) -# else -# define SINGLE_THREAD_P(reg) \ - ear reg,%a0; \ - icm reg,15,MULTIPLE_THREADS_OFFSET(reg); -# endif - -#elif !defined __ASSEMBLER__ - -/* This code should never be used but we define it anyhow. */ -# define SINGLE_THREAD_P (1) - -#endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c deleted file mode 100644 index 540443e6a..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c +++ /dev/null @@ -1,137 +0,0 @@ -/* Special .init and .fini section support for 64 bit S/390. - Copyright (C) 2001 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the - .init and .fini sections and defines global symbols for - those addresses, so they can be called as functions. - - * crtn.s puts the corresponding function epilogues - in the .init and .fini sections. */ - -__asm__ ("\ -\n\ -#include \"defs.h\"\n\ -\n\ -/*@HEADER_ENDS*/\n\ -\n\ -/*@TESTS_BEGIN*/\n\ -\n\ -/*@TESTS_END*/\n\ -\n\ -/*@_init_PROLOG_BEGINS*/\n\ -\n\ - .section .init\n\ -#NO_APP\n\ - .align 4\n\ -.globl _init\n\ - .type _init,@function\n\ -_init:\n\ -# leaf function 0\n\ -# automatics 0\n\ -# outgoing args 0\n\ -# need frame pointer 0\n\ -# call alloca 0\n\ -# has varargs 0\n\ -# incoming args (stack) 0\n\ -# function length 36\n\ - STMG 6,15,48(15)\n\ - LGR 1,15\n\ - AGHI 15,-160\n\ - STG 1,0(15)\n\ - LARL 12,_GLOBAL_OFFSET_TABLE_\n\ - BRASL 14,__pthread_initialize_minimal@PLT\n\ - LARL 1,__gmon_start__@GOTENT\n\ - LG 1,0(1)\n\ - LTGR 1,1\n\ - JE .L22\n\ - BASR 14,1\n\ -.L22:\n\ -#APP\n\ - .align 4,0x07\n\ - END_INIT\n\ -\n\ -/*@_init_PROLOG_ENDS*/\n\ -\n\ -/*@_init_EPILOG_BEGINS*/\n\ - .align 4\n\ - .section .init\n\ -#NO_APP\n\ - .align 4\n\ - LG 4,272(15)\n\ - LMG 6,15,208(15)\n\ - BR 4\n\ -#APP\n\ - END_INIT\n\ -\n\ -/*@_init_EPILOG_ENDS*/\n\ -\n\ -/*@_fini_PROLOG_BEGINS*/\n\ - .section .fini\n\ -#NO_APP\n\ - .align 4\n\ -.globl _fini\n\ - .type _fini,@function\n\ -_fini:\n\ -# leaf function 0\n\ -# automatics 0\n\ -# outgoing args 0\n\ -# need frame pointer 0\n\ -# call alloca 0\n\ -# has varargs 0\n\ -# incoming args (stack) 0\n\ -# function length 30\n\ - STMG 6,15,48(15)\n\ - LGR 1,15\n\ - AGHI 15,-160\n\ - STG 1,0(15)\n\ - LARL 12,_GLOBAL_OFFSET_TABLE_\n\ -#APP\n\ - .align 4,0x07\n\ - END_FINI\n\ -\n\ -/*@_fini_PROLOG_ENDS*/\n\ -\n\ -/*@_fini_EPILOG_BEGINS*/\n\ - .align 4\n\ - .section .fini\n\ -#NO_APP\n\ - .align 4\n\ - LG 4,272(15)\n\ - LMG 6,15,208(15)\n\ - BR 4\n\ -#APP\n\ - END_FINI\n\ -\n\ -/*@_fini_EPILOG_ENDS*/\n\ -\n\ -/*@TRAILER_BEGINS*/\n\ - "); diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c deleted file mode 100644 index d57283ad2..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../ia64/pt-sigsuspend.c" diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h deleted file mode 100644 index f71ef3f68..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h +++ /dev/null @@ -1,116 +0,0 @@ -/* 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. - - 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. */ - -#include <sysdep.h> -#include <tls.h> -#ifndef __ASSEMBLER__ -# include <linuxthreads/internals.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .text; \ -L(pseudo_cancel): \ - STM_##args \ - stmg %r13,%r15,104(%r15); \ - lgr %r14,%r15; \ - aghi %r15,-160; \ - stg %r14,0(%r15); \ - brasl %r14,CENABLE; \ - lgr %r0,%r2; \ - LM_##args \ - DO_CALL(syscall_name, args); \ - lgr %r13,%r2; \ - lgr %r2,%r0; \ - brasl %r14,CDISABLE; \ - lgr %r2,%r13; \ - lmg %r13,%r15,104+160(%r15); \ - j L(pseudo_check); \ -ENTRY(name) \ - SINGLE_THREAD_P \ - jne L(pseudo_cancel); \ - DO_CALL(syscall_name, args); \ -L(pseudo_check): \ - lghi %r4,-4095; \ - clgr %r2,%r4; \ - jgnl SYSCALL_ERROR_LABEL; \ -L(pseudo_end): - -# ifdef IS_IN_libpthread -# define CENABLE __pthread_enable_asynccancel -# define CDISABLE __pthread_disable_asynccancel -# define __local_multiple_threads __pthread_multiple_threads -# elif !defined NOT_IN_libc -# define CENABLE __libc_enable_asynccancel -# define CDISABLE __libc_disable_asynccancel -# define __local_multiple_threads __libc_multiple_threads -# else -# define CENABLE __librt_enable_asynccancel@PLT -# define CDISABLE __librt_disable_asynccancel@PLT -# endif - -#define STM_0 /* Nothing */ -#define STM_1 stg %r2,16(%r15); -#define STM_2 stmg %r2,%r3,16(%r15); -#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 LM_0 /* Nothing */ -#define LM_1 lg %r2,16+160(%r15); -#define LM_2 lmg %r2,%r3,16+160(%r15); -#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); - -# if !defined NOT_IN_libc || defined IS_IN_libpthread -# ifndef __ASSEMBLER__ -extern int __local_multiple_threads attribute_hidden; -# define SINGLE_THREAD_P \ - __builtin_expect (__local_multiple_threads == 0, 1) -# else -# define SINGLE_THREAD_P \ - larl %r1,__local_multiple_threads; \ - icm %r0,15,0(%r1); -# endif - -# else - -# ifndef __ASSEMBLER__ -# define SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - p_header.data.multiple_threads) == 0, 1) -# else -# define SINGLE_THREAD_P \ - ear %r1,%a0; \ - sllg %r1,%r1,32; \ - ear %r1,%a1; \ - icm %r1,15,MULTIPLE_THREADS_OFFSET(%r1); -# endif - -# endif - -#elif !defined __ASSEMBLER__ - -/* This code should never be used but we define it anyhow. */ -# define SINGLE_THREAD_P (1) - -#endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S deleted file mode 100644 index 199f0017f..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com> - - 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. */ - -#include <sysdep-cancel.h> -#define _ERRNO_H 1 -#include <bits/errno.h> - -/* Clone the calling process, but without copying the whole address space. - The calling process is suspended until the new process exits or is - replaced by a call to `execve'. Return -1 for errors, 0 to the new process, - and the process ID of the new process to the old process. */ - -ENTRY (__vfork) -#ifdef SHARED - larl %r1,__libc_pthread_functions - lg %r1,0(%r1) -#else - .weak pthread_create - larl %r1,pthread_create -#endif - ltgr %r1,%r1 - jgne HIDDEN_JUMPTARGET(__fork) - - /* Do vfork system call. */ - svc SYS_ify (vfork) - - /* Check for error. */ - lghi %r4,-4095 - clgr %r2,%r4 - jgnl SYSCALL_ERROR_LABEL - - /* Normal return. */ - br %r14 -PSEUDO_END(__vfork) - -libc_hidden_def (__vfork) - -weak_alias (__vfork, vfork) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c index 1cdb98f0f..500fff091 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c @@ -23,8 +23,7 @@ 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, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + see <http://www.gnu.org/licenses/>. */ /* This file is compiled into assembly code which is then munged by a sed script into two files: crti.s and crtn.s. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h index 5e2f43cda..7d8ced7d7 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h @@ -14,8 +14,7 @@ You should have received a copy of the GNU Library 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. */ + see <http://www.gnu.org/licenses/>. */ static __inline__ int is_smp_system (void) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h index 03c6fedbf..58c726b20 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #include <tls.h> @@ -102,7 +101,7 @@ # define __local_multiple_threads __librt_multiple_threads # endif -# if defined IS_IN_librt && defined PIC +# if defined IS_IN_librt && defined __PIC__ # define CENABLE \ mov.l r12,@-r15; \ mov.l 1f,r12; \ @@ -155,7 +154,7 @@ # endif # ifndef __ASSEMBLER__ -# if defined FLOATING_STACKS && USE___THREAD && defined PIC +# if defined FLOATING_STACKS && defined __UCLIBC_HAS_TLS__ && defined __PIC__ # define SINGLE_THREAD_P \ __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1) # else @@ -163,7 +162,7 @@ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) # endif # else -# if !defined PIC +# if !defined __PIC__ # define SINGLE_THREAD_P \ mov.l 1f,r0; \ mov.l @r0,r0; \ @@ -172,7 +171,7 @@ extern int __local_multiple_threads attribute_hidden; .align 2; \ 1: .long __local_multiple_threads; \ 2: -# elif defined FLOATING_STACKS && USE___THREAD +# elif defined FLOATING_STACKS && defined __UCLIBC_HAS_TLS__ # define SINGLE_THREAD_P \ stc gbr,r0; \ mov.w 0f,r1; \ diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S index f230c0122..90733119e 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S @@ -12,13 +12,13 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include <sys/syscall.h> /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is @@ -39,12 +39,12 @@ ENTRY (__vfork) bf .Lhidden_fork mov.w .L1, r3 - trapa #0x10 + trapa #__SH_SYSCALL_TRAP_BASE mov r0, r1 mov #-12, r2 shad r2, r1 - not r1, r1 // r1=0 means r0 = -1 to -4095 - tst r1, r1 // i.e. error in linux + not r1, r1 /* r1=0 means r0 = -1 to -4095 */ + tst r1, r1 /* i.e. error in linux */ bf .Lpseudo_end SYSCALL_ERROR_HANDLER .Lpseudo_end: @@ -63,13 +63,13 @@ ENTRY (__vfork) .long pthread_create #endif -.Lhidden_fork: +.Lhidden_fork: mov.l .L2, r1 braf r1 nop 1: .align 2 -.L2: .long HIDDEN_JUMPTARGET(__fork)-1b +.L2: .long HIDDEN_JUMPTARGET(fork)-1b PSEUDO_END (__vfork) libc_hidden_def (__vfork) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c index 3432125bb..2e09d1ba5 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> @@ -23,11 +22,10 @@ #include <sysdep-cancel.h> #include <sys/syscall.h> -#include <bp-checks.h> #include <bits/libc-lock.h> -extern int __syscall_rt_sigtimedwait (const sigset_t *__unbounded, siginfo_t *__unbounded, - const struct timespec *__unbounded, size_t); +extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *, + const struct timespec *, size_t); /* Return any pending signal or wait for one for the given time. */ @@ -40,7 +38,7 @@ do_sigwait (const sigset_t *set, int *sig) real size of the user-level sigset_t. */ #ifdef INTERNAL_SYSCALL INTERNAL_SYSCALL_DECL (err); - ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, CHECK_SIGSET (set), + ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, set, NULL, NULL, _NSIG / 8); if (! INTERNAL_SYSCALL_ERROR_P (ret, err)) { @@ -50,7 +48,7 @@ do_sigwait (const sigset_t *set, int *sig) else ret = INTERNAL_SYSCALL_ERRNO (ret, err); #else - ret = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set), + ret = INLINE_SYSCALL (rt_sigtimedwait, 4, set, NULL, NULL, _NSIG / 8); if (ret != -1) { @@ -69,9 +67,7 @@ weak_extern (__pthread_sigwait) #endif int -__sigwait (set, sig) - const sigset_t *set; - int *sig; +sigwait (const sigset_t *set, int *sig) { #ifndef NOT_IN_libc return __libc_maybe_call2 (pthread_sigwait, (set, sig), @@ -80,9 +76,7 @@ __sigwait (set, sig) return do_sigwait (set, sig); #endif } -libc_hidden_def (__sigwait) -weak_alias (__sigwait, sigwait) -strong_alias (__sigwait, __libc_sigwait) +strong_alias(sigwait, __libc_sigwait) /* Cancellation is handled in __pthread_sigwait. */ LIBC_CANCEL_HANDLED (); diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h index 9ab75e8e6..6f03b9d55 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h @@ -14,8 +14,7 @@ You should have received a copy of the GNU Library 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. */ + see <http://www.gnu.org/licenses/>. */ #include <sys/sysctl.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h index 27ffa668f..3f22f8ae3 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If + not, see <http://www.gnu.org/licenses/>. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h index 7e4253789..3efee0b8d 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_H # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h index b736526c1..ce98a3bb9 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h @@ -13,22 +13,8 @@ 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. */ - -#include <sysdep.h> - -#define ARCH_FORK() \ -({ \ - register long __o0 __asm__ ("o0"); \ - register long __o1 __asm__ ("o1"); \ - register long __g1 __asm__ ("g1") = __NR_fork; \ - __asm__ __volatile__ (__SYSCALL_STRING \ - : "=r" (__g1), "=r" (__o0), "=r" (__o1) \ - : "0" (__g1) \ - : __SYSCALL_CLOBBERS); \ - __o0 == -1 ? __o0 : (__o0 & (__o1 - 1)); \ -}) + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include_next <fork.h> + diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c deleted file mode 100644 index d57283ad2..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../ia64/pt-sigsuspend.c" diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h deleted file mode 100644 index 80834292e..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h +++ /dev/null @@ -1,101 +0,0 @@ -/* 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. - - 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. */ - -#include <sysdep.h> -#include <tls.h> -#ifndef __ASSEMBLER__ -# include <linuxthreads/internals.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .text; \ -ENTRY(name) \ - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \ - brnz,pn %g1, 1f; \ - mov SYS_ify(syscall_name), %g1; \ - ta 0x6d; \ - bcs,pn %xcc, __syscall_error_handler; \ - nop; \ - .subsection 2; \ -1: save %sp, -192, %sp; \ - CENABLE; \ - nop; \ - mov %o0, %l0; \ - COPY_ARGS_##args \ - mov SYS_ify(syscall_name), %g1; \ - ta 0x6d; \ - bcs,pn %xcc, __syscall_error_handler2; \ - mov %o0, %l1; \ - CDISABLE; \ - mov %l0, %o0; \ - jmpl %i7 + 8, %g0; \ - restore %g0, %l1, %o0; \ - .previous; \ - SYSCALL_ERROR_HANDLER \ - SYSCALL_ERROR_HANDLER2 - -#define SYSCALL_ERROR_HANDLER2 \ -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \ - .global __errno_location; \ - .type __errno_location,@function; \ - CDISABLE; \ - mov %l0, %o0; \ - call __errno_location; \ - nop; \ - st %l1, [%o0]; \ - jmpl %i7 + 8, %g0; \ - restore %g0, -1, %o0; \ - .previous; - -# ifdef IS_IN_libpthread -# define CENABLE call __pthread_enable_asynccancel -# define CDISABLE call __pthread_disable_asynccancel -# elif !defined NOT_IN_libc -# define CENABLE call __libc_enable_asynccancel -# define CDISABLE call __libc_disable_asynccancel -# else -# define CENABLE call __librt_enable_asynccancel -# define CDISABLE call __librt_disable_asynccancel -# endif - -#define COPY_ARGS_0 /* Nothing */ -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0; -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1; -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2; -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3; -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4; -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5; - -# ifndef __ASSEMBLER__ -# define SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - p_header.data.multiple_threads) == 0, 1) -# else -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1 -# endif - -#elif !defined __ASSEMBLER__ - -/* This code should never be used but we define it anyhow. */ -# define SINGLE_THREAD_P (1) - -#endif diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S deleted file mode 100644 index 8a6d2771e..000000000 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. - - 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. */ - -#include <sysdep-cancel.h> - -#ifdef SHARED -.LLGETPC0: - retl - add %o7, %o0, %o0 -#endif -ENTRY(__vfork) -#ifdef SHARED - mov %o7, %o1 - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0 - call .LLGETPC0 - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0 - sethi %hi(__libc_pthread_functions), %o2 - mov %o1, %o7 - or %o2, %lo(__libc_pthread_functions), %o2 - ldx [%o0 + %o2], %o2 - ldx [%o2], %o0 -#else - .weak pthread_create - sethi %hi(pthread_create), %o0 - or %o0, %lo(pthread_create), %o0 -#endif -#if defined SHARED && !defined BROKEN_SPARC_WDISP22 - cmp %o0, 0 - bne HIDDEN_JUMPTARGET(__fork) -#else - brnz,pn %o0, 1f -#endif - mov __NR_vfork, %g1 - ta 0x6d - bcs,pn %xcc, __syscall_error_handler - nop - sub %o1, 1, %o1 - retl - and %o0, %o1, %o0 -#if !defined SHARED || defined BROKEN_SPARC_WDISP22 -1: mov %o7, %g1 - call HIDDEN_JUMPTARGET(__fork) - mov %g1, %o7 -#endif - SYSCALL_ERROR_HANDLER -PSEUDO_END (__vfork) -libc_hidden_def (__vfork) -weak_alias (__vfork, vfork) diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h index dd3f52a98..bd9bb0d6a 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h @@ -13,11 +13,9 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> #include <tls.h> #ifndef __ASSEMBLER__ # include <linuxthreads/internals.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S index 132da67a1..ab2286ee8 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> @@ -43,7 +42,7 @@ ENTRY(__vfork) orcc %o0, %lo(pthread_create), %o0 #endif #if defined SHARED && !defined BROKEN_SPARC_WDISP22 - bne HIDDEN_JUMPTARGET(__fork) + bne HIDDEN_JUMPTARGET(fork) #else bne 1f #endif @@ -56,7 +55,7 @@ ENTRY(__vfork) and %o0, %o1, %o0 #if !defined SHARED || defined BROKEN_SPARC_WDISP22 1: mov %o7, %g1 - call HIDDEN_JUMPTARGET(__fork) + call HIDDEN_JUMPTARGET(fork) mov %g1, %o7 #endif SYSCALL_ERROR_HANDLER diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c index dad273fdf..4bc83d6cc 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stdlib.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h index e82e6dfdd..0b05c96f6 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep.h> #include <tls.h> diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S index 25d1d3f96..1a58077c4 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S @@ -12,9 +12,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sysdep-cancel.h> #define _ERRNO_H 1 @@ -34,7 +33,7 @@ ENTRY (__vfork) movq $pthread_create, %rax testq %rax, %rax #endif - jne HIDDEN_JUMPTARGET (__fork) + jne HIDDEN_JUMPTARGET (fork) /* Pop the return PC value into RDI. We need a register that is preserved by the syscall and that we're allowed to destroy. */ diff --git a/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c b/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c index b43d4ac8d..80c1b05a8 100644 --- a/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <pthread.h> diff --git a/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h b/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h index 23615dbd8..0e0851e1e 100644 --- a/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h @@ -14,9 +14,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 diff --git a/libpthread/linuxthreads/sysdeps/x86_64/tls.h b/libpthread/linuxthreads/sysdeps/x86_64/tls.h index 5e7239d17..24ed3fca9 100644 --- a/libpthread/linuxthreads/sysdeps/x86_64/tls.h +++ b/libpthread/linuxthreads/sysdeps/x86_64/tls.h @@ -13,9 +13,8 @@ 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. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H |
