riscv64: sync with glibc, fix all TLS errors in uClibc-ng-test
[uclibc-ng.git] / libpthread / nptl / sysdeps / riscv64 / dl-tls.h
blob31991be0db59cf1d975cf14e23a4b27c3baa906b
1 /* Copyright (C) 2005-2016 Free Software Foundation, Inc.
3 The GNU C Library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) any later version.
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Lesser General Public License for more details.
13 You should have received a copy of the GNU Lesser General Public
14 License along with the GNU C Library; if not, see
15 <http://www.gnu.org/licenses/>. */
17 /* Type used for the representation of TLS information in the GOT. */
18 typedef struct
20 unsigned long int ti_module;
21 unsigned long int ti_offset;
22 } tls_index;
24 /* The thread pointer points to the first static TLS block. */
25 #define TLS_TP_OFFSET 0
27 /* Dynamic thread vector pointers point 0x800 past the start of each
28 TLS block. */
29 #define TLS_DTV_OFFSET 0x800
31 extern void *__tls_get_addr (tls_index *ti);
33 #define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
34 #define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)