summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads')
-rw-r--r--libpthread/linuxthreads/.cvsignore3
-rw-r--r--libpthread/linuxthreads/Makefile.in62
-rw-r--r--libpthread/linuxthreads/alloca_cutoff.c5
-rw-r--r--libpthread/linuxthreads/attr.c13
-rw-r--r--libpthread/linuxthreads/barrier.c5
-rw-r--r--libpthread/linuxthreads/cancel.c3
-rw-r--r--libpthread/linuxthreads/descr.h10
-rw-r--r--libpthread/linuxthreads/errno.c2
-rw-r--r--libpthread/linuxthreads/events.c5
-rw-r--r--libpthread/linuxthreads/forward.c8
-rw-r--r--libpthread/linuxthreads/internals.h35
-rw-r--r--libpthread/linuxthreads/libc-cancellation.c8
-rw-r--r--libpthread/linuxthreads/libc_pthread_init.c21
-rw-r--r--libpthread/linuxthreads/lockfile.c5
-rw-r--r--libpthread/linuxthreads/manager.c81
-rw-r--r--libpthread/linuxthreads/pt-machine.c5
-rw-r--r--libpthread/linuxthreads/ptcleanup.c6
-rw-r--r--libpthread/linuxthreads/ptclock_gettime.c6
-rw-r--r--libpthread/linuxthreads/ptclock_settime.c6
-rw-r--r--libpthread/linuxthreads/ptfork.c2
-rw-r--r--libpthread/linuxthreads/pthread.c168
-rw-r--r--libpthread/linuxthreads/pthread_atfork.c5
-rw-r--r--libpthread/linuxthreads/pthread_setegid.c5
-rw-r--r--libpthread/linuxthreads/pthread_seteuid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setgid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setregid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setresgid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setresuid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setreuid.c5
-rw-r--r--libpthread/linuxthreads/pthread_setuid.c5
-rw-r--r--libpthread/linuxthreads/restart.h2
-rw-r--r--libpthread/linuxthreads/rwlock.c5
-rw-r--r--libpthread/linuxthreads/semaphore.c1
-rw-r--r--libpthread/linuxthreads/semaphore.h13
-rw-r--r--libpthread/linuxthreads/signals.c10
-rw-r--r--libpthread/linuxthreads/specific.c12
-rw-r--r--libpthread/linuxthreads/spinlock.c14
-rw-r--r--libpthread/linuxthreads/spinlock.h6
-rw-r--r--libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/alpha/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/alpha/pt-machine.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/alpha/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h8
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/avr32/pt-machine.h6
-rw-r--r--libpthread/linuxthreads/sysdeps/cris/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/cris/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/hppa/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/hppa/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h7
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/pspinlock.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/pt-machine.h8
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/tls.h7
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/useldt.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/ia64/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/ia64/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym2
-rw-r--r--libpthread/linuxthreads/sysdeps/ia64/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/m68k/pspinlock.c25
-rw-r--r--libpthread/linuxthreads/sysdeps/m68k/pt-machine.h14
-rw-r--r--libpthread/linuxthreads/sysdeps/mips/pspinlock.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/mips/pt-machine.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/mips/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/or1k/pt-machine.h55
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym2
-rw-r--r--libpthread/linuxthreads/sysdeps/powerpc/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/.cvsignore2
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h8
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/errno-loc.c11
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/flockfile.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/funlockfile.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c11
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/kernel-features.h80
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/list.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/not-cancel.h65
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/posix-timer.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c3
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h9
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pthread.h94
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/res-state.c11
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/sigaction.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_create.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_delete.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_routines.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_settime.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/tst-timer.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h6
-rw-r--r--libpthread/linuxthreads/sysdeps/s390/pspinlock.c91
-rw-r--r--libpthread/linuxthreads/sysdeps/s390/s390-32/pt-machine.h120
-rw-r--r--libpthread/linuxthreads/sysdeps/s390/s390-64/pt-machine.h125
-rw-r--r--libpthread/linuxthreads/sysdeps/s390/tcb-offsets.sym4
-rw-r--r--libpthread/linuxthreads/sysdeps/s390/tls.h145
-rw-r--r--libpthread/linuxthreads/sysdeps/sh/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/sh/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym2
-rw-r--r--libpthread/linuxthreads/sysdeps/sh/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/pspinlock.c95
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/pt-machine.h86
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c88
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h83
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c94
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c93
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h105
-rw-r--r--libpthread/linuxthreads/sysdeps/sparc/tls.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/.cvsignore2
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h9
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S9
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h129
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S (renamed from libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S)70
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c60
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c3
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h13
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h15
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S11
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c3
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S7
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c6
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h13
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S11
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h7
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h8
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S6
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c11
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h9
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S9
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S11
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c7
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c6
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h72
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c154
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h137
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c137
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c1
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h116
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S54
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c3
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h13
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S16
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c22
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h20
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c1
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h101
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S64
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (renamed from libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h)6
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S (renamed from libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S)9
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S7
-rw-r--r--libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c5
-rw-r--r--libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h5
-rw-r--r--libpthread/linuxthreads/sysdeps/x86_64/tls.h5
186 files changed, 1113 insertions, 2751 deletions
diff --git a/libpthread/linuxthreads/.cvsignore b/libpthread/linuxthreads/.cvsignore
deleted file mode 100644
index 688daf411..000000000
--- a/libpthread/linuxthreads/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.cvsignore
-*.os
-Makefile.in
diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index b7c8914f5..c1ec1c9c7 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -1,17 +1,17 @@
# Makefile for uClibc
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
-# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
-CFLAGS-linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
+subdirs += libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)
+subdirs += libpthread/linuxthreads/sysdeps/unix/sysv/linux
+subdirs += libpthread/linuxthreads/sysdeps/pthread
-CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
-CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
-CFLAGS-libpthread/linuxthreads/sysdeps/pthread/ := $(CFLAGS-linuxthreads)
+CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
+CFLAGS-libpthread/linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
# This stuff will not compile without at least -O1
# psm: can't handle this here, could maybe search for -O0 in CFLAGS
@@ -65,7 +65,7 @@ CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads)
libpthread_libc_CSRC := \
forward.c libc-cancellation.c libc_pthread_init.c # alloca_cutoff.c
libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
-libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
+libc-static-y += $(libpthread_OUT)/libc_pthread_init.o $(libpthread_OUT)/libc-cancellation.o
libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
libpthread-static-y += $(patsubst %,$(libpthread_OUT)/%.o,$(libpthread_static_SRC))
@@ -81,20 +81,18 @@ libpthread-so-y += $(libpthread_OBJ:.o=.oS)
lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
-objclean-y += libpthread_clean
-headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
-headers_clean-y += linuxthreads_headers_clean
#ifeq ($(DOMULTI),n)
$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
- $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+ $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
#else
#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
-# $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+# $(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
#endif
$(Q)$(RM) $@
- $(Q)cp $(top_srcdir)extra/scripts/format.lds $@
- $(Q)echo "GROUP ( $(notdir $@).$(MAJOR_VERSION) libpthread_nonshared.a )" >> $@
+ $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
+ $(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
+ $(Q)mv $@.tmp $@
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
$(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
@@ -118,19 +116,23 @@ $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
$(Q)$(RM) $@
$(do_ar)
-include/pthread.h:
- $(do_ln) ../$(PTDIR)/sysdeps/pthread/$(@F) $(top_builddir)$@
-include/semaphore.h:
- $(do_ln) ../$(PTDIR)/$(@F) $(top_builddir)$@
-include/bits/pthreadtypes.h: | include/bits
- $(do_ln) ../../$(PTDIR)/sysdeps/pthread/bits/$(@F) $(top_builddir)$@
-linuxthreads_headers: include/pthread.h include/semaphore.h \
- include/bits/pthreadtypes.h
-
-linuxthreads_headers_clean:
- $(RM) $(top_builddir)include/pthread.h \
- $(top_builddir)include/semaphore.h \
- $(top_builddir)include/bits/pthreadtypes.h
-
-libpthread_clean:
- $(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,oS,a}
+$(top_builddir)include/pthread.h:
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
+$(top_builddir)include/semaphore.h:
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
+$(top_builddir)include/bits/pthreadtypes.h: | $(top_builddir)include/bits
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
+
+linuxthreads_headers := $(top_builddir)include/pthread.h \
+ $(top_builddir)include/semaphore.h \
+ $(top_builddir)include/bits/pthreadtypes.h
+$(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
+headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers)
+
+objclean-y += CLEAN_libpthread/linuxthreads
+headers_clean-y += HEADERCLEAN_libpthread/linuxthreads
+HEADERCLEAN_libpthread/linuxthreads:
+ $(do_rm) $(linuxthreads_headers)
+
+CLEAN_libpthread/linuxthreads:
+ $(do_rm) $(addprefix $(libpthread_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*. */*/*/*.,$(d)$(e))))
diff --git a/libpthread/linuxthreads/alloca_cutoff.c b/libpthread/linuxthreads/alloca_cutoff.c
index ca064b3bb..9fe13a39d 100644
--- a/libpthread/linuxthreads/alloca_cutoff.c
+++ b/libpthread/linuxthreads/alloca_cutoff.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 <alloca.h>
#include <stdlib.h>
diff --git a/libpthread/linuxthreads/attr.c b/libpthread/linuxthreads/attr.c
index 52e115c8e..959ffda99 100644
--- a/libpthread/linuxthreads/attr.c
+++ b/libpthread/linuxthreads/attr.c
@@ -172,9 +172,6 @@ int __pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr)
}
weak_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)
-link_warning (pthread_attr_setstackaddr,
- "the use of `pthread_attr_setstackaddr' is deprecated, use `pthread_attr_setstack'")
-
int __pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
{
/* XXX This function has a stupid definition. The standard specifies
@@ -185,8 +182,6 @@ int __pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
}
weak_alias (__pthread_attr_getstackaddr, pthread_attr_getstackaddr)
-link_warning (pthread_attr_getstackaddr,
- "the use of `pthread_attr_getstackaddr' is deprecated, use `pthread_attr_getstack'")
#endif
@@ -361,7 +356,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
attr->__scope = PTHREAD_SCOPE_SYSTEM;
#ifdef _STACK_GROWS_DOWN
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
attr->__stacksize = descr->p_stackaddr - (char *)descr->p_guardaddr
- descr->p_guardsize;
# else
@@ -369,7 +364,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
- descr->p_guardsize;
# endif
#else
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
attr->__stacksize = (char *)descr->p_guardaddr - descr->p_stackaddr;
# else
attr->__stacksize = (char *)descr->p_guardaddr - (char *)descr;
@@ -385,7 +380,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
otherwise the range of the stack area cannot be computed. */
attr->__stacksize += attr->__guardsize;
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
attr->__stackaddr = descr->p_stackaddr;
#else
# ifndef _STACK_GROWS_UP
@@ -395,7 +390,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
# endif
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
if (attr->__stackaddr == NULL)
#else
if (descr == &__pthread_initial_thread)
diff --git a/libpthread/linuxthreads/barrier.c b/libpthread/linuxthreads/barrier.c
index 37d997cfc..2e2521b19 100644
--- a/libpthread/linuxthreads/barrier.c
+++ b/libpthread/linuxthreads/barrier.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/cancel.c b/libpthread/linuxthreads/cancel.c
index 34356801a..21b8d900c 100644
--- a/libpthread/linuxthreads/cancel.c
+++ b/libpthread/linuxthreads/cancel.c
@@ -15,7 +15,6 @@
/* Thread cancellation */
#include <errno.h>
-#include <libc-internal.h>
#include "pthread.h"
#include "internals.h"
#include "spinlock.h"
@@ -23,7 +22,7 @@
#ifdef _STACK_GROWS_DOWN
# define FRAME_LEFT(frame, other) ((char *) frame >= (char *) other)
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
# define FRAME_LEFT(frame, other) ((char *) frame <= (char *) other)
#else
# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
diff --git a/libpthread/linuxthreads/descr.h b/libpthread/linuxthreads/descr.h
index 24ec30b41..1c816b225 100644
--- a/libpthread/linuxthreads/descr.h
+++ b/libpthread/linuxthreads/descr.h
@@ -23,7 +23,7 @@
#include <stdint.h>
#include <sys/types.h>
#include <hp-timing.h>
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
#include <tls.h>
#endif
#include "uClibc-glue.h"
@@ -112,7 +112,7 @@ union dtv;
struct _pthread_descr_struct
{
-#if !defined USE_TLS || !TLS_DTV_AT_TP || INCLUDE_TLS_PADDING
+#if !defined __UCLIBC_HAS_TLS__ || !TLS_DTV_AT_TP || INCLUDE_TLS_PADDING
/* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */
union
{
@@ -123,9 +123,7 @@ struct _pthread_descr_struct
union dtv *dtvp;
pthread_descr self; /* Pointer to this structure */
int multiple_threads;
-# ifdef NEED_DL_SYSINFO
uintptr_t sysinfo;
-# endif
} data;
void *__padding[16];
} p_header;
@@ -159,7 +157,7 @@ struct _pthread_descr_struct
char p_sigwaiting; /* true if a sigwait() is in progress */
struct pthread_start_args p_start_args; /* arguments for thread creation */
void ** p_specific[PTHREAD_KEY_1STLEVEL_SIZE]; /* thread-specific data */
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
void * p_libc_specific[_LIBC_TSD_KEY_N]; /* thread-specific data for libc */
int * p_errnop; /* pointer to used errno variable */
int p_errno; /* error returned by last system call */
@@ -187,7 +185,7 @@ struct _pthread_descr_struct
#if HP_TIMING_AVAIL
hp_timing_t p_cpuclock_offset; /* Initial CPU clock for thread. */
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
char *p_stackaddr; /* Stack address. */
#endif
size_t p_alloca_cutoff; /* Maximum size which should be allocated
diff --git a/libpthread/linuxthreads/errno.c b/libpthread/linuxthreads/errno.c
index 03c23f867..b8d9eb343 100644
--- a/libpthread/linuxthreads/errno.c
+++ b/libpthread/linuxthreads/errno.c
@@ -20,7 +20,7 @@
#include "pthread.h"
#include "internals.h"
-#if !USE_TLS || !HAVE___THREAD
+#ifndef __UCLIBC_HAS_TLS__
/* The definition in libc is sufficient if we use TLS. */
int *
__errno_location (void)
diff --git a/libpthread/linuxthreads/events.c b/libpthread/linuxthreads/events.c
index b4ca3846e..62bf122fa 100644
--- a/libpthread/linuxthreads/events.c
+++ b/libpthread/linuxthreads/events.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/>. */
/* The functions contained here do nothing, they just return. */
diff --git a/libpthread/linuxthreads/forward.c b/libpthread/linuxthreads/forward.c
index 2cd019651..486d254dc 100644
--- a/libpthread/linuxthreads/forward.c
+++ b/libpthread/linuxthreads/forward.c
@@ -13,21 +13,19 @@
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 <features.h>
#include <stdlib.h>
#include <dlfcn.h>
/* psm: keep this before internals.h */
-libc_hidden_proto(exit)
#include "internals.h"
/* Pointers to the libc functions. */
-struct pthread_functions __libc_pthread_functions attribute_hidden;
+struct pthread_functions __libc_pthread_functions;
# define FORWARD2(name, rettype, decl, params, defaction) \
diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h
index ecb7b03dd..00c7078ee 100644
--- a/libpthread/linuxthreads/internals.h
+++ b/libpthread/linuxthreads/internals.h
@@ -30,7 +30,7 @@
#include <bits/sigcontextinfo.h>
#include <bits/pthreadtypes.h>
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
#include <tls.h>
#endif
#include "descr.h"
@@ -200,19 +200,17 @@ static __inline__ int nonexisting_handle(pthread_handle h, pthread_t id)
/* The page size we can get from the system. This should likely not be
changed by the machine file but, you never know. */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE (sysconf (_SC_PAGE_SIZE))
-#endif
+#define __PAGE_SIZE (sysconf (_SC_PAGESIZE))
-/* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
+/* The initial size of the thread stack. Must be a multiple of __PAGE_SIZE. */
#ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE (4 * PAGE_SIZE)
+#define INITIAL_STACK_SIZE (4 * __PAGE_SIZE)
#endif
/* Size of the thread manager stack. The "- 32" avoids wasting space
with some malloc() implementations. */
#ifndef THREAD_MANAGER_STACK_SIZE
-#define THREAD_MANAGER_STACK_SIZE (2 * PAGE_SIZE - 32)
+#define THREAD_MANAGER_STACK_SIZE (2 * __PAGE_SIZE - 32)
#endif
/* The base of the "array" of thread stacks. The array will grow down from
@@ -285,7 +283,7 @@ extern void __pthread_destroy_specifics (void);
extern void __pthread_perform_cleanup (char *currentframe);
extern void __pthread_init_max_stacksize (void);
extern int __pthread_initialize_manager (void);
-extern void __pthread_message (const char * fmt, ...);
+extern void __pthread_message (const char * fmt, ...) attribute_hidden;
extern int __pthread_manager (void *reqfd);
extern int __pthread_manager_event (void *reqfd);
extern void __pthread_manager_sighandler (int sig);
@@ -347,7 +345,7 @@ extern int __pthread_mutexattr_gettype (const pthread_mutexattr_t *__attr,
int *__kind);
extern void __pthread_kill_other_threads_np (void);
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);
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
@@ -393,14 +391,14 @@ extern void __pthread_wait_for_restart_signal(pthread_descr self);
extern void __pthread_sigsuspend (const sigset_t *mask) attribute_hidden;
extern int __pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
- __const struct timespec *__restrict
+ const struct timespec *__restrict
__abstime);
extern int __pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
- __const struct timespec *__restrict
+ const struct timespec *__restrict
__abstime);
extern int __pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr);
-extern int __pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
+extern int __pthread_barrierattr_getpshared (const pthread_barrierattr_t *
__restrict __attr,
int *__restrict __pshared);
@@ -416,11 +414,6 @@ extern void (*__pthread_restart)(pthread_descr);
extern void (*__pthread_suspend)(pthread_descr);
extern int (*__pthread_timedsuspend)(pthread_descr, const struct timespec *);
-/* Prototypes for the function without cancelation support when the
- normal version has it. */
-extern int __libc_close (int fd);
-extern int __libc_nanosleep (const struct timespec *requested_time,
- struct timespec *remaining);
/* Prototypes for some of the new semaphore functions. */
extern int sem_post (sem_t * sem);
extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value);
@@ -445,10 +438,12 @@ extern void __linuxthreads_reap_event (void);
extern void __pthread_initialize (void);
/* TSD. */
+#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__
extern int __pthread_internal_tsd_set (int key, const void * pointer);
extern void * __pthread_internal_tsd_get (int key);
extern void ** __attribute__ ((__const__))
__pthread_internal_tsd_address (int key);
+#endif
/* Sighandler wrappers. */
extern void __pthread_sighandler(int signo, SIGCONTEXT ctx);
@@ -480,7 +475,7 @@ extern pid_t __pthread_fork (struct fork_block *b) attribute_hidden;
#define asm_handle(name) _asm_handle(name)
#define _asm_handle(name) #name
-#define ASM_GLOBAL asm_handle(ASM_GLOBAL_DIRECTIVE)
+#define ASM_GLOBAL asm_handle(.globl)
#define ASM_CANCEL(name) asm_handle(C_SYMBOL_NAME(name))
#if !defined NOT_IN_libc
@@ -513,8 +508,6 @@ extern pid_t __pthread_fork (struct fork_block *b) attribute_hidden;
# define LIBC_CANCEL_HANDLED() /* Nothing. */
#endif
-extern int * __libc_pthread_init (const struct pthread_functions *functions);
-
#if !defined NOT_IN_libc && !defined FLOATING_STACKS
# ifdef SHARED
# define thread_self() \
@@ -525,7 +518,7 @@ weak_extern (__pthread_thread_self)
# endif
#endif
-#ifndef USE_TLS
+#ifndef __UCLIBC_HAS_TLS__
# define __manager_thread (&__pthread_manager_thread)
#else
# define __manager_thread __pthread_manager_threadp
diff --git a/libpthread/linuxthreads/libc-cancellation.c b/libpthread/linuxthreads/libc-cancellation.c
index d97359b22..e41e9c81a 100644
--- a/libpthread/linuxthreads/libc-cancellation.c
+++ b/libpthread/linuxthreads/libc-cancellation.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 <rpc/rpc.h>
@@ -31,9 +30,6 @@
weak_extern (__pthread_do_exit)
# endif
-int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
-strong_alias (__libc_multiple_threads, __librt_multiple_threads)
-
/* The next two functions are similar to pthread_setcanceltype() but
more specialized for the use in the cancelable functions like write().
They do not need to check parameters etc. */
diff --git a/libpthread/linuxthreads/libc_pthread_init.c b/libpthread/linuxthreads/libc_pthread_init.c
index f89c2872e..384bf2f7f 100644
--- a/libpthread/linuxthreads/libc_pthread_init.c
+++ b/libpthread/linuxthreads/libc_pthread_init.c
@@ -13,29 +13,24 @@
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 <locale.h>
#include <stdlib.h>
#include <string.h>
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
#include <tls.h>
#endif
#include "internals.h"
-#ifdef SHARED
-/* Experimentally off - libc_hidden_proto(memcpy) */
-#endif
-#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
-libc_hidden_proto(uselocale)
-#endif
+int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
+strong_alias (__libc_multiple_threads, __librt_multiple_threads)
+
int *
-__libc_pthread_init (functions)
- const struct pthread_functions *functions;
+__libc_pthread_init(const struct pthread_functions *functions)
{
#ifdef SHARED
/* We copy the content of the variable pointed to by the FUNCTIONS
@@ -45,7 +40,7 @@ __libc_pthread_init (functions)
sizeof (__libc_pthread_functions));
#endif
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
/* Initialize thread-locale current locale to point to the global one.
With __thread support, the variable's initializer takes care of this. */
__uselocale (LC_GLOBAL_LOCALE);
diff --git a/libpthread/linuxthreads/lockfile.c b/libpthread/linuxthreads/lockfile.c
index 5266b1848..1f6584a88 100644
--- a/libpthread/linuxthreads/lockfile.c
+++ b/libpthread/linuxthreads/lockfile.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 <bits/libc-lock.h>
#include <stdio.h>
diff --git a/libpthread/linuxthreads/manager.c b/libpthread/linuxthreads/manager.c
index b0a2a3712..3c5bee876 100644
--- a/libpthread/linuxthreads/manager.c
+++ b/libpthread/linuxthreads/manager.c
@@ -126,13 +126,13 @@ __pthread_manager(void *arg)
#ifdef INIT_THREAD_SELF
INIT_THREAD_SELF(self, 1);
#endif
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
/* Set the error variable. */
self->p_errnop = &self->p_errno;
self->p_h_errnop = &self->p_h_errno;
#endif
/* Block all signals except __pthread_sig_cancel and SIGTRAP */
- sigfillset(&manager_mask);
+ __sigfillset(&manager_mask);
sigdelset(&manager_mask, __pthread_sig_cancel); /* for thread termination */
sigdelset(&manager_mask, SIGTRAP); /* for debugging purposes */
if (__pthread_threads_debug && __pthread_sig_debug > 0)
@@ -289,11 +289,11 @@ pthread_start_thread(void *arg)
__sched_setscheduler(THREAD_GETMEM(self, p_pid),
SCHED_OTHER, &default_params);
}
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
/* Initialize thread-locale current locale to point to the global one.
With __thread support, the variable's initializer takes care of this. */
__uselocale (LC_GLOBAL_LOCALE);
-#else
+#elif defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Initialize __resp. */
__resp = &self->p_res;
#endif
@@ -333,7 +333,7 @@ pthread_start_thread_event(void *arg)
pthread_start_thread (arg);
}
-#if defined USE_TLS && !FLOATING_STACKS
+#if defined __UCLIBC_HAS_TLS__ && !FLOATING_STACKS
# error "TLS can only work with floating stacks"
#endif
@@ -351,7 +351,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
char * guardaddr;
size_t stacksize, guardsize;
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
/* TLS cannot work with fixed thread descriptor addresses. */
assert (default_new_thread == NULL);
#endif
@@ -360,7 +360,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
{
#ifdef _STACK_GROWS_UP
/* The user provided a stack. */
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
/* This value is not needed. */
new_thread = (pthread_descr) attr->__stackaddr;
new_thread_bottom = (char *) new_thread;
@@ -381,7 +381,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
addresses, stackaddr would be the lowest address in the stack
segment, so that it is consistently close to the initial sp
value. */
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
new_thread = (pthread_descr) attr->__stackaddr;
# else
new_thread =
@@ -394,7 +394,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
#ifndef THREAD_SELF
__pthread_nonstandard_stacks = 1;
#endif
-#ifndef USE_TLS
+#ifndef __UCLIBC_HAS_TLS__
/* Clear the thread data structure. */
memset (new_thread, '\0', sizeof (*new_thread));
#endif
@@ -438,31 +438,31 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
mprotect (guardaddr, guardsize, PROT_NONE);
new_thread_bottom = (char *) map_addr;
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
new_thread = ((pthread_descr) (new_thread_bottom + stacksize
+ guardsize));
# else
new_thread = ((pthread_descr) (new_thread_bottom + stacksize
+ guardsize)) - 1;
# endif
-# elif _STACK_GROWS_DOWN
+# elif defined _STACK_GROWS_DOWN
guardaddr = map_addr;
if (guardsize > 0)
mprotect (guardaddr, guardsize, PROT_NONE);
new_thread_bottom = (char *) map_addr + guardsize;
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
new_thread = ((pthread_descr) (new_thread_bottom + stacksize));
# else
new_thread = ((pthread_descr) (new_thread_bottom + stacksize)) - 1;
# endif
-# elif _STACK_GROWS_UP
+# elif defined _STACK_GROWS_UP
guardaddr = map_addr + stacksize;
if (guardsize > 0)
mprotect (guardaddr, guardsize, PROT_NONE);
new_thread = (pthread_descr) map_addr;
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
new_thread_bottom = (char *) new_thread;
# else
new_thread_bottom = (char *) (new_thread + 1);
@@ -597,11 +597,11 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
int pagesize = __getpagesize();
int saved_errno = 0;
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
new_thread = _dl_allocate_tls (NULL);
if (new_thread == NULL)
return EAGAIN;
-# if TLS_DTV_AT_TP
+# if defined(TLS_DTV_AT_TP)
/* pthread_descr is below TP. */
new_thread = (pthread_descr) ((char *) new_thread - TLS_PRE_TCB_SIZE);
# endif
@@ -621,8 +621,8 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
{
if (sseg >= PTHREAD_THREADS_MAX)
{
-#ifdef USE_TLS
-# if TLS_DTV_AT_TP
+#ifdef __UCLIBC_HAS_TLS__
+# if defined(TLS_DTV_AT_TP)
new_thread = (pthread_descr) ((char *) new_thread + TLS_PRE_TCB_SIZE);
# endif
_dl_deallocate_tls (new_thread, true);
@@ -635,7 +635,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
pagesize, &stack_addr, &new_thread_bottom,
&guardaddr, &guardsize, &stksize) == 0)
{
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
new_thread->p_stackaddr = stack_addr;
#else
new_thread = (pthread_descr) stack_addr;
@@ -657,18 +657,18 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
new_thread_id = sseg + pthread_threads_counter;
/* Initialize the thread descriptor. Elements which have to be
initialized to zero already have this value. */
-#if !defined USE_TLS || !TLS_DTV_AT_TP
+#if !defined __UCLIBC_HAS_TLS__ || !TLS_DTV_AT_TP
new_thread->p_header.data.tcb = new_thread;
new_thread->p_header.data.self = new_thread;
#endif
-#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
+#if TLS_MULTIPLE_THREADS_IN_TCB || !defined __UCLIBC_HAS_TLS__ || !TLS_DTV_AT_TP
new_thread->p_multiple_threads = 1;
#endif
new_thread->p_tid = new_thread_id;
new_thread->p_lock = &(__pthread_handles[sseg].h_lock);
new_thread->p_cancelstate = PTHREAD_CANCEL_ENABLE;
new_thread->p_canceltype = PTHREAD_CANCEL_DEFERRED;
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
new_thread->p_errnop = &new_thread->p_errno;
new_thread->p_h_errnop = &new_thread->p_h_errno;
new_thread->p_resp = &new_thread->p_res;
@@ -742,15 +742,15 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
pid = __clone2(pthread_start_thread_event,
(void **)new_thread_bottom,
(char *)stack_addr - new_thread_bottom,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
pid = __clone(pthread_start_thread_event, (void *) new_thread_bottom,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
#else
pid = __clone(pthread_start_thread_event, stack_addr,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
#endif
saved_errno = errno;
@@ -783,15 +783,15 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
pid = __clone2(pthread_start_thread,
(void **)new_thread_bottom,
(char *)stack_addr - new_thread_bottom,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
pid = __clone(pthread_start_thread, (void *) new_thread_bottom,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
#else
pid = __clone(pthread_start_thread, stack_addr,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
__pthread_sig_cancel, new_thread);
#endif /* !NEED_SEPARATE_REGISTER_STACK */
saved_errno = errno;
@@ -806,8 +806,8 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
- new_thread_bottom);
munmap((caddr_t)new_thread_bottom,
2 * stacksize + new_thread->p_guardsize);
-#elif _STACK_GROWS_UP
-# ifdef USE_TLS
+#elif defined _STACK_GROWS_UP
+# ifdef __UCLIBC_HAS_TLS__
size_t stacksize = guardaddr - stack_addr;
munmap(stack_addr, stacksize + guardsize);
# else
@@ -815,7 +815,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
munmap(new_thread, stacksize + guardsize);
# endif
#else
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
size_t stacksize = stack_addr - new_thread_bottom;
# else
size_t stacksize = (char *)(new_thread+1) - new_thread_bottom;
@@ -823,8 +823,8 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
munmap(new_thread_bottom - guardsize, guardsize + stacksize);
#endif
}
-#ifdef USE_TLS
-# if TLS_DTV_AT_TP
+#ifdef __UCLIBC_HAS_TLS__
+# if defined(TLS_DTV_AT_TP)
new_thread = (pthread_descr) ((char *) new_thread + TLS_PRE_TCB_SIZE);
# endif
_dl_deallocate_tls (new_thread, true);
@@ -890,16 +890,17 @@ static void pthread_free(pthread_descr th)
/* Free the stack and thread descriptor area */
char *guardaddr = th->p_guardaddr;
#ifdef _STACK_GROWS_UP
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
size_t stacksize = guardaddr - th->p_stackaddr;
+ guardaddr = th->p_stackaddr;
# else
size_t stacksize = guardaddr - (char *)th;
-# endif
guardaddr = (char *)th;
+# endif
#else
/* Guardaddr is always set, even if guardsize is 0. This allows
us to compute everything else. */
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
size_t stacksize = th->p_stackaddr - guardaddr - guardsize;
# else
size_t stacksize = (char *)(th+1) - guardaddr - guardsize;
@@ -915,8 +916,8 @@ static void pthread_free(pthread_descr th)
}
-#ifdef USE_TLS
-# if TLS_DTV_AT_TP
+#ifdef __UCLIBC_HAS_TLS__
+# if defined(TLS_DTV_AT_TP)
th = (pthread_descr) ((char *) th + TLS_PRE_TCB_SIZE);
# endif
_dl_deallocate_tls (th, true);
diff --git a/libpthread/linuxthreads/pt-machine.c b/libpthread/linuxthreads/pt-machine.c
index 5cd477ce9..d932cf84b 100644
--- a/libpthread/linuxthreads/pt-machine.c
+++ b/libpthread/linuxthreads/pt-machine.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/>. */
#define PT_EI
diff --git a/libpthread/linuxthreads/ptcleanup.c b/libpthread/linuxthreads/ptcleanup.c
index 6213b56f3..88b9453ff 100644
--- a/libpthread/linuxthreads/ptcleanup.c
+++ b/libpthread/linuxthreads/ptcleanup.c
@@ -20,8 +20,8 @@
#include <setjmp.h>
#include "pthread.h"
#include "internals.h"
-#ifndef NO_PTR_DEMANGLE
#include <jmpbuf-unwind.h>
+#ifndef NO_PTR_DEMANGLE
#define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b,c)
#else
#define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b)
@@ -49,13 +49,13 @@ void __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
c != NULL && __JMPBUF_UNWINDS(target, c, demangle_ptr);
c = c->__prev)
{
-#if _STACK_GROWS_DOWN
+#ifdef _STACK_GROWS_DOWN
if ((char *) c <= targetframe)
{
c = NULL;
break;
}
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
if ((char *) c >= targetframe)
{
c = NULL;
diff --git a/libpthread/linuxthreads/ptclock_gettime.c b/libpthread/linuxthreads/ptclock_gettime.c
index 755f83d10..dc28d0c68 100644
--- a/libpthread/linuxthreads/ptclock_gettime.c
+++ b/libpthread/linuxthreads/ptclock_gettime.c
@@ -12,13 +12,11 @@
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 <time.h>
-#include <libc-internal.h>
#include "internals.h"
#include "spinlock.h"
diff --git a/libpthread/linuxthreads/ptclock_settime.c b/libpthread/linuxthreads/ptclock_settime.c
index a4f218c77..bea015d2c 100644
--- a/libpthread/linuxthreads/ptclock_settime.c
+++ b/libpthread/linuxthreads/ptclock_settime.c
@@ -12,13 +12,11 @@
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 <time.h>
-#include <libc-internal.h>
#include "internals.h"
#include "spinlock.h"
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 853aeea92..71404acf1 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -23,8 +23,6 @@
#include <bits/libc-lock.h>
#include "fork.h"
-extern int __libc_fork (void);
-
pid_t __pthread_fork (struct fork_block *b)
{
pid_t pid;
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 4c44252ab..5dccd939f 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -37,22 +37,20 @@
# error "This must not happen"
#endif
-/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern __typeof(sigaction) __libc_sigaction;
-
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
/* These variables are used by the setup code. */
extern int _errno;
extern int _h_errno;
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* We need the global/static resolver state here. */
# include <resolv.h>
# undef _res
-
-extern struct __res_state _res;
+extern struct __res_state *__resp;
+# endif
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
/* We need only a few variables. */
#define manager_thread __pthread_manager_threadp
@@ -69,10 +67,9 @@ struct _pthread_descr_struct __pthread_initial_thread = {
.p_tid = PTHREAD_THREADS_MAX,
.p_lock = &__pthread_handles[0].h_lock,
.p_start_args = PTHREAD_START_ARGS_INITIALIZER(NULL),
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
.p_errnop = &_errno,
.p_h_errnop = &_h_errno,
- .p_resp = &_res,
#endif
.p_userstack = 1,
.p_resume_count = __ATOMIC_INITIALIZER,
@@ -89,7 +86,7 @@ struct _pthread_descr_struct __pthread_manager_thread = {
.p_header.data.multiple_threads = 1,
.p_lock = &__pthread_handles[1].h_lock,
.p_start_args = PTHREAD_START_ARGS_INITIALIZER(__pthread_manager),
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
.p_errnop = &__pthread_manager_thread.p_errno,
#endif
.p_nr = 1,
@@ -101,7 +98,7 @@ struct _pthread_descr_struct __pthread_manager_thread = {
/* Pointer to the main thread (the father of the thread manager thread) */
/* Originally, this is the initial thread, but this changes after fork() */
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
pthread_descr __pthread_main_thread;
#else
pthread_descr __pthread_main_thread = &__pthread_initial_thread;
@@ -227,13 +224,13 @@ extern void *__dso_handle __attribute__ ((weak));
#endif
-#if defined USE_TLS && !defined SHARED
+#if defined __UCLIBC_HAS_TLS__ && !defined SHARED
extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
#endif
struct pthread_functions __pthread_functions =
{
-#if !(USE_TLS && HAVE___THREAD)
+#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__
.ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set,
.ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get,
.ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address,
@@ -295,7 +292,7 @@ static int *__libc_multiple_threads_ptr;
void
__pthread_initialize_minimal(void)
{
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
pthread_descr self;
/* First of all init __pthread_handles[0] and [1] if needed. */
@@ -307,7 +304,7 @@ __pthread_initialize_minimal(void)
/* Unlike in the dynamically linked case the dynamic linker has not
taken care of initializing the TLS data structures. */
__libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
-# elif !USE___THREAD
+# elif !defined __UCLIBC_HAS_TLS__
if (__builtin_expect (GL(dl_tls_dtv_slotinfo_list) == NULL, 0))
{
tcbhead_t *tcbp;
@@ -363,7 +360,7 @@ cannot allocate TLS data structures for initial thread\n";
self->p_nextlive = self->p_prevlive = self;
self->p_tid = PTHREAD_THREADS_MAX;
self->p_lock = &__pthread_handles[0].h_lock;
-# ifndef HAVE___THREAD
+# ifndef __UCLIBC_HAS_TLS__
self->p_errnop = &_errno;
self->p_h_errnop = &_h_errno;
# endif
@@ -380,7 +377,7 @@ cannot allocate TLS data structures for initial thread\n";
/* And fill in the pointer the the thread __pthread_handles array. */
__pthread_handles[0].h_descr = self;
-#else /* USE_TLS */
+#else /* __UCLIBC_HAS_TLS__ */
/* First of all init __pthread_handles[0] and [1]. */
# if __LT_SPINLOCK_INIT != 0
@@ -398,7 +395,7 @@ cannot allocate TLS data structures for initial thread\n";
#endif
#if HP_TIMING_AVAIL
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
self->p_cpuclock_offset = GL(dl_cpuclock_offset);
# else
__pthread_initial_thread.p_cpuclock_offset = GL(dl_cpuclock_offset);
@@ -442,7 +439,7 @@ __pthread_init_max_stacksize(void)
__pthread_max_stacksize = max_stack;
if (max_stack / 4 < __MAX_ALLOCA_CUTOFF)
{
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
pthread_descr self = THREAD_SELF;
self->p_alloca_cutoff = max_stack / 4;
#else
@@ -451,10 +448,8 @@ __pthread_init_max_stacksize(void)
}
}
-/* psm: we do not have any ld.so support yet
- * remove the USE_TLS guard if nptl is added */
-#if defined SHARED && defined USE_TLS
-# if USE___THREAD
+#if defined SHARED && defined __UCLIBC_HAS_TLS__
+# ifdef __UCLIBC_HAS_TLS__
/* When using __thread for this, we do it in libc so as not
to give libpthread its own TLS segment just for this. */
extern void **__libc_dl_error_tsd (void) __attribute__ ((const));
@@ -467,14 +462,14 @@ __libc_dl_error_tsd (void)
# endif
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
static __inline__ void __attribute__((always_inline))
init_one_static_tls (pthread_descr descr, struct link_map *map)
{
-# if TLS_TCB_AT_TP
+# if defined(TLS_TCB_AT_TP)
dtv_t *dtv = GET_DTV (descr);
void *dest = (char *) descr - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+# elif defined(TLS_DTV_AT_TP)
dtv_t *dtv = GET_DTV ((pthread_descr) ((char *) descr + TLS_PRE_TCB_SIZE));
void *dest = (char *) descr + map->l_tls_offset + TLS_PRE_TCB_SIZE;
# else
@@ -486,7 +481,7 @@ init_one_static_tls (pthread_descr descr, struct link_map *map)
dtv[map->l_tls_modid].pointer.is_static = true;
/* Initialize the memory. */
- memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
+ memset (mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
'\0', map->l_tls_blocksize - map->l_tls_initimage_size);
}
@@ -536,18 +531,20 @@ static void pthread_initialize(void)
(char *)(((long)CURRENT_STACK_FRAME - 2 * STACK_SIZE) & ~(STACK_SIZE - 1));
# endif
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
/* Update the descriptor for the initial thread. */
THREAD_SETMEM (((pthread_descr) NULL), p_pid, __getpid());
-# ifndef HAVE___THREAD
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Likewise for the resolver state _res. */
- THREAD_SETMEM (((pthread_descr) NULL), p_resp, &_res);
+ THREAD_SETMEM (((pthread_descr) NULL), p_resp, __resp);
# endif
#else
/* Update the descriptor for the initial thread. */
__pthread_initial_thread.p_pid = __getpid();
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Likewise for the resolver state _res. */
- __pthread_initial_thread.p_resp = &_res;
+ __pthread_initial_thread.p_resp = __resp;
+# endif
#endif
#if !__ASSUME_REALTIME_SIGNALS
/* Initialize real-time signals. */
@@ -556,22 +553,19 @@ static void pthread_initialize(void)
/* Setup signal handlers for the initial thread.
Since signal handlers are shared between threads, these settings
will be inherited by all other threads. */
+ memset(&sa, 0, sizeof(sa));
sa.sa_handler = pthread_handle_sigrestart;
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
__libc_sigaction(__pthread_sig_restart, &sa, NULL);
sa.sa_handler = pthread_handle_sigcancel;
sigaddset(&sa.sa_mask, __pthread_sig_restart);
- // sa.sa_flags = 0;
__libc_sigaction(__pthread_sig_cancel, &sa, NULL);
if (__pthread_sig_debug > 0) {
sa.sa_handler = pthread_handle_sigdebug;
- sigemptyset(&sa.sa_mask);
- // sa.sa_flags = 0;
+ __sigemptyset(&sa.sa_mask);
__libc_sigaction(__pthread_sig_debug, &sa, NULL);
}
/* Initially, block __pthread_sig_restart. Will be unblocked on demand. */
- sigemptyset(&mask);
+ __sigemptyset(&mask);
sigaddset(&mask, __pthread_sig_restart);
sigprocmask(SIG_BLOCK, &mask, NULL);
/* And unblock __pthread_sig_cancel if it has been blocked. */
@@ -591,9 +585,7 @@ static void pthread_initialize(void)
/* How many processors. */
__pthread_smp_kernel = is_smp_system ();
-/* psm: we do not have any ld.so support yet
- * remove the USE_TLS guard if nptl is added */
-#if defined SHARED && defined USE_TLS
+#if defined SHARED && defined __UCLIBC_HAS_TLS__
/* Transfer the old value from the dynamic linker's internal location. */
*__libc_dl_error_tsd () = *(*GL(dl_error_catch_tsd)) ();
GL(dl_error_catch_tsd) = &__libc_dl_error_tsd;
@@ -608,9 +600,20 @@ static void pthread_initialize(void)
__pthread_mutex_lock (&GL(dl_load_lock).mutex);
#endif
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
GL(dl_init_static_tls) = &__pthread_init_static_tls;
#endif
+
+ /* uClibc-specific stdio initialization for threads. */
+ {
+ FILE *fp;
+ _stdio_user_locking = 0; /* 2 if threading not initialized */
+ for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen) {
+ if (fp->__user_locking != 1) {
+ fp->__user_locking = 0;
+ }
+ }
+ }
}
void __pthread_initialize(void)
@@ -625,12 +628,12 @@ int __pthread_initialize_manager(void)
struct pthread_request request;
int report_events;
pthread_descr mgr;
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
tcbhead_t *tcbp;
#endif
__pthread_multiple_threads = 1;
-#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
+#if TLS_MULTIPLE_THREADS_IN_TCB || !defined __UCLIBC_HAS_TLS__ || !TLS_DTV_AT_TP
__pthread_main_thread->p_multiple_threads = 1;
#endif
*__libc_multiple_threads_ptr = 1;
@@ -657,7 +660,7 @@ int __pthread_initialize_manager(void)
return -1;
}
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
/* Allocate memory for the thread descriptor and the dtv. */
tcbp = _dl_allocate_tls (NULL);
if (tcbp == NULL) {
@@ -667,9 +670,9 @@ int __pthread_initialize_manager(void)
return -1;
}
-# if TLS_TCB_AT_TP
+# if defined(TLS_TCB_AT_TP)
mgr = (pthread_descr) tcbp;
-# elif TLS_DTV_AT_TP
+# elif defined(TLS_DTV_AT_TP)
/* pthread_descr is located right below tcbhead_t which _dl_allocate_tls
returns. */
mgr = (pthread_descr) ((char *) tcbp - TLS_PRE_TCB_SIZE);
@@ -677,7 +680,7 @@ int __pthread_initialize_manager(void)
__pthread_handles[1].h_descr = manager_thread = mgr;
/* Initialize the descriptor. */
-#if !defined USE_TLS || !TLS_DTV_AT_TP
+#if !defined __UCLIBC_HAS_TLS__ || !TLS_DTV_AT_TP
mgr->p_header.data.tcb = tcbp;
mgr->p_header.data.self = mgr;
mgr->p_header.data.multiple_threads = 1;
@@ -685,7 +688,7 @@ int __pthread_initialize_manager(void)
mgr->p_multiple_threads = 1;
#endif
mgr->p_lock = &__pthread_handles[1].h_lock;
-# ifndef HAVE___THREAD
+# ifndef __UCLIBC_HAS_TLS__
mgr->p_errnop = &mgr->p_errno;
# endif
mgr->p_start_args = (struct pthread_start_args) PTHREAD_START_ARGS_INITIALIZER(__pthread_manager);
@@ -703,7 +706,7 @@ int __pthread_initialize_manager(void)
/* Start the thread manager */
pid = 0;
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
if (__linuxthreads_initial_report_events != 0)
THREAD_SETMEM (((pthread_descr) NULL), p_report_events,
__linuxthreads_initial_report_events);
@@ -722,7 +725,7 @@ int __pthread_initialize_manager(void)
uint32_t mask = __td_eventmask (TD_CREATE);
uint32_t event_bits;
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
event_bits = THREAD_GETMEM_NC (((pthread_descr) NULL),
p_eventbuf.eventmask.event_bits[idx]);
#else
@@ -738,17 +741,17 @@ int __pthread_initialize_manager(void)
pid = __clone2(__pthread_manager_event,
(void **) __pthread_manager_thread_bos,
THREAD_MANAGER_STACK_SIZE,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
mgr);
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
pid = __clone(__pthread_manager_event,
(void **) __pthread_manager_thread_bos,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
mgr);
#else
pid = __clone(__pthread_manager_event,
(void **) __pthread_manager_thread_tos,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
mgr);
#endif
@@ -778,17 +781,17 @@ int __pthread_initialize_manager(void)
#ifdef NEED_SEPARATE_REGISTER_STACK
pid = __clone2(__pthread_manager, (void **) __pthread_manager_thread_bos,
THREAD_MANAGER_STACK_SIZE,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
-#elif _STACK_GROWS_UP
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
+#elif defined _STACK_GROWS_UP
pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_bos,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
#else
pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos,
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
+ CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
#endif
}
if (__builtin_expect (pid, 0) == -1) {
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
_dl_deallocate_tls (tcbp, true);
#endif
free(__pthread_manager_thread_bos);
@@ -829,8 +832,7 @@ int __pthread_create(pthread_t *thread, const pthread_attr_t *attr,
request.req_args.create.attr = attr;
request.req_args.create.fn = start_routine;
request.req_args.create.arg = arg;
- sigprocmask(SIG_SETMASK, (const sigset_t *) NULL,
- &request.req_args.create.mask);
+ sigprocmask(SIG_SETMASK, NULL, &request.req_args.create.mask);
TEMP_FAILURE_RETRY(write_not_cancel(__pthread_manager_request,
(char *) &request, sizeof(request)));
suspend(self);
@@ -891,7 +893,7 @@ pthread_descr __pthread_self_stack(void)
if (sp >= __pthread_manager_thread_bos && sp < __pthread_manager_thread_tos)
return manager_thread;
h = __pthread_handles + 2;
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
# ifdef _STACK_GROWS_UP
while (h->h_descr == NULL
|| ! (sp >= h->h_descr->p_stackaddr && sp < h->h_descr->p_guardaddr))
@@ -971,6 +973,10 @@ static void pthread_onexit_process(int retcode, void *arg)
struct pthread_request request;
pthread_descr self = thread_self();
+ /* Make sure we come back here after suspend(), in case we entered
+ from a signal handler. */
+ THREAD_SETMEM(self, p_signal_jmp, NULL);
+
request.req_thread = self;
request.req_kind = REQ_PROCESS_EXIT;
request.req_args.exit.code = retcode;
@@ -981,7 +987,7 @@ static void pthread_onexit_process(int retcode, void *arg)
children, so that timings for main thread account for all threads. */
if (self == __pthread_main_thread)
{
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
waitpid(manager_thread->p_pid, NULL, __WCLONE);
#else
waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);
@@ -989,9 +995,9 @@ static void pthread_onexit_process(int retcode, void *arg)
/* Since all threads have been asynchronously terminated
(possibly holding locks), free cannot be used any more.
For mtrace, we'd like to print something though. */
- /* #ifdef USE_TLS
+ /* #ifdef __UCLIBC_HAS_TLS__
tcbhead_t *tcbp = (tcbhead_t *) manager_thread;
- # if TLS_DTV_AT_TP
+ # if defined(TLS_DTV_AT_TP)
tcbp = (tcbhead_t) ((char *) tcbp + TLS_PRE_TCB_SIZE);
# endif
_dl_deallocate_tls (tcbp, true);
@@ -1047,7 +1053,7 @@ static void pthread_handle_sigcancel(int sig)
/* Main thread should accumulate times for thread manager and its
children, so that timings for main thread account for all threads. */
if (self == __pthread_main_thread) {
-#ifdef USE_TLS
+#ifdef __UCLIBC_HAS_TLS__
waitpid(manager_thread->p_pid, NULL, __WCLONE);
#else
waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);
@@ -1108,11 +1114,13 @@ void __pthread_reset_main_thread(void)
__pthread_main_thread = self;
THREAD_SETMEM(self, p_nextlive, self);
THREAD_SETMEM(self, p_prevlive, self);
-#if !(USE_TLS && HAVE___THREAD)
+#ifndef __UCLIBC_HAS_TLS__
/* Now this thread modifies the global variables. */
THREAD_SETMEM(self, p_errnop, &_errno);
THREAD_SETMEM(self, p_h_errnop, &_h_errno);
- THREAD_SETMEM(self, p_resp, &_res);
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
+ THREAD_SETMEM(self, p_resp, __resp);
+# endif
#endif
#ifndef FLOATING_STACKS
@@ -1144,9 +1152,9 @@ void __pthread_kill_other_threads_np(void)
/* Reset the signal handlers behaviour for the signals the
implementation uses since this would be passed to the new
process. */
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
+ memset(&sa, 0, sizeof(sa));
+ if (SIG_DFL) /* if it's constant zero, it's already done */
+ sa.sa_handler = SIG_DFL;
__libc_sigaction(__pthread_sig_restart, &sa, NULL);
__libc_sigaction(__pthread_sig_cancel, &sa, NULL);
if (__pthread_sig_debug > 0)
@@ -1198,13 +1206,13 @@ void __pthread_wait_for_restart_signal(pthread_descr self)
void __pthread_restart_old(pthread_descr th)
{
- if (atomic_increment(&th->p_resume_count) == -1)
+ if (pthread_atomic_increment(&th->p_resume_count) == -1)
kill(th->p_pid, __pthread_sig_restart);
}
void __pthread_suspend_old(pthread_descr self)
{
- if (atomic_decrement(&self->p_resume_count) <= 0)
+ if (pthread_atomic_decrement(&self->p_resume_count) <= 0)
__pthread_wait_for_restart_signal(self);
}
@@ -1215,7 +1223,7 @@ __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime)
int was_signalled = 0;
sigjmp_buf jmpbuf;
- if (atomic_decrement(&self->p_resume_count) == 0) {
+ if (pthread_atomic_decrement(&self->p_resume_count) == 0) {
/* Set up a longjmp handler for the restart signal, unblock
the signal and sleep. */
@@ -1223,7 +1231,7 @@ __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime)
THREAD_SETMEM(self, p_signal_jmp, &jmpbuf);
THREAD_SETMEM(self, p_signal, 0);
/* Unblock the restart signal */
- sigemptyset(&unblock);
+ __sigemptyset(&unblock);
sigaddset(&unblock, __pthread_sig_restart);
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
@@ -1242,7 +1250,7 @@ __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime)
/* Sleep for the required duration. If woken by a signal,
resume waiting as required by Single Unix Specification. */
- if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
+ if (reltime.tv_sec < 0 || nanosleep(&reltime, NULL) == 0)
break;
}
@@ -1272,9 +1280,9 @@ __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime)
being delivered. */
if (!was_signalled) {
- if (atomic_increment(&self->p_resume_count) != -1) {
+ if (pthread_atomic_increment(&self->p_resume_count) != -1) {
__pthread_wait_for_restart_signal(self);
- atomic_decrement(&self->p_resume_count); /* should be zero now! */
+ pthread_atomic_decrement(&self->p_resume_count); /* should be zero now! */
/* woke spontaneously and consumed restart signal */
return 1;
}
@@ -1310,7 +1318,7 @@ __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime)
THREAD_SETMEM(self, p_signal_jmp, &jmpbuf);
THREAD_SETMEM(self, p_signal, 0);
/* Unblock the restart signal */
- sigemptyset(&unblock);
+ __sigemptyset(&unblock);
sigaddset(&unblock, __pthread_sig_restart);
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
@@ -1329,7 +1337,7 @@ __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime)
/* Sleep for the required duration. If woken by a signal,
resume waiting as required by Single Unix Specification. */
- if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
+ if (reltime.tv_sec < 0 || nanosleep(&reltime, NULL) == 0)
break;
}
diff --git a/libpthread/linuxthreads/pthread_atfork.c b/libpthread/linuxthreads/pthread_atfork.c
index 2464acb6b..436c3b400 100644
--- a/libpthread/linuxthreads/pthread_atfork.c
+++ b/libpthread/linuxthreads/pthread_atfork.c
@@ -30,9 +30,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 "internals.h"
#include <fork.h>
diff --git a/libpthread/linuxthreads/pthread_setegid.c b/libpthread/linuxthreads/pthread_setegid.c
index e357bb9ef..ff0f250a5 100644
--- a/libpthread/linuxthreads/pthread_setegid.c
+++ b/libpthread/linuxthreads/pthread_setegid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_seteuid.c b/libpthread/linuxthreads/pthread_seteuid.c
index 6a1464c58..a5423a9f3 100644
--- a/libpthread/linuxthreads/pthread_seteuid.c
+++ b/libpthread/linuxthreads/pthread_seteuid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setgid.c b/libpthread/linuxthreads/pthread_setgid.c
index 31b5a595b..3e49b19bf 100644
--- a/libpthread/linuxthreads/pthread_setgid.c
+++ b/libpthread/linuxthreads/pthread_setgid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setregid.c b/libpthread/linuxthreads/pthread_setregid.c
index 8964eb774..21cabab61 100644
--- a/libpthread/linuxthreads/pthread_setregid.c
+++ b/libpthread/linuxthreads/pthread_setregid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setresgid.c b/libpthread/linuxthreads/pthread_setresgid.c
index a330afcdb..1cbf1b5f7 100644
--- a/libpthread/linuxthreads/pthread_setresgid.c
+++ b/libpthread/linuxthreads/pthread_setresgid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setresuid.c b/libpthread/linuxthreads/pthread_setresuid.c
index 0fa28954d..0e35ba8ca 100644
--- a/libpthread/linuxthreads/pthread_setresuid.c
+++ b/libpthread/linuxthreads/pthread_setresuid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setreuid.c b/libpthread/linuxthreads/pthread_setreuid.c
index 78738e3cd..680eb5394 100644
--- a/libpthread/linuxthreads/pthread_setreuid.c
+++ b/libpthread/linuxthreads/pthread_setreuid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/pthread_setuid.c b/libpthread/linuxthreads/pthread_setuid.c
index 107001e26..e1af5a196 100644
--- a/libpthread/linuxthreads/pthread_setuid.c
+++ b/libpthread/linuxthreads/pthread_setuid.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 <pthread.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads/restart.h b/libpthread/linuxthreads/restart.h
index f53642eda..694ec48cf 100644
--- a/libpthread/linuxthreads/restart.h
+++ b/libpthread/linuxthreads/restart.h
@@ -13,7 +13,7 @@
/* GNU Library General Public License for more details. */
#include <signal.h>
-#include <kernel-features.h>
+#include <bits/kernel-features.h>
/* Primitives for controlling thread execution */
diff --git a/libpthread/linuxthreads/rwlock.c b/libpthread/linuxthreads/rwlock.c
index f565f1870..af72876f5 100644
--- a/libpthread/linuxthreads/rwlock.c
+++ b/libpthread/linuxthreads/rwlock.c
@@ -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/>. */
#include <bits/libc-lock.h>
#include <errno.h>
diff --git a/libpthread/linuxthreads/semaphore.c b/libpthread/linuxthreads/semaphore.c
index 392c37bfa..b66735bed 100644
--- a/libpthread/linuxthreads/semaphore.c
+++ b/libpthread/linuxthreads/semaphore.c
@@ -15,6 +15,7 @@
/* Semaphores a la POSIX 1003.1b */
#include <errno.h>
+#include <limits.h>
#include "pthread.h"
#include "semaphore.h"
#include "internals.h"
diff --git a/libpthread/linuxthreads/semaphore.h b/libpthread/linuxthreads/semaphore.h
index 3084209f6..7ab772bfa 100644
--- a/libpthread/linuxthreads/semaphore.h
+++ b/libpthread/linuxthreads/semaphore.h
@@ -17,6 +17,7 @@
#include <features.h>
#include <sys/types.h>
+#include <limits.h>
#ifdef __USE_XOPEN2K
# define __need_timespec
# include <time.h>
@@ -42,7 +43,9 @@ typedef struct
#define SEM_FAILED ((sem_t *) 0)
/* Maximum value the semaphore can have. */
+#ifndef SEM_VALUE_MAX
#define SEM_VALUE_MAX (2147483647)
+#endif
__BEGIN_DECLS
@@ -55,13 +58,13 @@ extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) __THROW;
extern int sem_destroy (sem_t *__sem) __THROW;
/* Open a named semaphore NAME with open flags OFLAG. */
-extern sem_t *sem_open (__const char *__name, int __oflag, ...) __THROW;
+extern sem_t *sem_open (const char *__name, int __oflag, ...) __THROW;
/* Close descriptor for named semaphore SEM. */
extern int sem_close (sem_t *__sem) __THROW;
/* Remove named semaphore NAME. */
-extern int sem_unlink (__const char *__name) __THROW;
+extern int sem_unlink (const char *__name) __THROW;
/* Wait for SEM being posted.
@@ -75,14 +78,14 @@ extern int sem_wait (sem_t *__sem);
This function is a cancellation point and therefore not marked with
__THROW. */
extern int sem_timedwait (sem_t *__restrict __sem,
- __const struct timespec *__restrict __abstime);
+ const struct timespec *__restrict __abstime);
#endif
/* Test whether SEM is posted. */
-extern int sem_trywait (sem_t *__sem) __THROW;
+extern int sem_trywait (sem_t *__sem) __THROWNL;
/* Post SEM. */
-extern int sem_post (sem_t *__sem) __THROW;
+extern int sem_post (sem_t *__sem) __THROWNL;
/* Get current value of SEM and store it in *SVAL. */
extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
diff --git a/libpthread/linuxthreads/signals.c b/libpthread/linuxthreads/signals.c
index 62e83211a..672b8e4d9 100644
--- a/libpthread/linuxthreads/signals.c
+++ b/libpthread/linuxthreads/signals.c
@@ -19,10 +19,6 @@
#include "pthread.h"
#include "internals.h"
#include "spinlock.h"
-#include <ucontext.h>
-
-/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern __typeof(sigaction) __libc_sigaction;
int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
{
@@ -114,7 +110,7 @@ int __pthread_sigaction(int sig, const struct sigaction * act,
newactp = NULL;
if (__libc_sigaction(sig, newactp, oact) == -1)
{
- if (act)
+ if (act && (sig > 0 && sig < NSIG))
__sighandler[sig].old = (arch_sighandler_t) old;
return -1;
}
@@ -153,7 +149,7 @@ int __pthread_sigwait(const sigset_t * set, int * sig)
and if not, install our dummy handler. This is conformant to
POSIX: "The effect of sigwait() on the signal actions for the
signals in set is unspecified." */
- sigfillset(&mask);
+ __sigfillset(&mask);
sigdelset(&mask, __pthread_sig_cancel);
for (s = 1; s < NSIG; s++) {
if (sigismember(set, s) &&
@@ -165,7 +161,7 @@ int __pthread_sigwait(const sigset_t * set, int * sig)
__sighandler[s].old == (arch_sighandler_t) SIG_DFL ||
__sighandler[s].old == (arch_sighandler_t) SIG_IGN) {
sa.sa_handler = __pthread_null_sighandler;
- sigfillset(&sa.sa_mask);
+ __sigfillset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(s, &sa, NULL);
}
diff --git a/libpthread/linuxthreads/specific.c b/libpthread/linuxthreads/specific.c
index 92eec3d99..0daad83f5 100644
--- a/libpthread/linuxthreads/specific.c
+++ b/libpthread/linuxthreads/specific.c
@@ -104,13 +104,14 @@ int pthread_key_delete(pthread_key_t key)
that if the key is reallocated later by pthread_key_create, its
associated values will be NULL in all threads.
- If no threads have been created yet, clear it just in the
- current thread. */
+ If no threads have been created yet, or if we are exiting, clear
+ it just in the current thread. */
struct pthread_key_delete_helper_args args;
args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
- if (__pthread_manager_request != -1)
+ if (__pthread_manager_request != -1
+ && !(__builtin_expect (__pthread_exit_requested, 0)))
{
struct pthread_request request;
@@ -203,14 +204,15 @@ void __pthread_destroy_specifics()
__pthread_lock(THREAD_GETMEM(self, p_lock), self);
for (i = 0; i < PTHREAD_KEY_1STLEVEL_SIZE; i++) {
if (THREAD_GETMEM_NC(self, p_specific[i]) != NULL) {
- free(THREAD_GETMEM_NC(self, p_specific[i]));
+ void *p = THREAD_GETMEM_NC(self, p_specific[i]);
THREAD_SETMEM_NC(self, p_specific[i], NULL);
+ free(p);
}
}
__pthread_unlock(THREAD_GETMEM(self, p_lock));
}
-#if !(USE_TLS && HAVE___THREAD)
+#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__
/* Thread-specific data for libc. */
diff --git a/libpthread/linuxthreads/spinlock.c b/libpthread/linuxthreads/spinlock.c
index f32540286..f0cf19c54 100644
--- a/libpthread/linuxthreads/spinlock.c
+++ b/libpthread/linuxthreads/spinlock.c
@@ -637,8 +637,20 @@ void __pthread_alt_unlock(struct _pthread_fastlock *lock)
#if defined HAS_COMPARE_AND_SWAP
wait_node_dequeue(pp_head, pp_max_prio, p_max_prio);
#endif
+
+ /* Release the spinlock *before* restarting. */
+#if defined TEST_FOR_COMPARE_AND_SWAP
+ if (!__pthread_has_cas)
+#endif
+#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
+ {
+ __pthread_release(&lock->__spinlock);
+ }
+#endif
+
restart(p_max_prio->thr);
- break;
+
+ return;
}
}
diff --git a/libpthread/linuxthreads/spinlock.h b/libpthread/linuxthreads/spinlock.h
index 210ead471..2a3c2277f 100644
--- a/libpthread/linuxthreads/spinlock.h
+++ b/libpthread/linuxthreads/spinlock.h
@@ -172,7 +172,8 @@ static __inline__ int __pthread_alt_trylock (struct _pthread_fastlock * lock)
/* Operations on pthread_atomic, which is defined in internals.h */
-static __inline__ long atomic_increment(struct pthread_atomic *pa)
+static __inline__ long
+pthread_atomic_increment (struct pthread_atomic *pa)
{
long oldval;
@@ -184,7 +185,8 @@ static __inline__ long atomic_increment(struct pthread_atomic *pa)
}
-static __inline__ long atomic_decrement(struct pthread_atomic *pa)
+static __inline__ long
+pthread_atomic_decrement (struct pthread_atomic *pa)
{
long oldval;
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