]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Starting on NPTL.
authorRoland McGrath <roland@hack.frob.com>
Wed, 30 Jul 2014 22:10:35 +0000 (15:10 -0700)
committerRoland McGrath <roland@hack.frob.com>
Wed, 30 Jul 2014 22:10:35 +0000 (15:10 -0700)
sysdeps/arm/armv7/nacl/Implies [deleted file]
sysdeps/arm/nacl/Implies
sysdeps/arm/nacl/tls.h
sysdeps/nacl/Implies
sysdeps/nacl/Subdirs [new file with mode: 0644]
sysdeps/nacl/Versions
sysdeps/nacl/bits/local_lim.h
sysdeps/nacl/exit-thread.h [new file with mode: 0644]
sysdeps/nacl/fork.c [new file with mode: 0644]
sysdeps/nacl/nacl-interface-list.h
sysdeps/nacl/tls.h [new file with mode: 0644]

diff --git a/sysdeps/arm/armv7/nacl/Implies b/sysdeps/arm/armv7/nacl/Implies
deleted file mode 100644 (file)
index d696921..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# We can do everything that 6T2 can
-arm/armv6t2/nacl
index 9ab295139c712fd2b11ea98d6fdc088d2ac0ddb0..2294208dbac0a3f2fd844521ae7c08a7afb2d4bd 100644 (file)
@@ -1 +1,2 @@
+arm/nptl
 init_array
index a9d0240cf4c7f12654748b2656279011b2603673..646e7a9d06f80087e8974c99f842c946102a0946 100644 (file)
@@ -1,92 +1,2 @@
-/* XXX */
-
-#ifndef _TLS_H
-#define _TLS_H 1
-
-#ifndef __ASSEMBLER__
-# include <stdbool.h>
-# include <stddef.h>
-# include <stdint.h>
-# include <nacl-interfaces.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
-/* The TP points to the start of the thread blocks.  */
-# define TLS_DTV_AT_TP 1
-
-typedef struct
-{
-  dtv_t *dtv;
-  void *private;
-} tcbhead_t;
-
-/* This is the size of the initial TCB.  */
-# define TLS_INIT_TCB_SIZE     sizeof (tcbhead_t)
-
-/* Alignment requirements for the initial TCB.  */
-# define TLS_INIT_TCB_ALIGN    16
-
-/* This is the size of the TCB.  */
-# define TLS_TCB_SIZE          sizeof (tcbhead_t)
-
-/* This is the size we need before TCB.  */
-# define TLS_PRE_TCB_SIZE      0       /* XXX */
-
-/* Return the thread descriptor for the current thread.  */
-# define THREAD_SELF   __builtin_thread_pointer ()
-
-/* Alignment requirements for the TCB.  */
-# define TLS_TCB_ALIGN         16
-
-/* Install the dtv pointer.  The pointer passed is to the element with
-   index -1 which contain the length.  */
-# define INSTALL_DTV(tcbp, dtvp) \
-  (((tcbhead_t *) (tcbp))->dtv = (dtvp) + 1)
-
-/* Install new dtv for current thread.  */
-# define INSTALL_NEW_DTV(dtv) \
-  (THREAD_DTV() = (dtv))
-
-/* Return dtv of given thread descriptor.  */
-# define GET_DTV(tcbp) \
-  (((tcbhead_t *) (tcbp))->dtv)
-
-/* Return the address of the dtv for the current thread.  */
-# define THREAD_DTV() \
-  (((tcbhead_t *) __builtin_thread_pointer ())->dtv)
-
-#define TLS_INIT_TP_EXPENSIVE 1
-
-/* Code to initially initialize the thread pointer.  This might need
-   special attention since 'errno' is not yet available and if the
-   operation can cause a failure 'errno' must not be touched.  */
-# define TLS_INIT_TP(tcbp, secondcall) \
-  ((*__nacl_irt_tls.tls_init) (tcbp) == 0 ? NULL : "tls_init call failed")
-
-/* Get and set the global scope generation counter in struct pthread.  */
-#define THREAD_GSCOPE_FLAG_UNUSED 0
-#define THREAD_GSCOPE_FLAG_USED   1
-#define THREAD_GSCOPE_FLAG_WAIT   2
-#define THREAD_GSCOPE_RESET_FLAG() \
-  do                                                                        \
-    {}                                                                      \
-  while (0)
-#define THREAD_GSCOPE_SET_FLAG() \
-  do                                                                        \
-    {}                                                                      \
-  while (0)
-#define THREAD_GSCOPE_WAIT() ((void) 0)
-
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* tls.h */
+#include <sysdeps/arm/nptl/tls.h>
+#include <sysdeps/nacl/tls.h>
index f380b879a92a49cb357f027c2b3b87a475e0d462..0448f3f0182ac0bbf4dd78d75797d71e6815f0e1 100644 (file)
@@ -1,2 +1,3 @@
+nptl
 posix
 gnu
