aboutsummaryrefslogtreecommitdiff
path: root/ports/sysdeps/mips/nptl/tls.h
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2013-02-27 23:45:07 +0000
committerMaciej W. Rozycki <macro@codesourcery.com>2013-02-27 23:45:07 +0000
commit43301bd3c281036ba97eef384c9340cc7b6130d3 (patch)
tree263f0cc7e01c33c72e626480a52b2bfc1dce78f0 /ports/sysdeps/mips/nptl/tls.h
parent85bd816a603a437aedeb688a60a3e0dba4439c50 (diff)
downloadglibc-43301bd3c281036ba97eef384c9340cc7b6130d3.zip
glibc-43301bd3c281036ba97eef384c9340cc7b6130d3.tar.gz
glibc-43301bd3c281036ba97eef384c9340cc7b6130d3.tar.bz2
Add support for building as MIPS16 code.
Diffstat (limited to 'ports/sysdeps/mips/nptl/tls.h')
-rw-r--r--ports/sysdeps/mips/nptl/tls.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/sysdeps/mips/nptl/tls.h b/ports/sysdeps/mips/nptl/tls.h
index 0c91995..2529408 100644
--- a/ports/sysdeps/mips/nptl/tls.h
+++ b/ports/sysdeps/mips/nptl/tls.h
@@ -37,12 +37,17 @@ typedef union dtv
} pointer;
} dtv_t;
+#ifdef __mips16
+/* MIPS16 uses GCC builtin to access the TP. */
+# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
+#else
/* Note: rd must be $v1 to be ABI-conformant. */
# define READ_THREAD_POINTER() \
({ void *__result; \
asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \
"rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \
__result; })
+#endif
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>