+++ /dev/null
-# We can do everything that 6T2 can
-arm/armv6t2/nacl
-/* 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>
--- /dev/null
+inet
+resolv
+nss
+ld {
+ GLIBC_PRIVATE {
+ __nacl_irt_*;
+ }
+}
+
libc {
GLIBC_2.17 {
nacl_interface_query;
#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)
--- /dev/null
+/* 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 ();
+}
--- /dev/null
+/* Get the stub, bypassing the "generic" NPTL code. */
+#include <posix/fork.c>
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)
--- /dev/null
+/* 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 */