svn commit: branches/uClibc-nptl/libpthread: linuxthreads.old linuxthreads.old/sysdep etc...
kraj at uclibc.org
kraj at uclibc.org
Mon Dec 15 19:11:44 UTC 2008
Author: kraj
Date: 2008-12-15 11:11:43 -0800 (Mon, 15 Dec 2008)
New Revision: 24421
Log:
Merge linuxthread.old from trunk.
Added:
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h
Removed:
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/
branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/
Modified:
branches/uClibc-nptl/libpthread/linuxthreads.old/
branches/uClibc-nptl/libpthread/linuxthreads.old/attr.c
branches/uClibc-nptl/libpthread/linuxthreads.old/join.c
branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c
branches/uClibc-nptl/libpthread/linuxthreads.old/specific.c
branches/uClibc-nptl/libpthread/linuxthreads.old_db/
branches/uClibc-nptl/libpthread/linuxthreads_db/
Changeset:
Property changes on: branches/uClibc-nptl/libpthread/linuxthreads.old
___________________________________________________________________
Name: svn:ignore
- libpthread*.a
*.os
*.oS
+ libpthread*.a
*.os
*.oS
.*.dep
Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/attr.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/attr.c 2008-12-15 19:07:27 UTC (rev 24420)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/attr.c 2008-12-15 19:11:43 UTC (rev 24421)
@@ -61,7 +61,7 @@
libpthread_hidden_def(pthread_attr_init)
/* uClibc: leave out this for now. */
-#if DO_PTHREAD_VERSIONING_WITH_UCLIBC
+#if defined DO_PTHREAD_VERSIONING_WITH_UCLIBC
#if defined __PIC__ && defined DO_VERSIONING
default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/join.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/join.c 2008-12-15 19:07:27 UTC (rev 24420)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/join.c 2008-12-15 19:11:43 UTC (rev 24421)
@@ -25,7 +25,7 @@
#include "restart.h"
#include "debug.h" /* PDEBUG, added by StS */
-libpthread_hidden_proto (pthread_exit)
+libpthread_hidden_proto(pthread_exit)
void pthread_exit(void * retval)
{
__pthread_do_exit (retval, CURRENT_STACK_FRAME);
Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c 2008-12-15 19:07:27 UTC (rev 24420)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c 2008-12-15 19:11:43 UTC (rev 24421)
@@ -321,7 +321,7 @@
struct pthread_functions __pthread_functions =
{
-#if !(USE_TLS && HAVE___THREAD)
+#if !(defined USE_TLS && HAVE___THREAD)
.ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set,
.ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get,
.ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address,
Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/specific.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/specific.c 2008-12-15 19:07:27 UTC (rev 24420)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/specific.c 2008-12-15 19:11:43 UTC (rev 24421)
@@ -167,7 +167,7 @@
__pthread_unlock(THREAD_GETMEM(self, p_lock));
}
-#if !(USE_TLS && HAVE___THREAD)
+#if !(defined USE_TLS && HAVE___THREAD)
/* Thread-specific data for libc. */
Added: branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h (rev 0)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h 2008-12-15 19:11:43 UTC (rev 24421)
@@ -0,0 +1,73 @@
+/* Machine-dependent pthreads configuration and inline functions.
+ *
+ * Copyright (C) 2005-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#include <features.h>
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
+#endif
+
+static __inline__ int
+_test_and_set (int *p, int v)
+{
+ int result;
+
+ __asm__ __volatile__(
+ "/* Inline test and set */\n"
+ " xchg %[old], %[mem], %[new]"
+ : [old] "=&r"(result)
+ : [mem] "r"(p), [new] "r"(v)
+ : "memory");
+
+ return result;
+}
+
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ return _test_and_set(spinlock, 1);
+}
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME stack_pointer
+register char * stack_pointer __asm__ ("sp");
+
+/* Compare-and-swap for semaphores. */
+
+#define HAS_COMPARE_AND_SWAP
+PT_EI int
+__compare_and_swap(long int *p, long int oldval, long int newval)
+{
+ long int result;
+
+ __asm__ __volatile__(
+ "/* Inline compare and swap */\n"
+ "1: ssrf 5\n"
+ " ld.w %[result], %[mem]\n"
+ " eor %[result], %[old]\n"
+ " brne 2f\n"
+ " stcond %[mem], %[new]\n"
+ " brne 1b\n"
+ "2:"
+ : [result] "=&r"(result), [mem] "=m"(*p)
+ : "m"(*p), [new] "r"(newval), [old] "r"(oldval)
+ : "cc", "memory");
+
+ return result == 0;
+}
+
+#endif /* pt-machine.h */
Added: branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h (rev 0)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h 2008-12-15 19:11:43 UTC (rev 24421)
@@ -0,0 +1,48 @@
+/* Machine-dependent pthreads configuration and inline functions.
+ Xtensa version.
+
+ Copyright (C) 2007 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., 51 Franklin Street - Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#include <sys/syscall.h>
+#include <asm/unistd.h>
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
+#endif
+
+/* Memory barrier. */
+#define MEMORY_BARRIER() __asm__ ("memw" : : : "memory")
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ int unused = 0;
+ return INTERNAL_SYSCALL (xtensa, , 4, SYS_XTENSA_ATOMIC_SET,
+ spinlock, 1, unused);
+}
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME __builtin_frame_address (0)
+
+#endif /* _PT_MACHINE_H */
Property changes on: branches/uClibc-nptl/libpthread/linuxthreads.old_db
___________________________________________________________________
Name: svn:ignore
- libthread_db*.a
*.os
+ libthread_db*.a
*.os
.*.dep
Property changes on: branches/uClibc-nptl/libpthread/linuxthreads_db
___________________________________________________________________
Name: svn:ignore
- libthread_db*.a
*.os
+ libthread_db*.a
*.os
.*.dep
More information about the uClibc-cvs
mailing list