Back to index

glibc  2.9
tls.h
Go to the documentation of this file.
00001 /* Definition for thread-local data handling.  Generic version.
00002    Copyright (C) 2002, 2006 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 /* An architecture-specific version of this file has to defined a
00021    number of symbols:
00022 
00023      TLS_TCB_AT_TP  or  TLS_DTV_AT_TP
00024 
00025      The presence of one of these symbols signals which variant of
00026      the TLS ABI is used.  There are in the moment two variants
00027      available:
00028 
00029      * the thread pointer points to a thread control block
00030 
00031      * the thread pointer points to the dynamic thread vector
00032 
00033 
00034      TLS_TCB_SIZE
00035 
00036      This is the size of the thread control block structure.  How
00037      this is actually defined depends on the ABI.  The thread control
00038      block could be internal descriptor of the thread library or
00039      just a data structure which allows finding the DTV.
00040 
00041      TLS_INIT_TCB_SIZE
00042 
00043      Similarly, but this value is only used at startup and in the
00044      dynamic linker itself.  There are no threads in use at that time.
00045 
00046 
00047      TLS_TCB_ALIGN
00048 
00049      Alignment requirements for the TCB structure.
00050 
00051      TLS_INIT_TCB_ALIGN
00052 
00053      Similarly, but for the structure used at startup time.
00054 
00055 
00056      INSTALL_DTV(tcb, init_dtv)
00057 
00058      This macro must install the given initial DTV into the thread control
00059      block TCB.  The normal runtime functionality must then be able to
00060      use the value.
00061 
00062 
00063      TLS_INIT_TP(tcb, firstcall)
00064 
00065      This macro must initialize the thread pointer to enable normal TLS
00066      operation.  The first parameter is a pointer to the thread control
00067      block.  The second parameter specifies whether this is the first
00068      call for the TCB.  ld.so calls this macro more than once.
00069 
00070 
00071      THREAD_DTV()
00072 
00073      This macro returns the address of the DTV of the current thread.
00074      This normally is done using the the thread register which points
00075      to the dtv or the TCB (from which the DTV can found).
00076   */