summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/arc/libc-tls.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2014-07-25 17:39:05 +0530
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2014-08-18 11:52:34 +0200
commit873fa5beccbb4e95d1bbb9afb6a0eec02811f09b (patch)
tree17ceb2c595fe9a491f3e7fa91d7c379babf2c356 /libpthread/nptl/sysdeps/arc/libc-tls.c
parent6915b3a6b96e8e34601941c0eb7519cde1c0f999 (diff)
NPTL: ARC support
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/arc/libc-tls.c')
-rw-r--r--libpthread/nptl/sysdeps/arc/libc-tls.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libpthread/nptl/sysdeps/arc/libc-tls.c b/libpthread/nptl/sysdeps/arc/libc-tls.c
new file mode 100644
index 000000000..f53ad112e
--- /dev/null
+++ b/libpthread/nptl/sysdeps/arc/libc-tls.c
@@ -0,0 +1,27 @@
+/*
+ * Thread-local storage handling in statically linked binaries.
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * Based on GNU C Library (file: libc/sysdeps/sh/libc-tls.c)
+ *
+ * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
+ * Copyright (C) 2010 STMicroelectronics Ltd.
+ *
+ * Author: Filippo Arcidiacono <filippo.arcidiacono@st.com>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sysdeps/generic/libc-tls.c>
+#include <dl-tls.h>
+
+#if defined(USE_TLS) && USE_TLS
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+ dtv_t *dtv = THREAD_DTV ();
+ return (char *) dtv[1].pointer.val + ti->ti_offset;
+}
+
+#endif