svn commit: branches/uClibc-nptl: ldso/ldso/arm libc/sysdeps/linux/arm lib etc...

kraj at uclibc.org kraj at uclibc.org
Wed Jul 9 18:02:48 PDT 2008


Author: kraj
Date: 2008-07-09 18:02:47 -0700 (Wed, 09 Jul 2008)
New Revision: 22729

Log:
Thumb atomic operations and makefile changes to accomodate NPTL

Added:
   branches/uClibc-nptl/ldso/ldso/arm/aeabi_read_tp.S
   branches/uClibc-nptl/ldso/ldso/arm/thumb_atomics.S
   branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S
   branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-thumb_atomics.S
   branches/uClibc-nptl/libpthread/nptl/sysdeps/arm/
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/arm/
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/

Modified:
   branches/uClibc-nptl/libc/sysdeps/linux/arm/Makefile.arch


Changeset:
Added: branches/uClibc-nptl/ldso/ldso/arm/aeabi_read_tp.S
===================================================================
--- branches/uClibc-nptl/ldso/ldso/arm/aeabi_read_tp.S	                        (rev 0)
+++ branches/uClibc-nptl/ldso/ldso/arm/aeabi_read_tp.S	2008-07-10 01:02:47 UTC (rev 22729)
@@ -0,0 +1,64 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+
+#include <sysdep.h>
+#include <tls.h>
+
+/* GCC will emit calls to this routine under -mtp=soft.  Linux has an
+   equivalent helper function (which clobbers fewer registers than
+   a normal function call) in a high page of memory; tail call to the
+   helper.
+
+   This function is exported from libc for use by user code.  libpthread, librt,
+   and the dynamic linker get their own private copies, for
+   performance (and in the case of ld.so, out of necessity); those are
+   all hidden.  */
+
+#ifndef NOT_IN_libc
+	.global __aeabi_read_tp
+#else
+        .hidden __aeabi_read_tp
+#endif
+ENTRY (__aeabi_read_tp)
+	mov	r0, #0xffff0fff
+	sub	pc, r0, #31
+END (__aeabi_read_tp)
+
+#endif /* __UCLIBC_HAS_THREADS_NATIVE__ */
+

Added: branches/uClibc-nptl/ldso/ldso/arm/thumb_atomics.S
===================================================================
--- branches/uClibc-nptl/ldso/ldso/arm/thumb_atomics.S	                        (rev 0)
+++ branches/uClibc-nptl/ldso/ldso/arm/thumb_atomics.S	2008-07-10 01:02:47 UTC (rev 22729)
@@ -0,0 +1,79 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+
+#include <sysdep.h>
+
+#if defined __thumb__
+
+/* Out-of-line atomic operations that we can't do in Thumb mode.
+   This ends up in various libraries where it is needed (and
+   a few .a archives where it isn't).  */
+
+	.hidden __thumb_swpb
+ENTRY (__thumb_swpb)
+	swpb	r0, r0, [r1]
+	bx	lr
+END (__thumb_swpb)
+
+	.hidden __thumb_swp
+ENTRY (__thumb_swp)
+	swp	r0, r0, [r1]
+	bx	lr
+END (__thumb_swp)
+
+	.hidden __thumb_cmpxchg
+ENTRY (__thumb_cmpxchg)
+	stmdb	sp!, {r4, lr}
+	mov	r4, r0
+0:	ldr	r3, [r2]
+	cmp	r3, r4
+	bne	1f
+	mov	r0, r4
+	mov	r3, #0xffff0fff
+	mov	lr, pc
+	add	pc, r3, #(0xffff0fc0 - 0xffff0fff)
+	bcc	0b
+	mov	r3, r4
+1:	mov	r0, r3
+	ldmia	sp!, {r4, pc}
+END (__thumb_cmpxchg)
+
+#endif /* __thumb__ */
+#endif /* __UCLIBC_HAS_THREADS_NATIVE__ */
+

Modified: branches/uClibc-nptl/libc/sysdeps/linux/arm/Makefile.arch
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/Makefile.arch	2008-07-10 00:16:25 UTC (rev 22728)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/Makefile.arch	2008-07-10 01:02:47 UTC (rev 22729)
@@ -6,12 +6,22 @@
 #
 
 CSRC := brk.c ioperm.c iopl.c mmap.c posix_fadvise.c posix_fadvise64.c \
-	sigaction.c __syscall_error.c
+	__syscall_error.c
 
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC += sigaction.c
+endif
+
 SSRC := \
-	__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
+	__longjmp.S setjmp.S bsd-setjmp.S \
 	bsd-_setjmp.S sigrestorer.S mmap64.S
 
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += libc-aeabi_read_tp.S libc-thumb_atomics.S
+else
+SSRC += vfork.S clone.S
+endif
+
 ifeq ($(CONFIG_ARM_EABI),y)
 CSRC += aeabi_assert.c aeabi_atexit.c aeabi_errno_addr.c \
 	aeabi_localeconv.c aeabi_memclr.c aeabi_memcpy.c \

Added: branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S	2008-07-10 01:02:47 UTC (rev 22729)
@@ -0,0 +1 @@
+#include <ldso/ldso/arm/aeabi_read_tp.S>

Added: branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-thumb_atomics.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-thumb_atomics.S	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/libc-thumb_atomics.S	2008-07-10 01:02:47 UTC (rev 22729)
@@ -0,0 +1 @@
+#include <ldso/ldso/arm/thumb_atomics.S>



More information about the uClibc-cvs mailing list