Cleanup and retool portions of the TLS support and make sure that
[dragonfly.git] / sys / sys / tls.h
1 /*
2  * SYS/TLS.H
3  *
4  *      Implements the architecture independant TLS info structure.
5  *
6  * $DragonFly: src/sys/sys/tls.h,v 1.5 2005/03/28 03:33:08 dillon Exp $
7  */
8
9 #ifndef _SYS_TLS_H_
10 #define _SYS_TLS_H_
11
12 #include <sys/types.h>
13
14 struct tls_info {
15         void *base;
16         int size;
17 };
18
19 struct tls_tcb {
20         struct tls_tcb *tcb_base;       /* self pointer (data at -OFFSET) */
21         void *dtv_base;         /* RTLD tls_get_addr info base */
22         void *reserved[6];
23 };
24
25 #define RTLD_STATIC_TLS_ALIGN           16
26 #define RTLD_STATIC_TLS_ALIGN_MASK      (RTLD_STATIC_TLS_ALIGN - 1)
27
28 /*
29  * flags for _rtld_allocate_tls() and allocate_tls()
30  */
31 #define RTLD_ALLOC_TLS_FREE_OLD         0x0001
32
33 #ifndef _KERNEL
34 int sys_set_tls_area(int which, struct tls_info *info, size_t infosize);
35 int sys_get_tls_area(int which, struct tls_info *info, size_t infosize);
36 #endif
37
38 #endif