blob: 7c5cca01ea45e91a8de02b3a10d9932d02f58a0b [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001#include <sysdep.h>
2#include <tls.h>
3
4-- This line separates the #include lines from conditionals.
5
6# ifdef USE_TLS
7
8-- Abuse tls.h macros to derive offsets relative to the thread register.
9# undef __thread_register
10# define __thread_register ((void *) 0)
11# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct _pthread_descr_struct, p_##mem))
12
13# else
14
15# define thread_offsetof(mem) offsetof (tcbhead_t, mem)
16
17# endif
18
19MULTIPLE_THREADS_OFFSET thread_offsetof (multiple_threads)