1 /*
2  * This file is subject to the terms and conditions of the LGPL V2.1
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 2019 Kalray Inc.
7  */
8 
9 #ifndef _KVX_DL_TLS_H
10 #define _KVX_DL_TLS_H 1
11 
12 /* Type used to represent a TLS descriptor in the GOT.  */
13 struct tlsdesc
14 {
15   ptrdiff_t (*entry) (struct tlsdesc *);
16   void *arg;
17 };
18 
19 typedef struct dl_tls_index
20 {
21   unsigned long int ti_module;
22   unsigned long int ti_offset;
23 } tls_index;
24 
25 /* Type used as the argument in a TLS descriptor for a symbol that
26    needs dynamic TLS offsets.  */
27 struct tlsdesc_dynamic_arg
28 {
29   tls_index tlsinfo;
30   size_t gen_count;
31 };
32 
33 extern ptrdiff_t attribute_hidden
34 _dl_tlsdesc_return (struct tlsdesc *);
35 
36 # ifdef SHARED
37 extern void *_dl_make_tlsdesc_dynamic (struct link_map *, size_t);
38 
39 extern ptrdiff_t attribute_hidden
40 _dl_tlsdesc_dynamic (struct tlsdesc *);
41 # endif
42 
43 extern void *__tls_get_addr (tls_index *ti);
44 
45 #define TLS_DTV_UNALLOCATED ((void *) -1l)
46 
47 #endif
48