]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libpthread/nptl/sysdeps/metag/libc-tls.c
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libpthread / nptl / sysdeps / metag / libc-tls.c
1 /*
2  * Thread-local storage handling in statically linked binaries.  Meta version.
3  * Copyright (C) 2009 Free Software Foundation, Inc.
4  *
5  * Based on GNU C Library (file: libc/sysdeps/sh/libc-tls.c)
6  *
7  * Copyright (C) 2010 STMicroelectronics Ltd.
8  * Copyright (C) 2013 Imagination Technologies Ltd.
9  *
10  * Author: Filippo Arcidiacono <filippo.arcidiacono@st.com>
11  *
12  * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
13  *
14  */
15
16 #include <sysdeps/generic/libc-tls.c>
17 #include <dl-tls.h>
18
19 #if defined (USE_TLS) && (USE_TLS)
20
21 /* On Meta, linker optimizations are not required, so __tls_get_addr
22    can be called even in statically linked binaries.  In this case module
23    must be always 1 and PT_TLS segment exist in the binary, otherwise it
24    would not link.  */
25
26 void *
27 __tls_get_addr (tls_index *ti)
28 {
29   dtv_t *dtv = THREAD_DTV ();
30   return (char *) dtv[1].pointer.val + ti->ti_offset;
31 }
32
33 #endif