summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/include
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2019-12-27 00:32:16 +0000
committerkamil <kamil@NetBSD.org>2019-12-27 00:32:16 +0000
commitd1b17eeb640b139e330df2233dbc19d693b0605a (patch)
tree92d24991c1115eaf46b7d420f83868ab5b8e89e0 /sys/arch/sparc/include
parente6c5fb7b84b56cc06ce1b333c04bc1ab511430c9 (diff)
Harmonize the namespace of fast TLS base pointer getter functions
Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and __LIBPTHREAD_SOURCE__. Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS for the sake of consistency.
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r--sys/arch/sparc/include/mcontext.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/sparc/include/mcontext.h b/sys/arch/sparc/include/mcontext.h
index 5c1fa9c8457..c58feee22f5 100644
--- a/sys/arch/sparc/include/mcontext.h
+++ b/sys/arch/sparc/include/mcontext.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.17 2018/02/19 08:31:13 mrg Exp $ */
+/* $NetBSD: mcontext.h,v 1.18 2019/12/27 00:32:17 kamil Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -161,6 +161,11 @@ do { \
(uc)->uc_mcontext.__gregs[_REG_nPC] = (pc) + 4; \
} while (/*CONSTCOND*/0)
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -170,5 +175,8 @@ __lwp_getprivate_fast(void)
return __tmp;
}
+__END_DECLS
+
+#endif
#endif /* !_SPARC_MCONTEXT_H_ */