]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/alpha/nptl/tls.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / alpha / nptl / tls.h
index 64ddcd5c011f55a0c19f3f5097a8d3287186ff40..90d98e124dd5cb0f8bcdda2327dc905add24e0f7 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/Alpha version.
-   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef _TLS_H
 #define _TLS_H 1
@@ -38,23 +37,12 @@ typedef union dtv
   } pointer;
 } dtv_t;
 
-#else /* __ASSEMBLER__ */
-# include <tcb-offsets.h>
-#endif /* __ASSEMBLER__ */
-
-
-/* We require TLS support in the tools.  */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
-#ifndef __ASSEMBLER__
-
 /* Get system call information.  */
 # include <sysdep.h>
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
@@ -96,9 +84,12 @@ typedef struct
 /* Code to initially initialize the thread pointer.  This might need
    special attention since 'errno' is not yet available and if the
    operation can cause a failure 'errno' must not be touched.  */
-# define TLS_INIT_TP(tcbp, secondcall) \
+# define TLS_INIT_TP(tcbp) \
   (__builtin_set_thread_pointer ((void *)(tcbp)), NULL)
 
+/* Value passed to 'clone' for initialization of the thread register.  */
+# define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
+
 /* Return the address of the dtv for the current thread.  */
 # define THREAD_DTV() \
   (((tcbhead_t *) __builtin_thread_pointer ())->dtv)
@@ -131,7 +122,7 @@ typedef struct
        = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,             \
                               THREAD_GSCOPE_FLAG_UNUSED);                   \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)                                 \
-       lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);                \
+       lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
     }                                                                       \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
@@ -144,6 +135,8 @@ typedef struct
 #define THREAD_GSCOPE_WAIT() \
   GL(dl_wait_lookup_done) ()
 
+#else /* __ASSEMBLER__ */
+# include <tcb-offsets.h>
 #endif /* __ASSEMBLER__ */
 
 #endif /* tls.h */