1 /* Definition for thread-local data handling. Generic version. 2 Copyright (C) 2002 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 The GNU C Library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, see 17 <http://www.gnu.org/licenses/>. */ 18 19 /* By default no TLS support is available. This is signaled by the 20 absence of the symbol USE_TLS. */ 21 #undef USE_TLS 22 23 24 /* An architecture-specific version of this file has to defined a 25 number of symbols: 26 27 TLS_TCB_AT_TP or TLS_DTV_AT_TP 28 29 The presence of one of these symbols signals which variant of 30 the TLS ABI is used. There are in the moment two variants 31 available: 32 33 * the thread pointer points to a thread control block 34 35 * the thread pointer points to the dynamic thread vector 36 37 38 TLS_TCB_SIZE 39 40 This is the size of the thread control block structure. How 41 this is actually defined depends on the ABI. The thread control 42 block could be internal descriptor of the thread library or 43 just a data structure which allows finding the DTV. 44 45 TLS_INIT_TCB_SIZE 46 47 Similarly, but this value is only used at startup and in the 48 dynamic linker itself. There are no threads in use at that time. 49 50 51 TLS_TCB_ALIGN 52 53 Alignment requirements for the TCB structure. 54 55 TLS_INIT_TCB_ALIGN 56 57 Similarly, but for the structure used at startup time. 58 59 60 INSTALL_DTV(tcb, init_dtv) 61 62 This macro must install the given initial DTV into the thread control 63 block TCB. The normal runtime functionality must then be able to 64 use the value. 65 66 67 TLS_INIT_TP(tcb, firstcall) 68 69 This macro must initialize the thread pointer to enable normal TLS 70 operation. The first parameter is a pointer to the thread control 71 block. The second parameter specifies whether this is the first 72 call for the TCB. ld.so calls this macro more than once. 73 74 75 THREAD_DTV() 76 77 This macro returns the address of the DTV of the current thread. 78 This normally is done using the the thread register which points 79 to the dtv or the TCB (from which the DTV can found). 80 */ 81