#ifdef TLS_MULTIPLE_THREADS_IN_TCB
/* This is at least the second thread. */
- pd->multiple_threads = 1;
+ pd->header.multiple_threads = 1;
#else
__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
#endif
#ifdef NEED_DL_SYSINFO
/* Copy the sysinfo value from the parent. */
- pd->sysinfo = THREAD_GETMEM (THREAD_SELF, sysinfo);
+ pd->header.sysinfo = THREAD_GETMEM (THREAD_SELF, header.sysinfo);
#endif
/* Allocate the DTV for this thread. */
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
/* This is at least the second thread. */
- pd->multiple_threads = 1;
+ pd->header.multiple_threads = 1;
#else
__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
#endif
#ifdef NEED_DL_SYSINFO
/* Copy the sysinfo value from the parent. */
- pd->sysinfo = THREAD_GETMEM (THREAD_SELF, sysinfo);
+ pd->header.sysinfo = THREAD_GETMEM (THREAD_SELF, header.sysinfo);
#endif
/* Allocate the DTV for this thread. */
/* Thread descriptor data structure. */
struct pthread
{
-#if !TLS_DTV_AT_TP
- /* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */
union
{
- tcbhead_t;
- void *__padding[16];
- };
+#if !TLS_DTV_AT_TP
+ /* This overlaps the TCB as used for TLS without threads (see tls.h). */
+ tcbhead_t header;
#elif TLS_MULTIPLE_THREADS_IN_TCB
- int multiple_threads;
+ struct
+ {
+ int multiple_threads;
+ } header;
#endif
+ /* This extra padding has no special purpose, and this structure layout
+ is private and subject to change without affecting the official ABI.
+ We just have it here in case it might be convenient for some
+ implementation-specific instrumentation hack or suchlike. */
+ void *__padding[16];
+ };
+
/* This descriptor's link on the `stack_used' or `__stack_user' list. */
list_t list;
#ifdef TLS_TCB_AT_TP
/* Reference to the TCB itself. */
- pd->self = pd;
+ pd->header.self = pd;
/* Self-reference for TLS. */
- pd->tcb = pd;
+ pd->header.tcb = pd;
#endif
/* Store the address of the start routine and the parameter. Since
/* Install new dtv for current thread. */
# define INSTALL_NEW_DTV(dtvp) \
({ struct pthread *__pd; \
- THREAD_SETMEM (__pd, dtv, (dtvp)); })
+ THREAD_SETMEM (__pd, header.dtv, (dtvp)); })
/* Return dtv of given thread descriptor. */
# define GET_DTV(descr) \
/* Return the address of the dtv for the current thread. */
# define THREAD_DTV() \
({ struct pthread *__pd; \
- THREAD_GETMEM (__pd, dtv); })
+ THREAD_GETMEM (__pd, header.dtv); })
/* Return the thread descriptor for the current thread.
# define THREAD_SELF \
({ struct pthread *__self; \
asm ("movl %%gs:%c1,%0" : "=r" (__self) \
- : "i" (offsetof (struct pthread, self))); \
+ : "i" (offsetof (struct pthread, header.self))); \
__self;})
#endif
#ifdef TLS_TCB_AT_TP
- assert (pd->tcb != NULL);
+ assert (pd->header.tcb != NULL);
#endif
if (__builtin_expect (THREAD_GETMEM (THREAD_SELF, report_events), 0))
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
/* We now have for sure more than one thread. */
- pd->multiple_threads = 1;
+ pd->header.multiple_threads = 1;
#else
__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
#endif
}
#ifdef NEED_DL_SYSINFO
- assert (THREAD_GETMEM (THREAD_SELF, sysinfo) == pd->sysinfo);
+ assert (THREAD_GETMEM (THREAD_SELF, header.sysinfo) == pd->header.sysinfo);
#endif
/* We rely heavily on various flags the CLONE function understands:
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
/* We now have for sure more than one thread. */
- THREAD_SETMEM (THREAD_SELF, multiple_threads, 1);
+ THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1);
#endif
return 0;
# ifndef __ASSEMBLER__
# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, multiple_threads) == 0, 1)
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
# else
# define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET
# endif
# ifndef __ASSEMBLER__
# define SINGLE_THREAD_P \
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.data.multiple_threads) == 0, 1)
+ header.multiple_threads) == 0, 1)
# else
# define SINGLE_THREAD_P \
ear %r1,%a0; \
# ifndef __ASSEMBLER__
# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, multiple_threads) == 0, 1)
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
# else
# define SINGLE_THREAD_P \
stc gbr,r0; \
/* Install new dtv for current thread. */
# define INSTALL_NEW_DTV(dtvp) \
({ struct pthread *__pd; \
- THREAD_SETMEM (__pd, dtv, (dtvp)); })
+ THREAD_SETMEM (__pd, header.dtv, (dtvp)); })
/* Return dtv of given thread descriptor. */
# define GET_DTV(descr) \
/* Return the address of the dtv for the current thread. */
# define THREAD_DTV() \
({ struct pthread *__pd; \
- THREAD_GETMEM (__pd, dtv); })
+ THREAD_GETMEM (__pd, header.dtv); })
/* Return the thread descriptor for the current thread.
# define THREAD_SELF \
({ struct pthread *__self; \
asm ("movq %%fs:%c1,%q0" : "=r" (__self) \
- : "i" (offsetof (struct pthread, self))); \
+ : "i" (offsetof (struct pthread, header.self))); \
__self;})