Blame sysdeps/generic/tls.h

Packit 6c4009
/* Definition for thread-local data handling.  Generic version.
Packit 6c4009
   Copyright (C) 2002-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/* An architecture-specific version of this file has to defined a
Packit 6c4009
   number of symbols:
Packit 6c4009
Packit 6c4009
     TLS_TCB_AT_TP  or  TLS_DTV_AT_TP
Packit 6c4009
Packit 6c4009
     The presence of one of these symbols signals which variant of
Packit 6c4009
     the TLS ABI is used.  There are in the moment two variants
Packit 6c4009
     available:
Packit 6c4009
Packit 6c4009
     * the thread pointer points to a thread control block
Packit 6c4009
Packit 6c4009
     * the thread pointer points to the dynamic thread vector
Packit 6c4009
Packit 6c4009
Packit 6c4009
     TLS_TCB_SIZE
Packit 6c4009
Packit 6c4009
     This is the size of the thread control block structure.  How
Packit 6c4009
     this is actually defined depends on the ABI.  The thread control
Packit 6c4009
     block could be internal descriptor of the thread library or
Packit 6c4009
     just a data structure which allows finding the DTV.
Packit 6c4009
Packit 6c4009
     TLS_INIT_TCB_SIZE
Packit 6c4009
Packit 6c4009
     Similarly, but this value is only used at startup and in the
Packit 6c4009
     dynamic linker itself.  There are no threads in use at that time.
Packit 6c4009
Packit 6c4009
Packit 6c4009
     TLS_TCB_ALIGN
Packit 6c4009
Packit 6c4009
     Alignment requirements for the TCB structure.
Packit 6c4009
Packit 6c4009
     TLS_INIT_TCB_ALIGN
Packit 6c4009
Packit 6c4009
     Similarly, but for the structure used at startup time.
Packit 6c4009
Packit 6c4009
Packit 6c4009
     INSTALL_DTV(tcb, init_dtv)
Packit 6c4009
Packit 6c4009
     This macro must install the given initial DTV into the thread control
Packit 6c4009
     block TCB.  The normal runtime functionality must then be able to
Packit 6c4009
     use the value.
Packit 6c4009
Packit 6c4009
Packit 6c4009
     TLS_INIT_TP(tcb)
Packit 6c4009
Packit 6c4009
     This macro must initialize the thread pointer to enable normal TLS
Packit 6c4009
     operation.  The parameter is a pointer to the thread control block.
Packit 6c4009
     ld.so calls this macro once.
Packit 6c4009
Packit 6c4009
Packit 6c4009
     THREAD_DTV()
Packit 6c4009
Packit 6c4009
     This macro returns the address of the DTV of the current thread.
Packit 6c4009
     This normally is done using the thread register which points
Packit 6c4009
     to the dtv or the TCB (from which the DTV can found).
Packit 6c4009
Packit 6c4009
Packit 6c4009
     THREAD_GSCOPE_IN_TCB
Packit 6c4009
Packit 6c4009
     This should be set to 1 if the global scope flag is stored within the TCB.
Packit 6c4009
     When set to 0, GL(_dl_thread_gscope_count) will be defined to store it.
Packit 6c4009
  */