diff options
author | Khem Raj <raj.khem@gmail.com> | 2010-05-05 22:50:19 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2010-05-09 22:53:25 -0700 |
commit | e3dec33ba03ef7080a39444388a01e59135bb3aa (patch) | |
tree | 9693449a78a556a91ddba349116d9c988399071a /libpthread/nptl/sysdeps/unix/sysv | |
parent | d2ab6ee38dd6ef107bac77f485ab1bb35b177e6c (diff) |
powerpc: Add TLS and NPTL support
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv')
15 files changed, 107 insertions, 9 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in index 1c75c14c5..c2ade848e 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in @@ -45,9 +45,9 @@ libc_CSRC += libc-lowlevellock.c endif ifeq ($(TARGET_ARCH),powerpc) -libpthread_CSRC += lowlevellock.c +libpthread_CSRC += lowlevellock.c lowlevelrobustlock.c libc_CSRC += libc-lowlevellock.c -librt_CSRC := mq_notify.c +librt_CSRC += __syscall_error.c endif ifeq ($(TARGET_ARCH),sparc) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/createthread.c b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/createthread.c index 6a51e73da..2b19fd5d9 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/createthread.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/createthread.c @@ -20,4 +20,4 @@ #define TLS_VALUE (pd + 1) /* Get the real implementation. */ -#include <nptl/sysdeps/pthread/createthread.c> +#include <sysdeps/pthread/createthread.c> diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile index e98c9bd86..421a62b3d 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -1,2 +1,13 @@ -# pull in __syscall_error routine -libpthread-routines += sysdep +# Makefile for uClibc NPTL +# +# Copyright (C) 2009 Bernhard Reutner-Fischer <uclibc@uclibc.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +top_srcdir=../../../../../../../ +top_builddir=../../../../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch new file mode 100644 index 000000000..2c39551dc --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch @@ -0,0 +1,62 @@ +# Makefile for uClibc NPTL +# +# Copyright (C) 2009 Bernhard Reutner-Fischer <uclibc@uclibc.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +libpthread_LINUX_ARCH_SSRC = pt-vfork.S +libpthread_LINUX_ARCH_CSRC = pthread_once.c pt-__syscall_error.c + +libc_a_CSRC = fork.c +libc_a_SSRC = clone.S vfork.S + +ARCH_OBJS += $(libc_a_SSRC:.S=.c) + +CFLAGS += $(SSP_ALL_CFLAGS) +ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y) +CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__ +endif + +CFLAGS-pthread_once.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 +CFLAGS-lowlevellock.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 +CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 + +ASFLAGS-pt-vfork.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -D_LIBC_REENTRANT -DUSE___THREAD +#ASFLAGS-libc-lowlevellock.S = -D_LIBC_REENTRANT -DUSE___THREAD +#ASFLAGS-lowlevellock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -D_LIBC_REENTRANT -DUSE___THREAD +ASFLAGS-clone.S = -D_LIBC_REENTRANT +ASFLAGS-vfork.S = -D_LIBC_REENTRANT + +ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) +#Needed to use the correct SYSCALL_ERROR_HANDLER +ASFLAGS-clone.S += -DUSE___THREAD +ASFLAGS-vfork.S += -DUSE___THREAD +endif + +LINUX_ARCH_DIR:=$(top_srcdir)libpthread/nptl/sysdeps/unix/sysv/linux/powerpc +LINUX_ARCH_OUT:=$(top_builddir)libpthread/nptl/sysdeps/unix/sysv/linux/powerpc +LINUX_ARCH_OBJ:=$(patsubst %.S,$(LINUX_ARCH_OUT)/%.o,$(libpthread_LINUX_ARCH_SSRC)) +LINUX_ARCH_OBJ+=$(patsubst %.c,$(LINUX_ARCH_OUT)/%.o,$(libpthread_LINUX_ARCH_CSRC)) + +ifeq ($(DOPIC),y) +libpthread-a-y += $(LINUX_ARCH_OBJ:.o=.os) +else +libpthread-a-y += $(LINUX_ARCH_OBJ) +endif +libpthread-so-y += $(LINUX_ARCH_OBJ:.o=.oS) + +libpthread-multi-y+=$(libpthread_LINUX_ARCH_CSRC) + +LIBC_LINUX_ARCH_OBJ:=$(patsubst %.c,$(LINUX_ARCH_OUT)/%.o,$(libc_a_CSRC)) +LIBC_LINUX_ARCH_OBJ+=$(patsubst %.S,$(LINUX_ARCH_OUT)/%.o,$(libc_a_SSRC)) + +libc-static-y+=$(LIBC_LINUX_ARCH_OBJ) +libc-shared-y+=$(LIBC_LINUX_ARCH_OBJ:.o=.oS) + +libc-multi-y+=$(libc_a_CSRC) + +objclean-y+=nptl_linux_arch_clean + +nptl_linux_arch_clean: + $(do_rm) $(addprefix $(LINUX_ARCH_OUT)/*., o os oS) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/clone.S new file mode 100644 index 000000000..91c939e57 --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/clone.S @@ -0,0 +1,5 @@ +#if defined __powerpc64__ +# include "powerpc64/clone.S" +#else +# include "powerpc32/clone.S" +#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c index e811ad74e..26efabd0d 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c @@ -22,4 +22,4 @@ + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) /* Get the real implementation. */ -#include <nptl/sysdeps/pthread/createthread.c> +#include <sysdeps/pthread/createthread.c> diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h index 66c02cbbd..ecfa9702e 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -24,7 +24,8 @@ #include <sys/param.h> #include <bits/pthreadtypes.h> #include <atomic.h> -#include <kernel-features.h> +#include <bits/kernel-features.h> +#include <sysdep.h> #ifndef __NR_futex # define __NR_futex 221 diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h index 88b24e7d9..4daa115ed 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h @@ -21,7 +21,7 @@ #include <sysdep.h> #include <tls.h> #ifndef __ASSEMBLER__ -# include <nptl/pthreadP.h> +# include <pthreadP.h> #endif #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S index eed2a8f1a..8d3773ca4 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S @@ -55,3 +55,4 @@ ENTRY (__vfork) PSEUDO_END (__vfork) libc_hidden_def (__vfork) weak_alias (__vfork, vfork) +libc_hidden_weak(vfork) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h index 707765ab5..8e5e477b3 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h @@ -21,7 +21,7 @@ #include <sysdep.h> #include <tls.h> #ifndef __ASSEMBLER__ -# include <nptl/pthreadP.h> +# include <pthreadP.h> #endif #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S index 26885bb95..64aa952cd 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S @@ -53,3 +53,5 @@ ENTRY (__vfork) PSEUDO_END (__vfork) libc_hidden_def (__vfork) weak_alias (__vfork, vfork) +libc_hidden_weak(vfork) + diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-__syscall_error.c b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-__syscall_error.c new file mode 100644 index 000000000..2a402e5af --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-__syscall_error.c @@ -0,0 +1 @@ +#include <../../../../../../../libc/sysdeps/linux/powerpc/__syscall_error.c> diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S new file mode 100644 index 000000000..0225219d9 --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S @@ -0,0 +1,5 @@ +#if defined __powerpc64__ +# include "powerpc64/pt-vfork.S" +#else +# include "powerpc32/pt-vfork.S" +#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h new file mode 100644 index 000000000..dab7e0beb --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h @@ -0,0 +1,5 @@ +#if defined(__powerpc64__) +#include "powerpc64/sysdep-cancel.h" +#else +#include "powerpc32/sysdep-cancel.h" +#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/vfork.S new file mode 100644 index 000000000..27d29020e --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/vfork.S @@ -0,0 +1,5 @@ +#if defined __powerpc64__ +# include "powerpc64/vfork.S" +#else +# include "powerpc32/vfork.S" +#endif |