aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-12-09 21:16:34 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-29 20:50:05 +0000
commit5c1667e8be86e9ca7d3111b67ca19abcace634a2 (patch)
treed3e27e73b5f175d4b65150ab94171b0461793301
parentb602867013cfb41b2b884f0fc50748c4f12608d4 (diff)
mips _libc_get_static_tls_base: Narrow scope of #ifdef.
Reviewed by: kib, emaste, jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33348 (cherry picked from commit 9952b82b398968a243909ee3854b1968c3cc8c12)
-rw-r--r--lib/libc/mips/static_tls.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libc/mips/static_tls.h b/lib/libc/mips/static_tls.h
index 67ee8afe14c6..b823a34eaf8b 100644
--- a/lib/libc/mips/static_tls.h
+++ b/lib/libc/mips/static_tls.h
@@ -40,23 +40,17 @@ _libc_get_static_tls_base(size_t offset)
{
uintptr_t tlsbase;
-#if defined(__mips_n64)
__asm__ __volatile__ (
".set\tpush\n\t"
+#if defined(__mips_n64)
".set\tmips64r2\n\t"
- "rdhwr\t%0, $29\n\t"
- ".set\tpop"
- : "=r" (tlsbase));
- tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE;
#else /* mips 32 */
- __asm__ __volatile__ (
- ".set\tpush\n\t"
".set\tmips32r2\n\t"
+#endif /* ! __mips_n64 */
"rdhwr\t%0, $29\n\t"
".set\tpop"
: "=r" (tlsbase));
tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE;
-#endif /* ! __mips_n64 */
tlsbase += offset;
return (tlsbase);
}