summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps/sparc
diff options
context:
space:
mode:
authoraustinf <austinf@localhost>2009-03-19 07:29:30 +0000
committeraustinf <austinf@localhost>2009-03-19 07:29:30 +0000
commit2ea44632aac286a927069a1fb1f979db23c0b3c4 (patch)
tree405585f334c03e95c106924c03ed4642f80874a0 /libpthread/nptl/sysdeps/sparc
parentd38a60ef0325122761dea450cc163ac036d896e7 (diff)
downloaduClibc-alpine-2ea44632aac286a927069a1fb1f979db23c0b3c4.tar.bz2
uClibc-alpine-2ea44632aac286a927069a1fb1f979db23c0b3c4.tar.xz
sparc32 nptl functional
* pulled updated asm and headers from glibc for sparc32 * probably no cancellation support yet * no shared TLS relocs yet, since ldso is hosed on sparc still note: didn't use TARGET_SUBARCH method of includes since that would cause other parts of libc to fail currently. Will need to be fixed later.
Diffstat (limited to 'libpthread/nptl/sysdeps/sparc')
-rw-r--r--libpthread/nptl/sysdeps/sparc/Makefile.arch49
-rw-r--r--libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h6
-rw-r--r--libpthread/nptl/sysdeps/sparc/pthreaddef.h6
-rw-r--r--libpthread/nptl/sysdeps/sparc/tls.h12
4 files changed, 67 insertions, 6 deletions
diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
new file mode 100644
index 000000000..4547ee3f3
--- /dev/null
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -0,0 +1,49 @@
+# Makefile for uClibc NPTL
+#
+# Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+libpthread_CSRC = sparc32/pthread_spin_lock.c \
+ sparc32/pthread_spin_trylock.c
+
+CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
+
+CFLAGS-sparc = $(SSP_ALL_CFLAGS)
+#CFLAGS:=$(CFLAGS:-O1=-O2)
+
+PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/sparc/
+PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/sparc/
+PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
+PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
+
+libpthread-a-y += $(PTHREAD_ARCH_OBJ)
+libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
+
+libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
+
+objclean-y += nptl_arch_clean
+headers_clean-y += nptl_arch_headers_clean
+
+#
+# Create 'tcb-offsets.h' header file.
+#
+CFLAGS-tcb-offsets.c = -S
+
+$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
+ $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
+
+$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
+ $(compile.c)
+
+$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
+ @sed -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
+
+nptl_arch_headers: $(PTHREAD_ARCH_OUT)/tcb-offsets.h
+
+nptl_arch_headers_clean:
+ $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
+
+nptl_arch_clean:
+ $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
new file mode 100644
index 000000000..d6c2baabd
--- /dev/null
+++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
@@ -0,0 +1,6 @@
+#if defined(__arch64__)
+#include "sparc64/jmpbuf-unwind.h"
+#else
+#include "sparc32/jmpbuf-unwind.h"
+#endif
+
diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
new file mode 100644
index 000000000..bcc6ed10a
--- /dev/null
+++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
@@ -0,0 +1,6 @@
+#if defined(__arch64__)
+#include "sparc64/pthreaddef.h"
+#else
+#include "sparc32/pthreaddef.h"
+#endif
+
diff --git a/libpthread/nptl/sysdeps/sparc/tls.h b/libpthread/nptl/sysdeps/sparc/tls.h
index ea26ed32f..e5d27fb57 100644
--- a/libpthread/nptl/sysdeps/sparc/tls.h
+++ b/libpthread/nptl/sysdeps/sparc/tls.h
@@ -54,9 +54,9 @@ typedef struct
#endif /* __ASSEMBLER__ */
/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
+#define HAVE_TLS_SUPPORT
+#define HAVE___THREAD 1
+#define HAVE_TLS_MODEL_ATTRIBUTE 1
/* Signal that TLS support is available. */
#define USE_TLS 1
@@ -65,9 +65,6 @@ typedef struct
/* Get system call information. */
# include <sysdep.h>
-/* Get the thread descriptor definition. */
-# include <nptl/descr.h>
-
register struct pthread *__thread_self __asm__("%g7");
/* This is the size of the initial TCB. Can't be just sizeof (tcbhead_t),
@@ -84,6 +81,9 @@ register struct pthread *__thread_self __asm__("%g7");
/* Alignment requirements for the TCB. */
# define TLS_TCB_ALIGN __alignof__ (struct pthread)
+/* Get the thread descriptor definition. */
+# include <descr.h>
+
/* The TCB can have any size and the memory following the address the
thread pointer points to is unspecified. Allocate the TCB there. */
# define TLS_TCB_AT_TP 1