diff options
Diffstat (limited to 'libpthread')
| -rw-r--r-- | libpthread/linuxthreads.old/Makefile.in | 7 | ||||
| -rw-r--r-- | libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h | 24 | ||||
| -rw-r--r-- | libpthread/linuxthreads/Makefile | 4 | ||||
| -rw-r--r-- | libpthread/linuxthreads/Makefile.in | 11 |
4 files changed, 26 insertions, 20 deletions
diff --git a/libpthread/linuxthreads.old/Makefile.in b/libpthread/linuxthreads.old/Makefile.in index 249e2f6cb..6ebaa144b 100644 --- a/libpthread/linuxthreads.old/Makefile.in +++ b/libpthread/linuxthreads.old/Makefile.in @@ -6,7 +6,8 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS) +CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread +CFLAGS-linuxthreads.old := $(CFLAGS-dir_linuxthreads.old) $(SSP_ALL_CFLAGS) CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old) @@ -56,8 +57,8 @@ libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpt # # Stuff that goes into libc.so, not libpthread.so # -CFLAGS-forward.c := -DIS_IN_libc -CFLAGS-libc_pthread_init.c := -DIS_IN_libc +CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads.old) +CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads.old) libpthread_libc_CSRC := forward.c libc_pthread_init.c libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC)) libc-static-y += $(libpthread_OUT)/libc_pthread_init.o diff --git a/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h index 431da7101..a287e866a 100644 --- a/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h +++ b/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h @@ -18,16 +18,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - #ifndef PT_EI # define PT_EI extern inline __attribute__ ((always_inline)) #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - PT_EI long int testandset (int *spinlock) { @@ -35,6 +29,19 @@ testandset (int *spinlock) /* Note the use of a dummy output of *spinlock to expose the write. The memory barrier is to stop *other* writes being moved past this code. */ + +#ifdef __arch_v32 + __asm__ __volatile__("clearf p\n" + "0:\n\t" + "movu.b [%2],%0\n\t" + "ax\n\t" + "move.b %3,[%2]\n\t" + "bcs 0b\n\t" + "clearf p" + : "=&r" (ret), "=m" (*spinlock) + : "r" (spinlock), "r" ((int) 1), "m" (*spinlock) + : "memory"); +#else /* not __arch_v32 */ __asm__ __volatile__("clearf\n" "0:\n\t" "movu.b [%2],%0\n\t" @@ -43,8 +50,9 @@ testandset (int *spinlock) "bwf 0b\n\t" "clearf" : "=&r" (ret), "=m" (*spinlock) - : "r" (spinlock), "r" ((int) 1) + : "r" (spinlock), "r" ((int) 1), "m" (*spinlock) : "memory"); +#endif /* __arch_v32 */ return ret; } @@ -54,5 +62,3 @@ testandset (int *spinlock) I don't trust register variables, so let's do this the safe way. */ #define CURRENT_STACK_FRAME \ ({ char *sp; __asm__ ("move.d $sp,%0" : "=rm" (sp)); sp; }) - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile index f92f205a5..f9100219a 100644 --- a/libpthread/linuxthreads/Makefile +++ b/libpthread/linuxthreads/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../ top_builddir=../../ include $(top_builddir)Rules.mak all: libs diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in index fc3b0b0bd..66f5ac544 100644 --- a/libpthread/linuxthreads/Makefile.in +++ b/libpthread/linuxthreads/Makefile.in @@ -6,7 +6,8 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS) +CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread +CFLAGS-linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS) CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads) CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads) @@ -57,10 +58,10 @@ libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpt # # Stuff that goes into libc.so, not libpthread.so # -#CFLAGS-alloca_cutoff.c := -DIS_IN_libc -CFLAGS-forward.c := -DIS_IN_libc -CFLAGS-libc-cancellation.c := -DIS_IN_libc -CFLAGS-libc_pthread_init.c := -DIS_IN_libc +#CFLAGS-OMIT-alloca_cutoff.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-libc-cancellation.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads) libpthread_libc_CSRC := \ forward.c libc-cancellation.c libc_pthread_init.c # alloca_cutoff.c libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC)) |
