1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

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
This commit is contained in:
John Baldwin 2021-12-09 13:16:34 -08:00
parent 23e0c0e9a3
commit 9952b82b39

View File

@ -40,23 +40,17 @@ _libc_get_static_tls_base(size_t offset)
{
uintptr_t tlsbase;
__asm__ __volatile__ (
".set\tpush\n\t"
#if defined(__mips_n64)
__asm__ __volatile__ (
".set\tpush\n\t"
".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);
}