2014-10-17 Roland McGrath <roland@hack.frob.com>
+ * sysdeps/i386/nptl/tls.h
+ (THREAD_SELF_SYSINFO, THREAD_SYSINFO): Macros removed.
+ [NEED_DL_SYSINFO] (SETUP_THREAD_SYSINFO, CHECK_THREAD_SYSINFO):
+ New macros.
+ * sysdeps/ia64/nptl/tls.h [NEED_DL_SYSINFO]
+ (SETUP_THREAD_SYSINFO, CHECK_THREAD_SYSINFO): New macros.
+ * nptl/allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]:
+ Call SETUP_THREAD_SYSINFO instead of doing an assignment.
+ * nptl/createthread.c (create_thread) [NEED_DL_SYSINFO]:
+ Call CHECK_THREAD_SYSINFO instead of doing an assert.
+
* nptl/nptl-init.c (__pthread_initialize_minimal_internal):
Conditionalize FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME probes
on [__NR_futex].
#endif
#ifdef NEED_DL_SYSINFO
- /* Copy the sysinfo value from the parent. */
- THREAD_SYSINFO(pd) = THREAD_SELF_SYSINFO;
+ SETUP_THREAD_SYSINFO (pd);
#endif
/* The process ID is also the same as that of the caller. */
#endif
#ifdef NEED_DL_SYSINFO
- /* Copy the sysinfo value from the parent. */
- THREAD_SYSINFO(pd) = THREAD_SELF_SYSINFO;
+ SETUP_THREAD_SYSINFO (pd);
#endif
/* Don't allow setxid until cloned. */
}
#ifdef NEED_DL_SYSINFO
- assert (THREAD_SELF_SYSINFO == THREAD_SYSINFO (pd));
+ CHECK_THREAD_SYSINFO (pd);
#endif
/* Determine whether the newly created threads has to be started
/* Minimal initialization of the thread descriptor. */
struct pthread *pd = THREAD_SELF;
+#ifdef __NR_set_tid_address
INTERNAL_SYSCALL_DECL (err);
pd->pid = pd->tid = INTERNAL_SYSCALL (set_tid_address, err, 1, &pd->tid);
+#endif
THREAD_SETMEM (pd, specific[0], &pd->specific_1stblock[0]);
THREAD_SETMEM (pd, user_stack, true);
if (LLL_LOCK_INITIALIZER != 0)
# define GET_DTV(descr) \
(((tcbhead_t *) (descr))->dtv)
-#define THREAD_SELF_SYSINFO THREAD_GETMEM (THREAD_SELF, header.sysinfo)
-#define THREAD_SYSINFO(pd) ((pd)->header.sysinfo)
-
/* Macros to load from and store into segment registers. */
# ifndef TLS_GET_GS
# define TLS_GET_GS() \
__asm ("movw %w0, %%gs" :: "q" (val))
# endif
-#if defined NEED_DL_SYSINFO
+#ifdef NEED_DL_SYSINFO
# define INIT_SYSINFO \
_head->sysinfo = GLRO(dl_sysinfo)
+# define SETUP_THREAD_SYSINFO(pd) \
+ ((pd)->header.sysinfo = THREAD_GETMEM (THREAD_SELF, header.sysinfo))
+# define CHECK_THREAD_SYSINFO(pd) \
+ assert ((pd)->header.sysinfo == THREAD_GETMEM (THREAD_SELF, header.sysinfo))
#else
# define INIT_SYSINFO
#endif
#define THREAD_SYSINFO(pd) \
(((tcbhead_t *) ((char *) (pd) + TLS_PRE_TCB_SIZE))->__private)
-#if defined NEED_DL_SYSINFO
+#ifdef NEED_DL_SYSINFO
# define INIT_SYSINFO THREAD_SELF_SYSINFO = (void *) GLRO(dl_sysinfo)
+# define SETUP_THREAD_SYSINFO(pd) \
+ (THREAD_SYSINFO (pd) = THREAD_SELF_SYSINFO)
+# define CHECK_THREAD_SYSINFO(pd) \
+ assert (THREAD_SYSINFO (pd) == THREAD_SELF_SYSINFO)
#else
# define INIT_SYSINFO NULL
#endif