[uClibc-cvs] svn commit: branches/uClibc-nptl/libpthread/nptl: compat sysdeps sysdeps/mips sysdeps/pth etc...

sjhill at uclibc.org sjhill at uclibc.org
Sun Jun 12 01:40:28 UTC 2005


Author: sjhill
Date: 2005-06-11 19:40:26 -0600 (Sat, 11 Jun 2005)
New Revision: 10534

Log:
Add more files for NPTL support.


Added:
   branches/uClibc-nptl/libpthread/nptl/compat/sysdep-cancel.h
   branches/uClibc-nptl/libpthread/nptl/old_pthread_atfork.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_broadcast.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_destroy.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_init.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_signal.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_timedwait.c
   branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_wait.c
   branches/uClibc-nptl/libpthread/nptl/sysdeps/Makefile
   branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/regdef.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/bits/libc-tsd.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/linux_fsinfo.h
   branches/uClibc-nptl/libpthread/nptl/version.c


Changeset:
Added: branches/uClibc-nptl/libpthread/nptl/compat/sysdep-cancel.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/compat/sysdep-cancel.h	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/compat/sysdep-cancel.h	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,12 @@
+#ifndef _SYSDEP_CANCEL_H
+#define _SYSDEP_CANCEL_H 1
+
+#include <sysdep.h>
+
+/* No multi-thread handling enabled.  */
+#define SINGLE_THREAD_P (1)
+#define LIBC_CANCEL_ASYNC()	0 /* Just a dummy value.  */
+#define LIBC_CANCEL_RESET(val)	((void)(val)) /* Nothing, but evaluate it.  */
+#define LIBC_CANCEL_HANDLED()	/* Nothing.  */
+
+#endif  /* sysdep-cancel.h */

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_atfork.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_atfork.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_atfork.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,27 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3)
+# define __pthread_atfork __dyn_pthread_atfork
+# include "pthread_atfork.c"
+# undef __pthread_atfork
+compat_symbol (libpthread, __dyn_pthread_atfork, pthread_atfork, GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_broadcast.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_broadcast.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_broadcast.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,58 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include "pthreadP.h"
+#include <atomic.h>
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_broadcast_2_0 (cond)
+     pthread_cond_2_0_t *cond;
+{
+  if (cond->cond == NULL)
+    {
+      pthread_cond_t *newcond;
+
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+	return ENOMEM;
+#else
+      newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
+      if (newcond == NULL)
+	return ENOMEM;
+
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
+
+      if (atomic_compare_and_exchange_bool_acq (&cond->cond, newcond, NULL))
+	/* Somebody else just initialized the condvar.  */
+	free (newcond);
+    }
+
+  return __pthread_cond_broadcast (cond->cond);
+}
+compat_symbol (libpthread, __pthread_cond_broadcast_2_0,
+	       pthread_cond_broadcast, GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_destroy.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_destroy.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_destroy.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdlib.h>
+#include "pthreadP.h"
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_destroy_2_0 (cond)
+     pthread_cond_2_0_t *cond;
+{
+  /* Free the memory which was eventually allocated.  */
+  free (cond->cond);
+
+  return 0;
+}
+compat_symbol (libpthread, __pthread_cond_destroy_2_0, pthread_cond_destroy,
+	       GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_init.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_init.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_init.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,47 @@
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include "pthreadP.h"
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_init_2_0 (cond, cond_attr)
+     pthread_cond_2_0_t *cond;
+     const pthread_condattr_t *cond_attr;
+{
+  struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
+
+  /* The type of the first argument is actually that of the old, too
+     small pthread_cond_t.  We use only the first word of it, as a
+     pointer.  */
+  cond->cond = NULL;
+
+  /* We can't support PSHARED condvars in the old pthread_cond_*
+     functions and neither clocks other than CLOCK_REALTIME.  */
+  if (icond_attr != NULL && icond_attr->value)
+    return EINVAL;
+
+  return 0;
+}
+compat_symbol (libpthread, __pthread_cond_init_2_0, pthread_cond_init,
+	       GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_signal.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_signal.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_signal.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,58 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include "pthreadP.h"
+#include <atomic.h>
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_signal_2_0 (cond)
+     pthread_cond_2_0_t *cond;
+{
+  if (cond->cond == NULL)
+    {
+      pthread_cond_t *newcond;
+
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+	return ENOMEM;
+#else
+      newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
+      if (newcond == NULL)
+	return ENOMEM;
+
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
+
+      if (atomic_compare_and_exchange_bool_acq (&cond->cond, newcond, NULL))
+	/* Somebody else just initialized the condvar.  */
+	free (newcond);
+    }
+
+  return __pthread_cond_signal (cond->cond);
+}
+compat_symbol (libpthread, __pthread_cond_signal_2_0, pthread_cond_signal,
+	       GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_timedwait.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_timedwait.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_timedwait.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,60 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include "pthreadP.h"
+#include <atomic.h>
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_timedwait_2_0 (cond, mutex, abstime)
+     pthread_cond_2_0_t *cond;
+     pthread_mutex_t *mutex;
+     const struct timespec *abstime;
+{
+  if (cond->cond == NULL)
+    {
+      pthread_cond_t *newcond;
+
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+	return ENOMEM;
+#else
+      newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
+      if (newcond == NULL)
+	return ENOMEM;
+
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
+
+      if (atomic_compare_and_exchange_bool_acq (&cond->cond, newcond, NULL))
+	/* Somebody else just initialized the condvar.  */
+	free (newcond);
+    }
+
+  return __pthread_cond_timedwait (cond->cond, mutex, abstime);
+}
+compat_symbol (libpthread, __pthread_cond_timedwait_2_0,
+	       pthread_cond_timedwait, GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_wait.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_wait.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/old_pthread_cond_wait.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,59 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include "pthreadP.h"
+#include <atomic.h>
+#include <shlib-compat.h>
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+int
+__pthread_cond_wait_2_0 (cond, mutex)
+     pthread_cond_2_0_t *cond;
+     pthread_mutex_t *mutex;
+{
+  if (cond->cond == NULL)
+    {
+      pthread_cond_t *newcond;
+
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+	return ENOMEM;
+#else
+      newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
+      if (newcond == NULL)
+	return ENOMEM;
+
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
+
+      if (atomic_compare_and_exchange_bool_acq (&cond->cond, newcond, NULL))
+	/* Somebody else just initialized the condvar.  */
+	free (newcond);
+    }
+
+  return __pthread_cond_wait (cond->cond, mutex);
+}
+compat_symbol (libpthread, __pthread_cond_wait_2_0, pthread_cond_wait,
+	       GLIBC_2_0);
+#endif

Added: branches/uClibc-nptl/libpthread/nptl/sysdeps/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/Makefile	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/Makefile	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,40 @@
+# Makefile for uClibc's NPTL pthread library
+#
+# Copyright (C) 2005 Steven J. Hill <sjhill at realitydiluted.com>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program 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 Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Makefile for uClibc
+
+TOPDIR=../../../
+include $(TOPDIR)Rules.mak
+
+#DIRS += $(TARGET_ARCH) pthread
+DIRS += $(TARGET_ARCH)
+
+all: subdirs
+
+clean: subdirs_clean
+	$(RM) *~ core
+
+subdirs: $(patsubst %, _dir_%, $(DIRS))
+subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
+
+$(patsubst %, _dir_%, $(DIRS)) : dummy
+	$(MAKE) -C $(patsubst _dir_%, %, $@)
+
+$(patsubst %, _dirclean_%, $(DIRS)) : dummy
+	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
+
+.PHONY: dummy subdirs

Added: branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/regdef.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/regdef.h	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/regdef.h	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,27 @@
+/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ralf Baechle <ralf at gnu.org>.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _REGDEF_H
+#define _REGDEF_H
+
+#include <sys/regdef.h>
+#include <sys/fpregdef.h>
+
+#endif /* _REGDEF_H */
+

Added: branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/bits/libc-tsd.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/bits/libc-tsd.h	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/bits/libc-tsd.h	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,69 @@
+/* libc-internal interface for thread-specific data.  Stub or TLS version.
+   Copyright (C) 1998,2001,02 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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _GENERIC_BITS_LIBC_TSD_H
+#define _GENERIC_BITS_LIBC_TSD_H 1
+
+/* This file defines the following macros for accessing a small fixed
+   set of thread-specific `void *' data used only internally by libc.
+
+   __libc_tsd_define(CLASS, KEY)	-- Define or declare a `void *' datum
+   					   for KEY.  CLASS can be `static' for
+					   keys used in only one source file,
+					   empty for global definitions, or
+					   `extern' for global declarations.
+   __libc_tsd_address(KEY)		-- Return the `void **' pointing to
+   					   the current thread's datum for KEY.
+   __libc_tsd_get(KEY)			-- Return the `void *' datum for KEY.
+   __libc_tsd_set(KEY, VALUE)		-- Set the datum for KEY to VALUE.
+
+   The set of available KEY's will usually be provided as an enum,
+   and contains (at least):
+		_LIBC_TSD_KEY_MALLOC
+		_LIBC_TSD_KEY_DL_ERROR
+		_LIBC_TSD_KEY_RPC_VARS
+   All uses must be the literal _LIBC_TSD_* name in the __libc_tsd_* macros.
+   Some implementations may not provide any enum at all and instead
+   using string pasting in the macros.  */
+
+#include <tls.h>
+
+/* When full support for __thread variables is available, this interface is
+   just a trivial wrapper for it.  Without TLS, this is the generic/stub
+   implementation for wholly single-threaded systems.
+
+   We don't define an enum for the possible key values, because the KEYs
+   translate directly into variables by macro magic.  */
+
+#if USE___THREAD
+# define __libc_tsd_define(CLASS, KEY)	\
+  CLASS __thread void *__libc_tsd_##KEY attribute_tls_model_ie;
+
+# define __libc_tsd_address(KEY)	(&__libc_tsd_##KEY)
+# define __libc_tsd_get(KEY)		(__libc_tsd_##KEY)
+# define __libc_tsd_set(KEY, VALUE)	(__libc_tsd_##KEY = (VALUE))
+#else
+# define __libc_tsd_define(CLASS, KEY)	CLASS void *__libc_tsd_##KEY##_data;
+
+# define __libc_tsd_address(KEY)	(&__libc_tsd_##KEY##_data)
+# define __libc_tsd_get(KEY)		(__libc_tsd_##KEY##_data)
+# define __libc_tsd_set(KEY, VALUE)	(__libc_tsd_##KEY##_data = (VALUE))
+#endif
+
+#endif	/* bits/libc-tsd.h */

Added: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/linux_fsinfo.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/linux_fsinfo.h	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/linux_fsinfo.h	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,153 @@
+/* Constants from kernel header for various FSes.
+   Copyright (C) 1998,1999,2000,2001,2002,2003 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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _LINUX_FSINFO_H
+#define _LINUX_FSINFO_H	1
+
+/* These definitions come from the kernel headers.  But we cannot
+   include the headers here because of type clashes.  If new
+   filesystem types will become available we have to add the
+   appropriate definitions here.*/
+
+/* Constants that identify the `adfs' filesystem.  */
+#define ADFS_SUPER_MAGIC	0xadf5
+
+/* Constants that identify the `affs' filesystem.  */
+#define AFFS_SUPER_MAGIC	0xadff
+
+/* Constants that identify the `autofs' filesystem.  */
+#define AUTOFS_SUPER_MAGIC	0x187
+
+/* Constants that identify the `bfs' filesystem.  */
+#define BFS_MAGIC		0x1BADFACE
+
+/* Constants that identify the `coda' filesystem.  */
+#define CODA_SUPER_MAGIC	0x73757245
+
+/* Constants that identify the `coherent' filesystem.  */
+#define COH_SUPER_MAGIC		0x012ff7b7
+
+/* Constant that identifies the `ramfs' filesystem.  */
+#define CRAMFS_MAGIC		0x28cd3d45
+
+/* Constant that identifies the `devfs' filesystem.  */
+#define DEVFS_SUPER_MAGIC	0x1373
+
+/* Constant that identifies the `devpts' filesystem.  */
+#define DEVPTS_SUPER_MAGIC	0x1cd1
+
+/* Constant that identifies the `efs' filesystem.  */
+#define EFS_SUPER_MAGIC		0x414A53
+#define EFS_MAGIC		0x072959
+
+/* Constant that identifies the `ext2' and `ext3' filesystems.  */
+#define EXT2_SUPER_MAGIC	0xef53
+
+/* Constant that identifies the `hpfs' filesystem.  */
+#define HPFS_SUPER_MAGIC	0xf995e849
+
+/* Constant that identifies the `iso9660' filesystem.  */
+#define ISOFS_SUPER_MAGIC	0x9660
+
+/* Constant that identifies the `jffs' filesystem.  */
+#define JFFS_SUPER_MAGIC	0x07c0
+
+/* Constant that identifies the `jffs2' filesystem.  */
+#define JFFS2_SUPER_MAGIC	0x72b6
+
+/* Constant that identifies the `jfs' filesystem.  */
+#define JFS_SUPER_MAGIC		0x3153464a
+
+/* Constants that identify the `minix2' filesystem.  */
+#define MINIX2_SUPER_MAGIC	0x2468
+#define MINIX2_SUPER_MAGIC2	0x2478
+
+/* Constants that identify the `minix' filesystem.  */
+#define MINIX_SUPER_MAGIC	0x137f
+#define MINIX_SUPER_MAGIC2	0x138F
+
+/* Constants that identify the `msdos' filesystem.  */
+#define MSDOS_SUPER_MAGIC	0x4d44
+
+/* Constants that identify the `ncp' filesystem.  */
+#define NCP_SUPER_MAGIC		0x564c
+
+/* Constants that identify the `nfs' filesystem.  */
+#define NFS_SUPER_MAGIC		0x6969
+
+/* Constants that identify the `ntfs' filesystem.  */
+#define NTFS_SUPER_MAGIC	0x5346544e
+
+/* Constants that identify the `proc' filesystem.  */
+#define PROC_SUPER_MAGIC	0x9fa0
+
+/* Constant that identifies the `usbdevfs' filesystem.  */
+#define USBDEVFS_SUPER_MAGIC	0x9fa2
+
+/* Constants that identify the `qnx4' filesystem.  */
+#define QNX4_SUPER_MAGIC	0x002f
+
+/* Constants that identify the `reiser' filesystem.  */
+#define REISERFS_SUPER_MAGIC	0x52654973
+
+/* Constant that identifies the `romfs' filesystem.  */
+#define ROMFS_SUPER_MAGIC	0x7275
+
+/* Constants that identify the `smb' filesystem.  */
+#define SMB_SUPER_MAGIC		0x517b
+
+/* Constants that identify the `sysV' filesystem.  */
+#define SYSV2_SUPER_MAGIC	0x012ff7b6
+#define SYSV4_SUPER_MAGIC	0x012ff7b5
+
+/* Constants that identify the `udf' filesystem.  */
+#define UDF_SUPER_MAGIC		0x15013346
+
+/* Constants that identify the `ufs' filesystem.  */
+#define UFS_MAGIC		0x00011954
+#define UFS_CIGAM		0x54190100 /* byteswapped MAGIC */
+
+/* Constants that identify the `xenix' filesystem.  */
+#define XENIX_SUPER_MAGIC	0x012ff7b4
+
+/* Constant that identifies the `shm' filesystem.  */
+#define SHMFS_SUPER_MAGIC	0x01021994
+
+/* Constants that identify the `xfs' filesystem.  */
+#define XFS_SUPER_MAGIC		0x58465342
+
+/* Constants that identify the `vxfs' filesystem.  */
+#define VXFS_SUPER_MAGIC	0xa501fcf5
+
+/* Maximum link counts.  */
+#define COH_LINK_MAX		10000
+#define EXT2_LINK_MAX		32000
+#define MINIX2_LINK_MAX		65530
+#define MINIX_LINK_MAX		250
+#define REISERFS_LINK_MAX	64535
+#define SYSV_LINK_MAX		126     /* 127? 251? */
+#define UFS_LINK_MAX		EXT2_LINK_MAX
+#define XENIX_LINK_MAX		126     /* ?? */
+#define XFS_LINK_MAX		2147483647
+
+/* The Linux kernel header mentioned this as a kind of generic value.  */
+#define LINUX_LINK_MAX	127
+
+
+#endif	/* linux_fsinfo.h */

Added: branches/uClibc-nptl/libpthread/nptl/version.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/version.c	2005-06-12 00:45:09 UTC (rev 10533)
+++ branches/uClibc-nptl/libpthread/nptl/version.c	2005-06-12 01:40:26 UTC (rev 10534)
@@ -0,0 +1,45 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
+
+   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., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sysdep.h>
+
+
+static const char banner[] =
+#include "banner.h"
+"Copyright (C) 2003 Free Software Foundation, Inc.\n\
+This is free software; see the source for copying conditions.\n\
+There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
+PARTICULAR PURPOSE.\n"
+#ifdef HAVE_FORCED_UNWIND
+"Forced unwind support included.\n"
+#endif
+;
+
+
+extern void __nptl_main (void) __attribute__ ((noreturn));
+void
+__nptl_main (void)
+{
+  INTERNAL_SYSCALL_DECL (err);
+  INTERNAL_SYSCALL (write, err, 3, STDOUT_FILENO, (const char *) banner,
+		    sizeof banner - 1);
+
+  _exit (0);
+}




More information about the uClibc-cvs mailing list