147
152
((descr)->p_header.data.pointer_guard \
148
153
= THREAD_GETMEM (THREAD_SELF, p_header.data.pointer_guard))
155
/* Get and set the global scope generation counter in the TCB head. */
156
#define THREAD_GSCOPE_FLAG_UNUSED 0
157
#define THREAD_GSCOPE_FLAG_USED 1
158
#define THREAD_GSCOPE_FLAG_WAIT 2
159
#ifdef __FreeBSD_kernel__
160
# define THREAD_GSCOPE_RESET_FLAG() \
163
asm volatile ("xchgl %0, %%fs:%P1" \
165
: "i" (offsetof (struct _pthread_descr_struct, p_gscope_flag)), \
166
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
167
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
168
lll_futex_wake (&THREAD_SELF->p_gscope_flag, 1); \
172
/* As the FreeBSD kernel defines futex as long (compared to int with
173
a Linux kernel), we need to use xchgq instead of xchgl to handle
174
the gscope_flag variable. */
175
# define THREAD_GSCOPE_RESET_FLAG() \
178
asm volatile ("xchgq %0, %%fs:%P1" \
180
: "i" (offsetof (struct _pthread_descr_struct, p_gscope_flag)), \
181
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
182
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
183
lll_futex_wake (&THREAD_SELF->p_gscope_flag, 1); \
186
#endif /* __FreeBSD_kernel__ */
187
#define THREAD_GSCOPE_SET_FLAG() \
188
THREAD_SETMEM (THREAD_SELF, p_gscope_flag, THREAD_GSCOPE_FLAG_USED)
189
#define THREAD_GSCOPE_WAIT() \
190
do { /* GL(dl_wait_lookup_done) () */ } while (0)
150
192
# endif /* HAVE_TLS_SUPPORT */
151
193
#endif /* __ASSEMBLER__ */