diff --git a/sysdeps/nacl/Subdirs b/sysdeps/nacl/Subdirs
new file mode 100644 (file)
index 0000000..5d570b9
--- /dev/null
@@ -0,0 +1,3 @@
+inet
+resolv
+nss
index 49e98561dc5ea4f1ab70f0abeb4fcee284f8a9fa..d2d655851b57535fba7e98bfb93bde441b256b8c 100644 (file)
@@ -1,3 +1,9 @@
+ld {
+  GLIBC_PRIVATE {
+    __nacl_irt_*;
+  }
+}
+
 libc {
   GLIBC_2.17 {
     nacl_interface_query;
index d655d80ae41892c5758267e70fb54da755d94c38..2792161c4746e71680d83c188621976e59e14015 100644 (file)
 #define PATH_MAX        4096
 
 #define NGROUPS_MAX    65536
+
+/* The number of data keys per process.  */
+#define _POSIX_THREAD_KEYS_MAX  128
+/* This is the value this implementation supports.  */
+#define PTHREAD_KEYS_MAX        1024
+
+/* Controlling the iterations of destructors for thread-specific data.  */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS     4
+/* Number of iterations this implementation does.  */
+#define PTHREAD_DESTRUCTOR_ITERATIONS   _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process.  */
+#define _POSIX_THREAD_THREADS_MAX       64
+/* We have no predefined limit on the number of threads.  */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+   priority level.  */
+#define AIO_PRIO_DELTA_MAX      20
+
+/* Minimum size for a thread.  We are free to choose a reasonable value.  */
+#define PTHREAD_STACK_MIN       131072
+
+/* Maximum number of timer expiration overruns.  */
+#define DELAYTIMER_MAX          2147483647
+
+/* Maximum tty name length.  */
+#define TTY_NAME_MAX            32
+
+/* Maximum login name length.  This is arbitrary.  */
+#define LOGIN_NAME_MAX          256
+
+/* Maximum host name length.  */
+#define HOST_NAME_MAX           64
+
+/* Maximum message queue priority level.  */
+#define MQ_PRIO_MAX             32768
+
+/* Maximum value the semaphore can have.  */
+#define SEM_VALUE_MAX           (2147483647)
diff --git a/sysdeps/nacl/exit-thread.h b/sysdeps/nacl/exit-thread.h
new file mode 100644 (file)
index 0000000..9c8ed33
--- /dev/null
@@ -0,0 +1,35 @@
+/* Call to terminate the current thread.  NaCl version.
+   Copyright (C) 2014 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <nacl-interfaces.h>
+
+/* This causes the current thread to exit, without affecting other
+   threads in the process if there are any.  If there are no other
+   threads left, then this has the effect of _exit (0).  */
+
+static inline void __attribute__ ((noreturn, always_inline, unused))
+__exit_thread (void)
+{
+  __nacl_irt_thread.thread_exit (NULL);
+
+  /* That never returns unless something is severely and unrecoverably wrong.
+     If it ever does, try to make sure we crash.  */
+  while (1)
+    __builtin_trap ();
+}
diff --git a/sysdeps/nacl/fork.c b/sysdeps/nacl/fork.c
new file mode 100644 (file)
index 0000000..2502a66
--- /dev/null
@@ -0,0 +1,2 @@
+/* Get the stub, bypassing the "generic" NPTL code.  */
+#include <posix/fork.c>
index 649e29b8df028b5a8ae7ece58a486a9cbb4aac18..3206eb75f9ac75e116c092a1876ea69d78c50869 100644 (file)
@@ -4,9 +4,7 @@ NACL_MANDATORY_INTERFACE (NACL_IRT_FILENAME_v0_1, nacl_irt_filename)
 NACL_MANDATORY_INTERFACE (NACL_IRT_MEMORY_v0_3, nacl_irt_memory)
 NACL_MANDATORY_INTERFACE (NACL_IRT_DYNCODE_v0_1, nacl_irt_dyncode)
 NACL_MANDATORY_INTERFACE (NACL_IRT_THREAD_v0_1, nacl_irt_thread)
-NACL_MANDATORY_INTERFACE (NACL_IRT_MUTEX_v0_1, nacl_irt_mutex)
-NACL_MANDATORY_INTERFACE (NACL_IRT_COND_v0_1, nacl_irt_cond)
-NACL_MANDATORY_INTERFACE (NACL_IRT_SEM_v0_1, nacl_irt_sem)
+NACL_MANDATORY_INTERFACE (NACL_IRT_FUTEX_v0_1, nacl_irt_futex)
 NACL_MANDATORY_INTERFACE (NACL_IRT_TLS_v0_1, nacl_irt_tls)
 NACL_MANDATORY_INTERFACE (NACL_IRT_RESOURCE_OPEN_v0_1, nacl_irt_resource_open)
 NACL_OPTIONAL_INTERFACE (NACL_IRT_CLOCK_v0_1, nacl_irt_clock)
diff --git a/sysdeps/nacl/tls.h b/sysdeps/nacl/tls.h
new file mode 100644 (file)
index 0000000..36d0b5b
--- /dev/null
@@ -0,0 +1,34 @@
+/* Definition for thread-local data handling.  NaCl version.
+   Copyright (C) 2014 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NACL_TLS_H
+#define _NACL_TLS_H    1
+
+#ifndef __ASSEMBLER__
+
+# include <nacl-interfaces.h>
+
+/* Code to initially initialize the thread pointer.  This might need
+   special attention since 'errno' is not yet available and if the
+   operation can cause a failure 'errno' must not be touched.  */
+# define TLS_INIT_TP(tcbp) \
+  ((*__nacl_irt_tls.tls_init) (tcbp) == 0 ? NULL : "tls_init call failed")
+
+#endif /* __ASSEMBLER__ */
+
+#endif  /* tls.h */