summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am129
-rw-r--r--Makefile.in809
-rw-r--r--headers.m435
-rw-r--r--pthread/pt-create.c24
-rw-r--r--pthread/pt-internal.h7
-rw-r--r--sysdeps/generic/bits/pthreadtypes.h29
-rw-r--r--sysdeps/generic/pt-rwlock-rdlock.c2
-rw-r--r--sysdeps/hurd/pt-destroy-specific.c11
-rw-r--r--sysdeps/hurd/pt-getspecific.c2
-rw-r--r--sysdeps/hurd/pt-key.h2
-rw-r--r--sysdeps/ia32/bits/atomic.h (renamed from sysdeps/i386/bits/atomic.h)0
-rw-r--r--sysdeps/ia32/bits/memory.h (renamed from sysdeps/i386/bits/memory.h)0
-rw-r--r--sysdeps/ia32/bits/spin-lock.h (renamed from sysdeps/i386/bits/spin-lock.h)0
-rw-r--r--sysdeps/ia32/machine-sp.h (renamed from sysdeps/i386/machine-sp.h)0
-rw-r--r--sysdeps/ia32/pt-machdep.h (renamed from sysdeps/i386/pt-machdep.h)0
-rw-r--r--sysdeps/l4/bits/pthread-np.h38
-rw-r--r--sysdeps/l4/hurd/ia32/pt-machdep.c (renamed from sysdeps/l4/hurd/i386/pt-machdep.c)0
-rw-r--r--sysdeps/l4/hurd/ia32/pt-setup.c (renamed from sysdeps/l4/hurd/i386/pt-setup.c)18
-rw-r--r--sysdeps/l4/hurd/powerpc/pt-machdep.c20
-rw-r--r--sysdeps/l4/hurd/powerpc/pt-setup.c93
-rw-r--r--sysdeps/l4/hurd/pt-kill.c30
-rw-r--r--sysdeps/l4/hurd/pt-sigstate-destroy.c28
-rw-r--r--sysdeps/l4/hurd/pt-sigstate-init.c28
-rw-r--r--sysdeps/l4/hurd/pt-sigstate.c32
-rw-r--r--sysdeps/l4/hurd/pt-sysdep.c2
-rw-r--r--sysdeps/l4/hurd/pt-sysdep.h12
-rw-r--r--sysdeps/l4/pt-block.c4
-rw-r--r--sysdeps/l4/pt-create-np.c47
-rw-r--r--sysdeps/l4/pt-docancel.c3
-rw-r--r--sysdeps/l4/pt-spin.c60
-rw-r--r--sysdeps/l4/pt-stack-alloc.c25
-rw-r--r--sysdeps/l4/pt-thread-alloc.c12
-rw-r--r--sysdeps/l4/pt-thread-halt.c11
-rw-r--r--sysdeps/l4/pt-thread-init.c34
-rw-r--r--sysdeps/l4/pt-thread-start.c68
-rw-r--r--sysdeps/l4/pt-timedblock.c34
-rw-r--r--sysdeps/l4/pt-wakeup.c4
-rw-r--r--sysdeps/mach/hurd/ia32/pt-machdep.c (renamed from sysdeps/mach/hurd/i386/pt-machdep.c)0
-rw-r--r--sysdeps/mach/hurd/ia32/pt-setup.c (renamed from sysdeps/mach/hurd/i386/pt-setup.c)0
-rw-r--r--sysdeps/powerpc/bits/atomic.h84
-rw-r--r--sysdeps/powerpc/bits/machine-lock.h78
-rw-r--r--sysdeps/powerpc/bits/memory.h36
-rw-r--r--sysdeps/powerpc/bits/spin-lock.h108
-rw-r--r--sysdeps/powerpc/machine-sp.h31
-rw-r--r--sysdeps/powerpc/pt-machdep.h29
45 files changed, 1889 insertions, 130 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..24896080
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,129 @@
+# Makefile.am - Makefile template for libpthread.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Hurd.
+#
+# The GNU Hurd is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# The GNU Hurd 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+if ARCH_IA32
+ arch=ia32
+endif
+if ARCH_POWERPC
+ arch=powerpc
+endif
+
+# The source files is scattered over several directories. Add
+# all these directories to the vpath.
+SYSDEP_PATH = $(srcdir)/sysdeps/l4/hurd/${arch} \
+ $(srcdir)/sysdeps/l4/${arch} \
+ $(srcdir)/sysdeps/l4/hurd \
+ $(srcdir)/sysdeps/l4 \
+ $(srcdir)/sysdeps/hurd \
+ $(srcdir)/sysdeps/${arch} \
+ $(srcdir)/sysdeps/generic \
+ $(srcdir)/sysdeps/posix \
+ $(srcdir)/pthread \
+ $(srcdir)/include
+vpath %.c $(SYSDEP_PATH)
+
+AM_CPPFLAGS = -I$(top_builddir)/include -D_GNU_SOURCE=1 -I$(srcdir)/pthread \
+ -I$(top_srcdir)/libc-parts $(addprefix -I, $(SYSDEP_PATH)) \
+ -imacros $(srcdir)/include/libc-symbols.h
+
+# Sources.
+SYSDEPS := lockfile.c
+
+noinst_LIBRARIES = libpthread.a
+libpthread_a_SOURCES = pt-attr.c pt-attr-destroy.c pt-attr-getdetachstate.c \
+ pt-attr-getguardsize.c pt-attr-getinheritsched.c \
+ pt-attr-getschedparam.c pt-attr-getschedpolicy.c pt-attr-getscope.c \
+ pt-attr-getstack.c pt-attr-getstackaddr.c pt-attr-getstacksize.c \
+ pt-attr-init.c pt-attr-setdetachstate.c pt-attr-setguardsize.c \
+ pt-attr-setinheritsched.c pt-attr-setschedparam.c \
+ pt-attr-setschedpolicy.c pt-attr-setscope.c pt-attr-setstack.c \
+ pt-attr-setstackaddr.c pt-attr-setstacksize.c pt-attr.c \
+ pt-barrier-destroy.c pt-barrier-init.c pt-barrier-wait.c \
+ pt-barrier.c pt-barrierattr-destroy.c pt-barrierattr-init.c \
+ pt-barrierattr-getpshared.c pt-barrierattr-setpshared.c \
+ pt-destroy-specific.c pt-init-specific.c \
+ pt-key-create.c pt-key-delete.c \
+ pt-getspecific.c pt-setspecific.c \
+ pt-once.c \
+ pt-alloc.c \
+ pt-create.c \
+ pt-create-np.c \
+ pt-equal.c \
+ pt-dealloc.c \
+ pt-detach.c \
+ pt-exit.c \
+ pt-initialize.c \
+ pt-join.c \
+ pt-self.c \
+ pt-sigmask.c \
+ pt-spin-inlines.c \
+ pt-cleanup.c \
+ pt-setcancelstate.c \
+ pt-setcanceltype.c \
+ pt-testcancel.c \
+ pt-cancel.c \
+ pt-mutexattr.c \
+ pt-mutexattr-destroy.c pt-mutexattr-init.c \
+ pt-mutexattr-getprioceiling.c pt-mutexattr-getprotocol.c \
+ pt-mutexattr-getpshared.c pt-mutexattr-gettype.c \
+ pt-mutexattr-setprioceiling.c pt-mutexattr-setprotocol.c \
+ pt-mutexattr-setpshared.c pt-mutexattr-settype.c \
+ pt-mutex-init.c pt-mutex-destroy.c \
+ pt-mutex-lock.c pt-mutex-trylock.c pt-mutex-timedlock.c \
+ pt-mutex-unlock.c \
+ pt-mutex-getprioceiling.c pt-mutex-setprioceiling.c \
+ pt-rwlock-attr.c \
+ pt-rwlockattr-init.c pt-rwlockattr-destroy.c \
+ pt-rwlockattr-getpshared.c pt-rwlockattr-setpshared.c \
+ pt-rwlock-init.c pt-rwlock-destroy.c \
+ pt-rwlock-rdlock.c pt-rwlock-tryrdlock.c \
+ pt-rwlock-trywrlock.c pt-rwlock-wrlock.c \
+ pt-rwlock-timedrdlock.c pt-rwlock-timedwrlock.c \
+ pt-rwlock-unlock.c \
+ pt-cond.c \
+ pt-condattr-init.c pt-condattr-destroy.c \
+ pt-condattr-getclock.c pt-condattr-getpshared.c \
+ pt-condattr-setclock.c pt-condattr-setpshared.c \
+ pt-cond-destroy.c pt-cond-init.c \
+ pt-cond-brdcast.c \
+ pt-cond-signal.c \
+ pt-cond-wait.c \
+ pt-cond-timedwait.c \
+ pt-stack-alloc.c \
+ pt-thread-alloc.c \
+ pt-thread-start.c \
+ pt-thread-halt.c \
+ pt-thread-init.c \
+ pt-getconcurrency.c pt-setconcurrency.c \
+ pt-block.c \
+ pt-timedblock.c \
+ pt-wakeup.c \
+ pt-docancel.c \
+ pt-sysdep.c \
+ pt-setup.c \
+ pt-machdep.c \
+ pt-spin.c \
+ pt-sigstate-init.c \
+ pt-sigstate-destroy.c \
+ pt-sigstate.c \
+ pt-atfork.c \
+ pt-kill.c \
+ pt-getcpuclockid.c \
+ pt-getschedparam.c pt-setschedparam.c pt-setschedprio.c
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 00000000..26e32873
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,809 @@
+# Makefile.in generated by automake 1.7.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile.am - Makefile template for libpthread.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Hurd.
+#
+# The GNU Hurd is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# The GNU Hurd 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+ARCH_IA32_FALSE = @ARCH_IA32_FALSE@
+ARCH_IA32_TRUE = @ARCH_IA32_TRUE@
+ARCH_POWERPC_FALSE = @ARCH_POWERPC_FALSE@
+ARCH_POWERPC_TRUE = @ARCH_POWERPC_TRUE@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DVIPS = @DVIPS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LATEX = @LATEX@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SORT = @SORT@
+STATIC_GLIBC = @STATIC_GLIBC@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_NM = @ac_ct_NM@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+@ARCH_IA32_TRUE@arch = ia32
+@ARCH_POWERPC_TRUE@arch = powerpc
+
+# The source files is scattered over several directories. Add
+# all these directories to the vpath.
+SYSDEP_PATH = $(srcdir)/sysdeps/l4/hurd/${arch} \
+ $(srcdir)/sysdeps/l4/${arch} \
+ $(srcdir)/sysdeps/l4/hurd \
+ $(srcdir)/sysdeps/l4 \
+ $(srcdir)/sysdeps/hurd \
+ $(srcdir)/sysdeps/${arch} \
+ $(srcdir)/sysdeps/generic \
+ $(srcdir)/sysdeps/posix \
+ $(srcdir)/pthread \
+ $(srcdir)/include
+
+
+AM_CPPFLAGS = -I$(top_builddir)/include -D_GNU_SOURCE=1 -I$(srcdir)/pthread \
+ -I$(top_srcdir)/libc-parts $(addprefix -I, $(SYSDEP_PATH)) \
+ -imacros $(srcdir)/include/libc-symbols.h
+
+
+# Sources.
+SYSDEPS := lockfile.c
+
+noinst_LIBRARIES = libpthread.a
+libpthread_a_SOURCES = pt-attr.c pt-attr-destroy.c pt-attr-getdetachstate.c \
+ pt-attr-getguardsize.c pt-attr-getinheritsched.c \
+ pt-attr-getschedparam.c pt-attr-getschedpolicy.c pt-attr-getscope.c \
+ pt-attr-getstack.c pt-attr-getstackaddr.c pt-attr-getstacksize.c \
+ pt-attr-init.c pt-attr-setdetachstate.c pt-attr-setguardsize.c \
+ pt-attr-setinheritsched.c pt-attr-setschedparam.c \
+ pt-attr-setschedpolicy.c pt-attr-setscope.c pt-attr-setstack.c \
+ pt-attr-setstackaddr.c pt-attr-setstacksize.c pt-attr.c \
+ pt-barrier-destroy.c pt-barrier-init.c pt-barrier-wait.c \
+ pt-barrier.c pt-barrierattr-destroy.c pt-barrierattr-init.c \
+ pt-barrierattr-getpshared.c pt-barrierattr-setpshared.c \
+ pt-destroy-specific.c pt-init-specific.c \
+ pt-key-create.c pt-key-delete.c \
+ pt-getspecific.c pt-setspecific.c \
+ pt-once.c \
+ pt-alloc.c \
+ pt-create.c \
+ pt-create-np.c \
+ pt-equal.c \
+ pt-dealloc.c \
+ pt-detach.c \
+ pt-exit.c \
+ pt-initialize.c \
+ pt-join.c \
+ pt-self.c \
+ pt-sigmask.c \
+ pt-spin-inlines.c \
+ pt-cleanup.c \
+ pt-setcancelstate.c \
+ pt-setcanceltype.c \
+ pt-testcancel.c \
+ pt-cancel.c \
+ pt-mutexattr.c \
+ pt-mutexattr-destroy.c pt-mutexattr-init.c \
+ pt-mutexattr-getprioceiling.c pt-mutexattr-getprotocol.c \
+ pt-mutexattr-getpshared.c pt-mutexattr-gettype.c \
+ pt-mutexattr-setprioceiling.c pt-mutexattr-setprotocol.c \
+ pt-mutexattr-setpshared.c pt-mutexattr-settype.c \
+ pt-mutex-init.c pt-mutex-destroy.c \
+ pt-mutex-lock.c pt-mutex-trylock.c pt-mutex-timedlock.c \
+ pt-mutex-unlock.c \
+ pt-mutex-getprioceiling.c pt-mutex-setprioceiling.c \
+ pt-rwlock-attr.c \
+ pt-rwlockattr-init.c pt-rwlockattr-destroy.c \
+ pt-rwlockattr-getpshared.c pt-rwlockattr-setpshared.c \
+ pt-rwlock-init.c pt-rwlock-destroy.c \
+ pt-rwlock-rdlock.c pt-rwlock-tryrdlock.c \
+ pt-rwlock-trywrlock.c pt-rwlock-wrlock.c \
+ pt-rwlock-timedrdlock.c pt-rwlock-timedwrlock.c \
+ pt-rwlock-unlock.c \
+ pt-cond.c \
+ pt-condattr-init.c pt-condattr-destroy.c \
+ pt-condattr-getclock.c pt-condattr-getpshared.c \
+ pt-condattr-setclock.c pt-condattr-setpshared.c \
+ pt-cond-destroy.c pt-cond-init.c \
+ pt-cond-brdcast.c \
+ pt-cond-signal.c \
+ pt-cond-wait.c \
+ pt-cond-timedwait.c \
+ pt-stack-alloc.c \
+ pt-thread-alloc.c \
+ pt-thread-start.c \
+ pt-thread-halt.c \
+ pt-thread-init.c \
+ pt-getconcurrency.c pt-setconcurrency.c \
+ pt-block.c \
+ pt-timedblock.c \
+ pt-wakeup.c \
+ pt-docancel.c \
+ pt-sysdep.c \
+ pt-setup.c \
+ pt-machdep.c \
+ pt-spin.c \
+ pt-sigstate-init.c \
+ pt-sigstate-destroy.c \
+ pt-sigstate.c \
+ pt-atfork.c \
+ pt-kill.c \
+ pt-getcpuclockid.c \
+ pt-getschedparam.c pt-setschedparam.c pt-setschedprio.c
+
+subdir = libpthread
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libpthread_a_AR = $(AR) cru
+libpthread_a_LIBADD =
+am_libpthread_a_OBJECTS = pt-attr.$(OBJEXT) pt-attr-destroy.$(OBJEXT) \
+ pt-attr-getdetachstate.$(OBJEXT) pt-attr-getguardsize.$(OBJEXT) \
+ pt-attr-getinheritsched.$(OBJEXT) \
+ pt-attr-getschedparam.$(OBJEXT) \
+ pt-attr-getschedpolicy.$(OBJEXT) pt-attr-getscope.$(OBJEXT) \
+ pt-attr-getstack.$(OBJEXT) pt-attr-getstackaddr.$(OBJEXT) \
+ pt-attr-getstacksize.$(OBJEXT) pt-attr-init.$(OBJEXT) \
+ pt-attr-setdetachstate.$(OBJEXT) pt-attr-setguardsize.$(OBJEXT) \
+ pt-attr-setinheritsched.$(OBJEXT) \
+ pt-attr-setschedparam.$(OBJEXT) \
+ pt-attr-setschedpolicy.$(OBJEXT) pt-attr-setscope.$(OBJEXT) \
+ pt-attr-setstack.$(OBJEXT) pt-attr-setstackaddr.$(OBJEXT) \
+ pt-attr-setstacksize.$(OBJEXT) pt-attr.$(OBJEXT) \
+ pt-barrier-destroy.$(OBJEXT) pt-barrier-init.$(OBJEXT) \
+ pt-barrier-wait.$(OBJEXT) pt-barrier.$(OBJEXT) \
+ pt-barrierattr-destroy.$(OBJEXT) pt-barrierattr-init.$(OBJEXT) \
+ pt-barrierattr-getpshared.$(OBJEXT) \
+ pt-barrierattr-setpshared.$(OBJEXT) \
+ pt-destroy-specific.$(OBJEXT) pt-init-specific.$(OBJEXT) \
+ pt-key-create.$(OBJEXT) pt-key-delete.$(OBJEXT) \
+ pt-getspecific.$(OBJEXT) pt-setspecific.$(OBJEXT) \
+ pt-once.$(OBJEXT) pt-alloc.$(OBJEXT) pt-create.$(OBJEXT) \
+ pt-create-np.$(OBJEXT) pt-equal.$(OBJEXT) pt-dealloc.$(OBJEXT) \
+ pt-detach.$(OBJEXT) pt-exit.$(OBJEXT) pt-initialize.$(OBJEXT) \
+ pt-join.$(OBJEXT) pt-self.$(OBJEXT) pt-sigmask.$(OBJEXT) \
+ pt-spin-inlines.$(OBJEXT) pt-cleanup.$(OBJEXT) \
+ pt-setcancelstate.$(OBJEXT) pt-setcanceltype.$(OBJEXT) \
+ pt-testcancel.$(OBJEXT) pt-cancel.$(OBJEXT) \
+ pt-mutexattr.$(OBJEXT) pt-mutexattr-destroy.$(OBJEXT) \
+ pt-mutexattr-init.$(OBJEXT) \
+ pt-mutexattr-getprioceiling.$(OBJEXT) \
+ pt-mutexattr-getprotocol.$(OBJEXT) \
+ pt-mutexattr-getpshared.$(OBJEXT) \
+ pt-mutexattr-gettype.$(OBJEXT) \
+ pt-mutexattr-setprioceiling.$(OBJEXT) \
+ pt-mutexattr-setprotocol.$(OBJEXT) \
+ pt-mutexattr-setpshared.$(OBJEXT) \
+ pt-mutexattr-settype.$(OBJEXT) pt-mutex-init.$(OBJEXT) \
+ pt-mutex-destroy.$(OBJEXT) pt-mutex-lock.$(OBJEXT) \
+ pt-mutex-trylock.$(OBJEXT) pt-mutex-timedlock.$(OBJEXT) \
+ pt-mutex-unlock.$(OBJEXT) pt-mutex-getprioceiling.$(OBJEXT) \
+ pt-mutex-setprioceiling.$(OBJEXT) pt-rwlock-attr.$(OBJEXT) \
+ pt-rwlockattr-init.$(OBJEXT) pt-rwlockattr-destroy.$(OBJEXT) \
+ pt-rwlockattr-getpshared.$(OBJEXT) \
+ pt-rwlockattr-setpshared.$(OBJEXT) pt-rwlock-init.$(OBJEXT) \
+ pt-rwlock-destroy.$(OBJEXT) pt-rwlock-rdlock.$(OBJEXT) \
+ pt-rwlock-tryrdlock.$(OBJEXT) pt-rwlock-trywrlock.$(OBJEXT) \
+ pt-rwlock-wrlock.$(OBJEXT) pt-rwlock-timedrdlock.$(OBJEXT) \
+ pt-rwlock-timedwrlock.$(OBJEXT) pt-rwlock-unlock.$(OBJEXT) \
+ pt-cond.$(OBJEXT) pt-condattr-init.$(OBJEXT) \
+ pt-condattr-destroy.$(OBJEXT) pt-condattr-getclock.$(OBJEXT) \
+ pt-condattr-getpshared.$(OBJEXT) pt-condattr-setclock.$(OBJEXT) \
+ pt-condattr-setpshared.$(OBJEXT) pt-cond-destroy.$(OBJEXT) \
+ pt-cond-init.$(OBJEXT) pt-cond-brdcast.$(OBJEXT) \
+ pt-cond-signal.$(OBJEXT) pt-cond-wait.$(OBJEXT) \
+ pt-cond-timedwait.$(OBJEXT) pt-stack-alloc.$(OBJEXT) \
+ pt-thread-alloc.$(OBJEXT) pt-thread-start.$(OBJEXT) \
+ pt-thread-halt.$(OBJEXT) pt-thread-init.$(OBJEXT) \
+ pt-getconcurrency.$(OBJEXT) pt-setconcurrency.$(OBJEXT) \
+ pt-block.$(OBJEXT) pt-timedblock.$(OBJEXT) pt-wakeup.$(OBJEXT) \
+ pt-docancel.$(OBJEXT) pt-sysdep.$(OBJEXT) pt-setup.$(OBJEXT) \
+ pt-machdep.$(OBJEXT) pt-spin.$(OBJEXT) \
+ pt-sigstate-init.$(OBJEXT) pt-sigstate-destroy.$(OBJEXT) \
+ pt-sigstate.$(OBJEXT) pt-atfork.$(OBJEXT) pt-kill.$(OBJEXT) \
+ pt-getcpuclockid.$(OBJEXT) pt-getschedparam.$(OBJEXT) \
+ pt-setschedparam.$(OBJEXT) pt-setschedprio.$(OBJEXT)
+libpthread_a_OBJECTS = $(am_libpthread_a_OBJECTS)
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/pt-alloc.Po ./$(DEPDIR)/pt-atfork.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getdetachstate.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getguardsize.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getinheritsched.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getschedparam.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getschedpolicy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getscope.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getstack.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getstackaddr.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-getstacksize.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setdetachstate.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setguardsize.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setinheritsched.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setschedparam.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setschedpolicy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setscope.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setstack.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setstackaddr.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr-setstacksize.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-attr.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrier-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrier-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrier-wait.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrier.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrierattr-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrierattr-getpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrierattr-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-barrierattr-setpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-block.Po ./$(DEPDIR)/pt-cancel.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cleanup.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-brdcast.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-signal.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-timedwait.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-cond-wait.Po ./$(DEPDIR)/pt-cond.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-getclock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-getpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-setclock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-condattr-setpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-create-np.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-create.Po ./$(DEPDIR)/pt-dealloc.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-destroy-specific.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-detach.Po ./$(DEPDIR)/pt-docancel.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-equal.Po ./$(DEPDIR)/pt-exit.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-getconcurrency.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-getcpuclockid.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-getschedparam.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-getspecific.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-init-specific.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-initialize.Po ./$(DEPDIR)/pt-join.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-key-create.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-key-delete.Po ./$(DEPDIR)/pt-kill.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-machdep.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-getprioceiling.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-lock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-setprioceiling.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-timedlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-trylock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutex-unlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-getprioceiling.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-getprotocol.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-getpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-gettype.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-setprioceiling.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-setprotocol.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-setpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr-settype.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-mutexattr.Po ./$(DEPDIR)/pt-once.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-attr.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-rdlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-timedrdlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-timedwrlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-tryrdlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-trywrlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-unlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlock-wrlock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlockattr-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlockattr-getpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlockattr-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-rwlockattr-setpshared.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-self.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setcancelstate.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setcanceltype.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setconcurrency.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setschedparam.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setschedprio.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setspecific.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-setup.Po ./$(DEPDIR)/pt-sigmask.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-sigstate-destroy.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-sigstate-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-sigstate.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-spin-inlines.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-spin.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-stack-alloc.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-sysdep.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-testcancel.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-thread-alloc.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-thread-halt.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-thread-init.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-thread-start.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-timedblock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/pt-wakeup.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libpthread_a_SOURCES)
+DIST_COMMON = ChangeLog Makefile.am Makefile.in TODO
+SOURCES = $(libpthread_a_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libpthread/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libpthread.a: $(libpthread_a_OBJECTS) $(libpthread_a_DEPENDENCIES)
+ -rm -f libpthread.a
+ $(libpthread_a_AR) libpthread.a $(libpthread_a_OBJECTS) $(libpthread_a_LIBADD)
+ $(RANLIB) libpthread.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-alloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-atfork.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getdetachstate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getguardsize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getinheritsched.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getschedparam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getschedpolicy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getscope.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getstack.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getstackaddr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-getstacksize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setdetachstate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setguardsize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setinheritsched.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setschedparam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setschedpolicy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setscope.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setstack.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setstackaddr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr-setstacksize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-attr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrier-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrier-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrier-wait.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrier.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrierattr-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrierattr-getpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrierattr-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-barrierattr-setpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-block.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cancel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cleanup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-brdcast.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-signal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-timedwait.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond-wait.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-cond.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-getclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-getpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-setclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-condattr-setpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-create-np.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-create.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-dealloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-destroy-specific.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-detach.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-docancel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-equal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-exit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-getconcurrency.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-getcpuclockid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-getschedparam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-getspecific.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-init-specific.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-initialize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-join.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-key-create.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-key-delete.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-kill.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-machdep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-getprioceiling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-lock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-setprioceiling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-timedlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-trylock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutex-unlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-getprioceiling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-getprotocol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-getpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-gettype.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-setprioceiling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-setprotocol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-setpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr-settype.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-mutexattr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-once.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-attr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-rdlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-timedrdlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-timedwrlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-tryrdlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-trywrlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-unlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlock-wrlock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlockattr-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlockattr-getpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlockattr-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-rwlockattr-setpshared.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-self.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setcancelstate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setcanceltype.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setconcurrency.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setschedparam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setschedprio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setspecific.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-setup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-sigmask.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-sigstate-destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-sigstate-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-sigstate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-spin-inlines.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-spin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-stack-alloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-sysdep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-testcancel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-thread-alloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-thread-halt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-thread-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-thread-start.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-timedblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pt-wakeup.Po@am__quote@
+
+distclean-depend:
+ -rm -rf ./$(DEPDIR)
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@ fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@ fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+
+installdirs:
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-noinstLIBRARIES ctags distclean distclean-compile \
+ distclean-depend distclean-generic distclean-tags distdir dvi \
+ dvi-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
+
+vpath %.c $(SYSDEP_PATH)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/headers.m4 b/headers.m4
new file mode 100644
index 00000000..4fceecbf
--- /dev/null
+++ b/headers.m4
@@ -0,0 +1,35 @@
+# headers.m4 - Autoconf snippets to install links for header files.
+# Copyright 2003 Free Software Foundation, Inc.
+# Written by Marcus Brinkmann <marcus@gnu.org>.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+AC_CONFIG_LINKS([
+ include/pthread.h:libpthread/include/pthread.h
+ include/pthread/pthread.h:libpthread/include/pthread/pthread.h
+ include/bits/atomic.h:libpthread/sysdeps/${arch}/bits/atomic.h
+ include/bits/memory.h:libpthread/sysdeps/${arch}/bits/memory.h
+ include/bits/spin-lock.h:libpthread/sysdeps/${arch}/bits/spin-lock.h
+ include/bits/pthreadtypes.h:libpthread/sysdeps/generic/bits/pthreadtypes.h
+ include/bits/barrier-attr.h:libpthread/sysdeps/generic/bits/barrier-attr.h
+ include/bits/barrier.h:libpthread/sysdeps/generic/bits/barrier.h
+ include/bits/cancelation.h:libpthread/sysdeps/generic/bits/cancelation.h
+ include/bits/condition-attr.h:libpthread/sysdeps/generic/bits/condition-attr.h
+ include/bits/condition.h:libpthread/sysdeps/generic/bits/condition.h
+ include/bits/mutex-attr.h:libpthread/sysdeps/generic/bits/mutex-attr.h
+ include/bits/mutex.h:libpthread/sysdeps/generic/bits/mutex.h
+ include/bits/once.h:libpthread/sysdeps/generic/bits/once.h
+ include/bits/pthread.h:libpthread/sysdeps/generic/bits/pthread.h
+ include/bits/rwlock-attr.h:libpthread/sysdeps/generic/bits/rwlock-attr.h
+ include/bits/rwlock.h:libpthread/sysdeps/generic/bits/rwlock.h
+ include/bits/thread-attr.h:libpthread/sysdeps/generic/bits/thread-attr.h
+ include/bits/thread-barrier.h:libpthread/sysdeps/generic/bits/thread-barrier.h
+ include/bits/thread-specific.h:libpthread/sysdeps/generic/bits/thread-specific.h
+ include/bits/pthread-np.h:libpthread/sysdeps/l4/bits/pthread-np.h
+])
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index 0295a0af..727fbac1 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -57,7 +57,7 @@ pthread_create (pthread_t *thread, const pthread_attr_t *attr,
int err;
struct __pthread *pthread;
- err = __pthread_create_internal (&pthread, attr, start_routine, arg);
+ err = __pthread_create_internal (&pthread, attr, 0, start_routine, arg);
if (! err)
*thread = pthread->thread;
@@ -69,6 +69,7 @@ pthread_create (pthread_t *thread, const pthread_attr_t *attr,
int
__pthread_create_internal (struct __pthread **thread,
const pthread_attr_t *attr,
+ void *provided_thread,
void *(*start_routine)(void *), void *arg)
{
int err;
@@ -122,10 +123,20 @@ __pthread_create_internal (struct __pthread **thread,
pthread->stack = 1;
}
- /* Allocate the kernel thread and other required resources. */
- err = __pthread_thread_alloc (pthread);
- if (err)
- goto failed_thread_alloc;
+ /* Allocate the kernel thread and other required resources
+ if they were not provided with this call. */
+ if (!provided_thread)
+ {
+ err = __pthread_thread_alloc (pthread);
+ if (err)
+ goto failed_thread_alloc;
+ }
+ else
+ {
+ err = __pthread_init_provided_thread (pthread, provided_thread);
+ if (err)
+ goto failed_thread_alloc;
+ }
/* And initialize the rest of the machine context. This may include
additional machine- and system-specific initializations that
@@ -146,7 +157,8 @@ __pthread_create_internal (struct __pthread **thread,
shall be empty." If the currnet thread is not a pthread then we
just inherit the process' sigmask. */
if (__pthread_num_threads == 1)
- err = sigprocmask (0, 0, &sigset);
+ /* FIXME no sigprocmask yet */
+ err = 0; /* sigprocmask (0, 0, &sigset); */
else
err = __pthread_sigstate (_pthread_self (), 0, 0, &sigset, 0);
assert_perror (err);
diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h
index a32345c4..79ce19c7 100644
--- a/pthread/pt-internal.h
+++ b/pthread/pt-internal.h
@@ -21,11 +21,12 @@
#define _PT_INTERNAL_H 1
#include <pthread.h>
+#if 0
#include <stddef.h>
#include <sched.h>
#include <signal.h>
#include <assert.h>
-
+#endif
#include <bits/atomic.h>
#include <pt-key.h>
@@ -164,6 +165,7 @@ extern void __pthread_initialize (void);
tid, we return the whole __pthread structure in *PTHREAD. */
extern int __pthread_create_internal (struct __pthread **pthread,
const pthread_attr_t *attr,
+ void *provided_thread,
void *(*start_routine)(void *),
void *arg);
@@ -203,6 +205,9 @@ extern int __pthread_thread_start (struct __pthread *thread);
with THREAD. */
extern void __pthread_thread_halt (struct __pthread *thread);
+/* Initialize provided kernel thread. */
+extern int __pthread_init_provided_thread (struct __pthread *thread,
+ void *p);
/* Block THREAD. */
extern void __pthread_block (struct __pthread *thread);
diff --git a/sysdeps/generic/bits/pthreadtypes.h b/sysdeps/generic/bits/pthreadtypes.h
new file mode 100644
index 00000000..e5cbfd2a
--- /dev/null
+++ b/sysdeps/generic/bits/pthreadtypes.h
@@ -0,0 +1,29 @@
+/*
+ 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#if !defined _BITS_TYPES_H && !defined _PTHREAD_H
+# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H 1
+
+#include <pthread.h>
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/generic/pt-rwlock-rdlock.c b/sysdeps/generic/pt-rwlock-rdlock.c
index 22c11204..d060c38f 100644
--- a/sysdeps/generic/pt-rwlock-rdlock.c
+++ b/sysdeps/generic/pt-rwlock-rdlock.c
@@ -21,7 +21,7 @@
#include <pt-internal.h>
/* Implemented in pt-rwlock-timedrdlock.c. */
-extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_mutex *mutex,
+extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *mutex,
const struct timespec *abstime);
/* Acquire RWLOCK for reading, block if we can't get it. */
diff --git a/sysdeps/hurd/pt-destroy-specific.c b/sysdeps/hurd/pt-destroy-specific.c
index dbd3314b..2006f2b8 100644
--- a/sysdeps/hurd/pt-destroy-specific.c
+++ b/sysdeps/hurd/pt-destroy-specific.c
@@ -50,10 +50,10 @@ __pthread_destroy_specific (struct __pthread *thread)
if (__pthread_key_destructors[i] == PTHREAD_KEY_INVALID)
break;
- value = ihash_find (thread->thread_specifics, i);
+ value = hurd_ihash_find (thread->thread_specifics, i);
if (value)
{
- err = ihash_remove (thread->thread_specifics, i);
+ err = hurd_ihash_remove (thread->thread_specifics, i);
assert (err == 1);
if (__pthread_key_destructors[i])
@@ -71,9 +71,10 @@ __pthread_destroy_specific (struct __pthread *thread)
/* This may take a very long time. Let those blocking on
pthread_key_create or pthread_key_delete make progress. */
- sched_yield ();
+ /* FIXME what should we do with this one? */
+ /* sched_yield (); */
}
-
- ihash_free (thread->thread_specifics);
+
+ hurd_ihash_free (thread->thread_specifics);
thread->thread_specifics = 0;
}
diff --git a/sysdeps/hurd/pt-getspecific.c b/sysdeps/hurd/pt-getspecific.c
index b5b5f5e5..30605984 100644
--- a/sysdeps/hurd/pt-getspecific.c
+++ b/sysdeps/hurd/pt-getspecific.c
@@ -33,5 +33,5 @@ pthread_getspecific (pthread_key_t key)
if (! self->thread_specifics)
return 0;
- return ihash_find (self->thread_specifics, key);
+ return hurd_ihash_find (self->thread_specifics, key);
}
diff --git a/sysdeps/hurd/pt-key.h b/sysdeps/hurd/pt-key.h
index 739fbbad..494e01d7 100644
--- a/sysdeps/hurd/pt-key.h
+++ b/sysdeps/hurd/pt-key.h
@@ -21,7 +21,7 @@
#include <hurd/ihash.h>
#define PTHREAD_KEY_MEMBERS \
- ihash_t thread_specifics;
+ hurd_ihash_t thread_specifics;
#define PTHREAD_KEY_INVALID (void *) (-1)
diff --git a/sysdeps/i386/bits/atomic.h b/sysdeps/ia32/bits/atomic.h
index 0dfc1f60..0dfc1f60 100644
--- a/sysdeps/i386/bits/atomic.h
+++ b/sysdeps/ia32/bits/atomic.h
diff --git a/sysdeps/i386/bits/memory.h b/sysdeps/ia32/bits/memory.h
index 201305b9..201305b9 100644
--- a/sysdeps/i386/bits/memory.h
+++ b/sysdeps/ia32/bits/memory.h
diff --git a/sysdeps/i386/bits/spin-lock.h b/sysdeps/ia32/bits/spin-lock.h
index 175656ef..175656ef 100644
--- a/sysdeps/i386/bits/spin-lock.h
+++ b/sysdeps/ia32/bits/spin-lock.h
diff --git a/sysdeps/i386/machine-sp.h b/sysdeps/ia32/machine-sp.h
index 536f6902..536f6902 100644
--- a/sysdeps/i386/machine-sp.h
+++ b/sysdeps/ia32/machine-sp.h
diff --git a/sysdeps/i386/pt-machdep.h b/sysdeps/ia32/pt-machdep.h
index 6d456367..6d456367 100644
--- a/sysdeps/i386/pt-machdep.h
+++ b/sysdeps/ia32/pt-machdep.h
diff --git a/sysdeps/l4/bits/pthread-np.h b/sysdeps/l4/bits/pthread-np.h
new file mode 100644
index 00000000..b487e6dc
--- /dev/null
+++ b/sysdeps/l4/bits/pthread-np.h
@@ -0,0 +1,38 @@
+/* Non-portable functions. L4 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
+ */
+
+#ifndef _BITS_PTHREAD_NP_H
+#define _BITS_PTHREAD_NP_H 1
+
+#include <l4.h>
+
+/* Create a thread with attributes given by ATTR, executing
+ START_ROUTINE with argument ARG. TID is the provided L4
+ kernel thread. */
+extern int pthread_create_from_l4_tid_np (pthread_t *thread,
+ const pthread_attr_t *attr,
+ l4_thread_id_t tid,
+ void *(*start_routine)(void *),
+ void *arg);
+
+#endif /* bits/pthread-np.h */
diff --git a/sysdeps/l4/hurd/i386/pt-machdep.c b/sysdeps/l4/hurd/ia32/pt-machdep.c
index dbf5cd7e..dbf5cd7e 100644
--- a/sysdeps/l4/hurd/i386/pt-machdep.c
+++ b/sysdeps/l4/hurd/ia32/pt-machdep.c
diff --git a/sysdeps/l4/hurd/i386/pt-setup.c b/sysdeps/l4/hurd/ia32/pt-setup.c
index fe77d533..e244dc16 100644
--- a/sysdeps/l4/hurd/i386/pt-setup.c
+++ b/sysdeps/l4/hurd/ia32/pt-setup.c
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <l4/l4.h>
+#include <l4.h>
#include <pt-internal.h>
@@ -39,16 +39,16 @@ static void *
stack_setup (struct __pthread *thread,
void *(*start_routine)(void *), void *arg)
{
- L4_Word_t *top;
+ l4_word_t *top;
/* Calculate top of the new stack. */
- top = (L4_Word_t *) ((L4_Word_t) thread->stackaddr + thread->stacksize);
+ top = (l4_word_t *) ((l4_word_t) thread->stackaddr + thread->stacksize);
if (start_routine)
{
/* Set up call frame. */
- *--top = (L4_Word_t) arg; /* Argument to START_ROUTINE. */
- *--top = (L4_Word_t) start_routine;
+ *--top = (l4_word_t) arg; /* Argument to START_ROUTINE. */
+ *--top = (l4_word_t) start_routine;
*--top = 0; /* Fake return address. */
}
@@ -63,10 +63,10 @@ __pthread_setup (struct __pthread *thread,
thread->mcontext.pc = entry_point;
thread->mcontext.sp = stack_setup (thread, start_routine, arg);
- if (L4_SameThreads (thread->threadid, L4_Myself ()))
- L4_Set_MyUserDefinedHandle (thread);
+ if (l4_same_threads (thread->threadid, l4_myself ()))
+ l4_set_user_defined_handle ((l4_word_t) thread);
else
- L4_Set_UserDefinedHandle (thread->threadid, thread);
-
+ l4_set_user_defined_handle_of (thread->threadid,
+ (l4_word_t) thread);
return 0;
}
diff --git a/sysdeps/l4/hurd/powerpc/pt-machdep.c b/sysdeps/l4/hurd/powerpc/pt-machdep.c
new file mode 100644
index 00000000..754d203e
--- /dev/null
+++ b/sysdeps/l4/hurd/powerpc/pt-machdep.c
@@ -0,0 +1,20 @@
+/* Machine dependent pthreads code. Hurd/PowerPC 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+/* Nothing to do. */
diff --git a/sysdeps/l4/hurd/powerpc/pt-setup.c b/sysdeps/l4/hurd/powerpc/pt-setup.c
new file mode 100644
index 00000000..d3cf4ec3
--- /dev/null
+++ b/sysdeps/l4/hurd/powerpc/pt-setup.c
@@ -0,0 +1,93 @@
+/* Setup thread stack. Hurd/PowerPC 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <l4.h>
+
+#include <pt-internal.h>
+
+/* Arguments is passed in registers on the PowerPC. But the
+ exchange registers syscall only allows us to set the PC and the
+ stack pointer so we put the entry point and start function on
+ the stack. */
+struct start_info
+{
+ void (*entry_point) (void *(*)(void *), void *);
+ void *(*start_routine) (void *);
+ void *arg;
+};
+
+void first_entry_1 (void);
+
+/* Stage 1 entry function. The start_info structure is inlined on the
+ stack. Put values into registers and call entry function. */
+asm (" ;\
+first_entry_1: ;\
+ lwz 0, 0(1) ;\
+ lwz 3, 4(1) ;\
+ lwz 4, 8(1) ;\
+ mtctr 0 ;\
+ bctrl ;\
+");
+
+/* Set up the stack for THREAD, such that it appears as if
+ START_ROUTINE and ARG were passed to the new thread's entry-point.
+ Return the stack pointer for the new thread. We also take the
+ opportunity to install THREAD in our utcb. */
+static void *
+stack_setup (struct __pthread *thread,
+ void (*entry_point)(void *(*)(void *), void *),
+ void *(*start_routine)(void *), void *arg)
+{
+ l4_word_t *top;
+
+ /* Calculate top of the new stack. */
+ top = (l4_word_t *) ((l4_word_t) thread->stackaddr + thread->stacksize);
+
+ /* Initial stack frame. */
+ top[-4] = 0;
+ top = top - 4;
+
+ if (start_routine)
+ {
+ struct start_info *info = ((struct start_info *) top) - 1;
+
+ info->entry_point = entry_point;
+ info->start_routine = start_routine;
+ info->arg = arg;
+ return (void *) info;
+ }
+ return top;
+}
+
+int
+__pthread_setup (struct __pthread *thread,
+ void (*entry_point)(void *(*)(void *), void *),
+ void *(*start_routine)(void *), void *arg)
+{
+ thread->mcontext.pc = first_entry_1;
+ thread->mcontext.sp = stack_setup (thread, entry_point,
+ start_routine, arg);
+
+ if (l4_same_threads (thread->threadid, l4_myself ()))
+ l4_set_user_defined_handle ((l4_word_t) thread);
+ else
+ l4_set_user_defined_handle_of (thread->threadid,
+ (l4_word_t) thread);
+ return 0;
+}
diff --git a/sysdeps/l4/hurd/pt-kill.c b/sysdeps/l4/hurd/pt-kill.c
new file mode 100644
index 00000000..1e64af49
--- /dev/null
+++ b/sysdeps/l4/hurd/pt-kill.c
@@ -0,0 +1,30 @@
+/* pthread_kill. Hurd version.
+ Copyright (C) 2002 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <pthread.h>
+#include <assert.h>
+#include <signal.h>
+
+#include <pt-internal.h>
+
+int
+pthread_kill (pthread_t thread, int sig)
+{
+ return ESRCH;
+}
diff --git a/sysdeps/l4/hurd/pt-sigstate-destroy.c b/sysdeps/l4/hurd/pt-sigstate-destroy.c
new file mode 100644
index 00000000..997a0369
--- /dev/null
+++ b/sysdeps/l4/hurd/pt-sigstate-destroy.c
@@ -0,0 +1,28 @@
+/* Destroy the signal state. Hurd on L4 version.
+ Copyright (C) 2002 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <pthread.h>
+
+#include <pt-internal.h>
+
+void
+__pthread_sigstate_destroy (struct __pthread *thread)
+{
+ /* Nothing to do. */
+}
diff --git a/sysdeps/l4/hurd/pt-sigstate-init.c b/sysdeps/l4/hurd/pt-sigstate-init.c
new file mode 100644
index 00000000..25a3920c
--- /dev/null
+++ b/sysdeps/l4/hurd/pt-sigstate-init.c
@@ -0,0 +1,28 @@
+/* Initialize the signal state. Hurd on L4 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <pthread.h>
+
+#include <pt-internal.h>
+
+error_t
+__pthread_sigstate_init (struct __pthread *thread)
+{
+ return 0;
+}
diff --git a/sysdeps/l4/hurd/pt-sigstate.c b/sysdeps/l4/hurd/pt-sigstate.c
new file mode 100644
index 00000000..490c95fe
--- /dev/null
+++ b/sysdeps/l4/hurd/pt-sigstate.c
@@ -0,0 +1,32 @@
+/* Set a thread's signal state. Hurd on L4 version.
+ Copyright (C) 2002 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <pthread.h>
+#include <assert.h>
+#include <signal.h>
+
+#include <pt-internal.h>
+
+error_t
+__pthread_sigstate (struct __pthread *thread, int how,
+ const sigset_t *set, sigset_t *oset,
+ int clear_pending)
+{
+ return EINVAL;
+}
diff --git a/sysdeps/l4/hurd/pt-sysdep.c b/sysdeps/l4/hurd/pt-sysdep.c
index 265592ca..f23a137a 100644
--- a/sysdeps/l4/hurd/pt-sysdep.c
+++ b/sysdeps/l4/hurd/pt-sysdep.c
@@ -43,7 +43,7 @@ init_routine (void)
__pthread_initialize ();
/* Create the pthread structure for the main thread (i.e. us). */
- err = __pthread_create_internal (&thread, 0, 0, 0);
+ err = __pthread_create_internal (&thread, 0, 0, 0, 0);
assert_perror (err);
__pthread_initialize ();
diff --git a/sysdeps/l4/hurd/pt-sysdep.h b/sysdeps/l4/hurd/pt-sysdep.h
index e37beefa..7e69d709 100644
--- a/sysdeps/l4/hurd/pt-sysdep.h
+++ b/sysdeps/l4/hurd/pt-sysdep.h
@@ -20,24 +20,22 @@
#ifndef _PT_SYSDEP_H
#define _PT_SYSDEP_H 1
-#include <l4/l4.h>
-#include <task_client.h>
-#include <machine/vmparam.h>
+#include <l4.h>
/* XXX */
#define _POSIX_THREAD_THREADS_MAX 64
/* The default stack size. */
-#define PTHREAD_STACK_DEFAULT (PAGE_SIZE)
+#define PTHREAD_STACK_DEFAULT 4096
#define PTHREAD_SYSDEP_MEMBERS \
- L4_ThreadId_t threadid; \
- L4_Word_t my_errno;
+ l4_thread_id_t threadid; \
+ l4_word_t my_errno;
extern inline struct __pthread *
_pthread_self (void)
{
- return (struct __pthread *) L4_MyUserDefinedHandle ();
+ return (struct __pthread *) l4_user_defined_handle ();
}
extern inline void
diff --git a/sysdeps/l4/pt-block.c b/sysdeps/l4/pt-block.c
index 050c6947..5992dc14 100644
--- a/sysdeps/l4/pt-block.c
+++ b/sysdeps/l4/pt-block.c
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <l4/l4.h>
+#include <l4.h>
#include <pt-internal.h>
@@ -25,5 +25,5 @@
void
__pthread_block (struct __pthread *thread)
{
- L4_Receive (L4_anylocalthread);
+ l4_receive (l4_anylocalthread);
}
diff --git a/sysdeps/l4/pt-create-np.c b/sysdeps/l4/pt-create-np.c
new file mode 100644
index 00000000..d5a23668
--- /dev/null
+++ b/sysdeps/l4/pt-create-np.c
@@ -0,0 +1,47 @@
+/* Thread creation from provided L4 thread.
+ 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <assert.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+
+#include <bits/atomic.h>
+
+#include <pt-internal.h>
+
+/* Create a thread with attributes given by ATTR, executing
+ START_ROUTINE with argument ARG. TID is the provided L4
+ kernel thread. */
+int
+pthread_create_from_l4_tid_np (pthread_t *thread,
+ const pthread_attr_t *attr,
+ l4_thread_id_t tid,
+ void *(*start_routine)(void *), void *arg)
+{
+ int err;
+ struct __pthread *pthread;
+
+ err = __pthread_create_internal (&pthread, attr, (void *) &tid,
+ start_routine, arg);
+ if (! err)
+ *thread = pthread->thread;
+
+ return err;
+}
diff --git a/sysdeps/l4/pt-docancel.c b/sysdeps/l4/pt-docancel.c
index 9a3bb26c..e832e26e 100644
--- a/sysdeps/l4/pt-docancel.c
+++ b/sysdeps/l4/pt-docancel.c
@@ -30,6 +30,7 @@ call_exit (void)
int
__pthread_do_cancel (struct __pthread *p)
{
+#if 0
assert (p->cancel_pending = 1);
assert (p->cancel_state == PTHREAD_CANCEL_ENABLE);
@@ -46,6 +47,6 @@ __pthread_do_cancel (struct __pthread *p)
&dummy, &dummy, &dummy, &dummy, &dummy,
&dummy_id);
}
-
+#endif
return 0;
}
diff --git a/sysdeps/l4/pt-spin.c b/sysdeps/l4/pt-spin.c
new file mode 100644
index 00000000..355253ee
--- /dev/null
+++ b/sysdeps/l4/pt-spin.c
@@ -0,0 +1,60 @@
+/* Spin locks. L4 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <l4.h>
+
+#include <pthread.h>
+#include <sched.h>
+
+/* The default for single processor machines; don't spin, it's
+ pointless. */
+#ifndef __PTHREAD_SPIN_COUNT
+# define __PTHREAD_SPIN_COUNT 1
+#endif
+
+/* The number of times to spin while trying to lock a spin lock object
+ before yielding the processor. */
+int __pthread_spin_count = __PTHREAD_SPIN_COUNT;
+
+
+/* Lock the spin lock object LOCK. If the lock is held by another
+ thread spin until it becomes available. */
+int
+_pthread_spin_lock (__pthread_spinlock_t *lock)
+{
+ l4_time_t timeout;
+ int i;
+
+ timeout.period.m = 1;
+ timeout.period.e = 1;
+
+ while (1)
+ {
+ for (i = 0; i < __pthread_spin_count; i++)
+ {
+ if (__pthread_spin_trylock (lock) == 0)
+ return 0;
+ }
+ /* FIXME verify this */
+ l4_receive_timeout (l4_nilthread, timeout);
+ timeout.period.e++;
+ }
+}
+
+weak_alias (_pthread_spin_lock, pthread_spin_lock);
diff --git a/sysdeps/l4/pt-stack-alloc.c b/sysdeps/l4/pt-stack-alloc.c
index e28d5310..9a254141 100644
--- a/sysdeps/l4/pt-stack-alloc.c
+++ b/sysdeps/l4/pt-stack-alloc.c
@@ -17,37 +17,20 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <l4/l4.h>
+#include <l4.h>
#include <errno.h>
+#include <sys/mman.h>
#include <pt-internal.h>
#define __pthread_stacksize __pthread_default_attr.stacksize
-#include <l4/sigma0.h>
-#include <hurd/debug.h>
static void *
allocate_page (void)
{
- L4_Fpage_t p;
- /* The Kernel Interface page. */
- static L4_KernelInterfacePage_t *kip;
-
- if (! kip)
- kip = L4_GetKernelInterface ();
-
-#define sigma0_tid() (L4_GlobalId (kip->ThreadInfo.X.UserBase, 1))
- p = L4_Sigma0_GetPage (sigma0_tid (),
- L4_Fpage_Set_Attrs (L4_FpageLog2 (-1UL << 10,
- PAGE_SHIFT),
- L4_FullyAccessible));
- p.raw &= ~0x3ff;
-
- printf ("%s: Allocated page %x\n",
- __FUNCTION__, p.raw);
-
- return (void *) p.raw;
+ return mmap
+ (NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
}
diff --git a/sysdeps/l4/pt-thread-alloc.c b/sysdeps/l4/pt-thread-alloc.c
index a9d5e212..00e99ff9 100644
--- a/sysdeps/l4/pt-thread-alloc.c
+++ b/sysdeps/l4/pt-thread-alloc.c
@@ -1,5 +1,5 @@
-/* Start thread. L4 version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* Allocate kernel thread. L4 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
@@ -23,9 +23,8 @@
#include <pt-internal.h>
-/* Start THREAD. Get the kernel thread scheduled and running. */
int
-__pthread_thread_start (struct __pthread *thread)
+__pthread_thread_alloc (struct __pthread *thread)
{
error_t err;
@@ -33,10 +32,11 @@ __pthread_thread_start (struct __pthread *thread)
if (__pthread_num_threads == 1)
{
assert (__pthread_total == 1);
- thread->thread_id = L4_Myself ();
+ thread->threadid = l4_myself ();
}
else
{
+#if 0
CORBA_Environment env;
env = idl4_default_environment;
@@ -45,8 +45,8 @@ __pthread_thread_start (struct __pthread *thread)
* (L4_Word_t *) &__system_pager,
(L4_Word_t *) &thread->threadid, &env);
if (err)
+#endif
return EAGAIN;
}
-
return 0;
}
diff --git a/sysdeps/l4/pt-thread-halt.c b/sysdeps/l4/pt-thread-halt.c
index 04d622f4..ea97eea0 100644
--- a/sysdeps/l4/pt-thread-halt.c
+++ b/sysdeps/l4/pt-thread-halt.c
@@ -19,20 +19,13 @@
#include <assert.h>
#include <errno.h>
-#include <mach.h>
#include <pt-internal.h>
-extern L4_ThreadId_t __task_server;
-
/* Deallocate the kernel thread resources associated with THREAD. */
void
__pthread_thread_halt (struct __pthread *thread)
{
- CORBA_Environment env = idl4_default_environment;
- L4_Word_t *t = (L4_Word_t *) &thread->threadid;
-
- assert (*t);
- assert (thread_terminate (__task_server, *t, &env));
- *t = 0;
+ /* FIXME reuse thread somehow */
+ l4_stop (thread->threadid);
}
diff --git a/sysdeps/l4/pt-thread-init.c b/sysdeps/l4/pt-thread-init.c
new file mode 100644
index 00000000..ac50d58d
--- /dev/null
+++ b/sysdeps/l4/pt-thread-init.c
@@ -0,0 +1,34 @@
+/* Start thread. L4 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <assert.h>
+#include <errno.h>
+#include <string.h>
+
+#include <pt-internal.h>
+
+/* Initialize provided kernel thread. */
+int
+__pthread_init_provided_thread (struct __pthread *thread,
+ void *p)
+{
+ l4_thread_id_t *tid = (l4_thread_id_t *) p;
+ thread->threadid = *tid;
+ return 0;
+}
diff --git a/sysdeps/l4/pt-thread-start.c b/sysdeps/l4/pt-thread-start.c
index c428d290..36770703 100644
--- a/sysdeps/l4/pt-thread-start.c
+++ b/sysdeps/l4/pt-thread-start.c
@@ -1,5 +1,5 @@
/* Start thread. L4 version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,70 +23,24 @@
#include <pt-internal.h>
-#include "task_client.h"
-
-extern L4_ThreadId_t __system_pager;
-extern L4_ThreadId_t __task_server;
-
-#ifndef WORKING_EXREGS
-static void
-send_startup_ipc (L4_ThreadId_t id, L4_Word_t ip, L4_Word_t sp)
-{
- L4_Msg_t msg;
-
- printf ("%s: Sending startup message to %x, "
- "(ip=%x, sp=%x)\n",
- __FUNCTION__, * (L4_Word_t *) &id, ip, sp);
-
- L4_Clear (&msg);
-#ifdef HAVE_PROPAGATION
- L4_Set_VirtualSender (pager_tid);
- L4_Set_Propagation (&msg.tag);
-#endif
- L4_Append_Word (&msg, ip);
- L4_Append_Word (&msg, sp);
-#ifndef HAVE_PROPAGATION
- L4_Append_Word (&msg, *(L4_Word_t *) &id);
- id = __system_pager;
-#if 0
- DODEBUG (2, printf ("%s: Redirecting start request to pager (%x).\n",
- __FUNCTION__, * (L4_Word_t *) &id));
-#endif
-#endif
- L4_LoadMsg (&msg);
- L4_Send (id);
-}
-#endif
-
/* Start THREAD. Get the kernel thread scheduled and running. */
int
__pthread_thread_start (struct __pthread *thread)
{
- error_t err;
-
/* The main thread is already running of course. */
if (__pthread_num_threads == 1)
- {
- assert (__pthread_total == 1);
- assert (thread->thread_id == L4_Myself ());
- }
+ assert (__pthread_total == 1);
else
{
- env = idl4_default_environment;
- err = thread_resume (__task_server,
- * (L4_Word_t *) &thread->threadid,
- &env);
- assert (! err);
-
-#ifndef WORKING_EXREGS
- L4_AbortIpc_and_stop (thread->threadid);
- L4_Start_SpIp (thread->threadid, (L4_Word_t) thread->mcontext.sp,
- (L4_Word_t) thread->mcontext.pc);
-#endif
- send_startup_ipc (thread->threadid, (L4_Word_t) thread->mcontext.pc,
- (L4_Word_t) thread->mcontext.sp);
-
+ l4_thread_id_t dest = thread->threadid;
+ l4_word_t control = (L4_XCHG_REGS_SET_HALT | L4_XCHG_REGS_SET_SP
+ | L4_XCHG_REGS_SET_IP | L4_XCHG_REGS_SET_PAGER);
+ l4_word_t sp = (l4_word_t) thread->mcontext.sp;
+ l4_word_t ip = (l4_word_t) thread->mcontext.pc;
+ l4_word_t dummy = 0;
+ l4_thread_id_t pager = l4_pager ();
+
+ l4_exchange_registers (&dest, &control, &sp, &ip, &dummy, &dummy, &pager);
}
-
return 0;
}
diff --git a/sysdeps/l4/pt-timedblock.c b/sysdeps/l4/pt-timedblock.c
new file mode 100644
index 00000000..fda14401
--- /dev/null
+++ b/sysdeps/l4/pt-timedblock.c
@@ -0,0 +1,34 @@
+/* Block a thread with a timeout. L4 version.
+ Copyright (C) 2000,02 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include <assert.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/time.h>
+
+#include <pt-internal.h>
+
+/* Block THREAD. */
+error_t
+__pthread_timedblock (struct __pthread *thread,
+ const struct timespec *abstime)
+{
+ __pthread_block (thread);
+ return 0;
+}
diff --git a/sysdeps/l4/pt-wakeup.c b/sysdeps/l4/pt-wakeup.c
index 7b00e4f6..342a2204 100644
--- a/sysdeps/l4/pt-wakeup.c
+++ b/sysdeps/l4/pt-wakeup.c
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <l4/l4.h>
+#include <l4.h>
#include <pt-internal.h>
@@ -25,5 +25,5 @@
void
__pthread_wakeup (struct __pthread *thread)
{
- L4_Send (thread->threadid);
+ l4_send (thread->threadid);
}
diff --git a/sysdeps/mach/hurd/i386/pt-machdep.c b/sysdeps/mach/hurd/ia32/pt-machdep.c
index face46c5..face46c5 100644
--- a/sysdeps/mach/hurd/i386/pt-machdep.c
+++ b/sysdeps/mach/hurd/ia32/pt-machdep.c
diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/ia32/pt-setup.c
index 9a855847..9a855847 100644
--- a/sysdeps/mach/hurd/i386/pt-setup.c
+++ b/sysdeps/mach/hurd/ia32/pt-setup.c
diff --git a/sysdeps/powerpc/bits/atomic.h b/sysdeps/powerpc/bits/atomic.h
new file mode 100644
index 00000000..5ba19cd0
--- /dev/null
+++ b/sysdeps/powerpc/bits/atomic.h
@@ -0,0 +1,84 @@
+/* Atomic operations. PowerPC 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#ifndef _BITS_ATOMIC_H
+#define _BITS_ATOMIC_H 1
+
+typedef __volatile int __atomic_t;
+
+static inline void
+__atomic_inc (__atomic_t *__var)
+{
+ int tmp;
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ add%I2 %0,%0,%2 \n\
+ stwcx. %0,0,%1 \n\
+ bne- 0b \n\
+" : "=&b"(tmp) : "r" (__var), "Ir"(1) : "cr0", "memory");
+}
+
+static inline void
+__atomic_dec (__atomic_t *__var)
+{
+ int tmp;
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ add%I2 %0,%0,%2 \n\
+ stwcx. %0,0,%1 \n\
+ bne- 0b \n\
+" : "=&b"(tmp) : "r" (__var), "Ir"(-1) : "cr0", "memory");
+}
+
+static inline int
+__atomic_dec_and_test (__atomic_t *__var)
+{
+ unsigned char __ret;
+
+#if 0
+ __asm__ __volatile ("lock; decl %0; sete %1"
+ : "=m" (*__var), "=qm" (__ret) : "m" (*__var));
+#endif
+ return __ret != 0;
+}
+
+/* We assume that an __atomicptr_t is only used for pointers to
+ word-aligned objects, and use the lowest bit for a simple lock. */
+typedef __volatile int * __atomicptr_t;
+
+/* Actually we don't implement that yet, and assume that we run on
+ something that has the i486 instruction set. */
+static inline int
+__atomicptr_compare_and_swap (__atomicptr_t *__ptr, void *__oldval,
+ void * __newval)
+{
+ int __ret;
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ sub%I2c. %0,%0,%2 \n\
+ cntlzw %0,%0 \n\
+ bne- 1f \n\
+ stwcx. %3,0,%1 \n\
+ bne- 0b \n\
+1: \n\
+" : "=&b"(__ret) : "r"(__ptr), "Ir"(__oldval), "r"(__newval) : "cr0", "memory");
+ return __ret >> 5;
+}
+
+#endif
diff --git a/sysdeps/powerpc/bits/machine-lock.h b/sysdeps/powerpc/bits/machine-lock.h
new file mode 100644
index 00000000..cba6b0a6
--- /dev/null
+++ b/sysdeps/powerpc/bits/machine-lock.h
@@ -0,0 +1,78 @@
+/* Machine-specific definition for spin locks. PowerPC version.
+ Copyright (C) 1994,97,2002 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 _MACHINE_LOCK_H
+#define _MACHINE_LOCK_H
+
+/* The type of a spin lock variable. */
+
+typedef __volatile long int __spin_lock_t;
+
+/* Value to initialize `__spin_lock_t' variables to. */
+
+#define __SPIN_LOCK_INITIALIZER 0L
+
+
+#ifndef _EXTERN_INLINE
+#define _EXTERN_INLINE extern __inline
+#endif
+
+/* Unlock LOCK. */
+
+_EXTERN_INLINE void
+__spin_unlock (__spin_lock_t *__lock)
+{
+ long int __locked;
+ __asm__ __volatile__ ("\
+0: lwarx %0,0,%1\n\
+ stwcx. %2,0,%1\n\
+ bne- 0b\n\
+" : "=&r" (__locked) : "r" (__lock), "r" (0) : "cr0");
+}
+
+/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */
+
+_EXTERN_INLINE int
+__spin_try_lock (register __spin_lock_t *__lock)
+{
+ long int __rtn;
+ __asm__ __volatile__ ("\
+0: lwarx %0,0,%1\n\
+ stwcx. %2,0,%1\n\
+ bne- 0b\n\
+" : "=&r" (__rtn) : "r" (__lock), "r" (1) : "cr0");
+ return !__rtn;
+}
+
+/* Return nonzero if LOCK is locked. */
+
+_EXTERN_INLINE int
+__spin_lock_locked (__spin_lock_t *__lock)
+{
+ long int __rtn;
+ __asm__ __volatile__ ("\
+0: lwarx %0,0,%1\n\
+ stwcx. %0,0,%1\n\
+ bne- 0b\n\
+" : "=&r" (__rtn) : "r" (__lock) : "cr0");
+ return __rtn;
+}
+
+
+#endif /* machine-lock.h */
diff --git a/sysdeps/powerpc/bits/memory.h b/sysdeps/powerpc/bits/memory.h
new file mode 100644
index 00000000..96624c3e
--- /dev/null
+++ b/sysdeps/powerpc/bits/memory.h
@@ -0,0 +1,36 @@
+/* Memory barrier operations. PowerPC 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#ifndef _BITS_MEMORY_H
+#define _BITS_MEMORY_H 1
+
+/* Prevent read and write reordering across this function. */
+inline void
+__memory_barrier (void)
+{
+ asm ("sync" ::: "memory");
+}
+
+/* Prevent read reordering across this function. */
+#define __memory_read_barrier __memory_barrier
+
+/* Prevent write reordering across this function. */
+#define __memory_write_barrier __memory_barrier
+
+#endif
diff --git a/sysdeps/powerpc/bits/spin-lock.h b/sysdeps/powerpc/bits/spin-lock.h
new file mode 100644
index 00000000..1dc25710
--- /dev/null
+++ b/sysdeps/powerpc/bits/spin-lock.h
@@ -0,0 +1,108 @@
+/* Machine-specific definitions for spin locks. PowerPC 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
+ */
+
+#ifndef _BITS_SPIN_LOCK_H
+#define _BITS_SPIN_LOCK_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* The type of a spin lock object. */
+typedef __volatile int __pthread_spinlock_t;
+
+/* Initializer for a spin lock object. */
+# define __SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0)
+
+#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES
+
+# ifndef __EBUSY
+# include <errno.h>
+# define __EBUSY EBUSY
+# endif
+
+# ifndef __PT_SPIN_INLINE
+# define __PT_SPIN_INLINE extern __inline
+# endif
+
+__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_destroy (__pthread_spinlock_t *__lock)
+{
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock,
+ int __pshared);
+
+__PT_SPIN_INLINE int
+__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared)
+{
+ *__lock = __SPIN_LOCK_INITIALIZER;
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_trylock (__pthread_spinlock_t *__lock)
+{
+ long int __rtn;
+ __asm__ __volatile__ ("\
+0: lwarx %0,0,%1\n\
+ stwcx. %2,0,%1\n\
+ bne- 0b\n\
+" : "=&r" (__rtn) : "r" (__lock), "r" (1) : "cr0");
+ return __rtn ? __EBUSY : 0;
+}
+
+extern inline int __pthread_spin_lock (__pthread_spinlock_t *__lock);
+extern int _pthread_spin_lock (__pthread_spinlock_t *__lock);
+
+extern inline int
+__pthread_spin_lock (__pthread_spinlock_t *__lock)
+{
+ if (__pthread_spin_trylock (__lock))
+ return _pthread_spin_lock (__lock);
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_unlock (__pthread_spinlock_t *__lock)
+{
+ long int __locked;
+ __asm__ __volatile__ ("\
+0: lwarx %0,0,%1\n\
+ stwcx. %2,0,%1\n\
+ bne- 0b\n\
+" : "=&r" (__locked) : "r" (__lock), "r" (0) : "cr0");
+}
+
+#endif /* Use extern inlines or force inlines. */
+
+__END_DECLS
+
+#endif /* bits/spin-lock.h */
diff --git a/sysdeps/powerpc/machine-sp.h b/sysdeps/powerpc/machine-sp.h
new file mode 100644
index 00000000..aa787c59
--- /dev/null
+++ b/sysdeps/powerpc/machine-sp.h
@@ -0,0 +1,31 @@
+/* Machine-specific function to return the stack pointer. i386 version.
+ Copyright (C) 1994,97,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.
+
+ 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 _MACHINE_SP_H
+#define _MACHINE_SP_H
+
+/* Return the current stack pointer. */
+
+#define __thread_stack_pointer() ({ \
+ void *__sp__; \
+ __asm__ ("mr %0, 1" : "=r" (__sp__)); \
+ __sp__; \
+})
+
+#endif /* machine-sp.h */
diff --git a/sysdeps/powerpc/pt-machdep.h b/sysdeps/powerpc/pt-machdep.h
new file mode 100644
index 00000000..6d456367
--- /dev/null
+++ b/sysdeps/powerpc/pt-machdep.h
@@ -0,0 +1,29 @@
+/* Machine dependent pthreads internal defenitions. i386 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ 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. */
+
+#ifndef _PT_MACHDEP_H
+#define _PT_MACHDEP_H 1
+
+struct pthread_mcontext
+{
+ void *pc;
+ void *sp;
+};
+
+#endif /* pt-machdep.h */