Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Harmonize the namespace of fast TLS base pointer ge...
details: https://anonhg.NetBSD.org/src/rev/7efa6a0c7d37
branches: trunk
changeset: 967893:7efa6a0c7d37
user: kamil <kamil%NetBSD.org@localhost>
date: Fri Dec 27 00:32:16 2019 +0000
description:
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:
sys/arch/alpha/include/mcontext.h | 10 +++++++++-
sys/arch/amd64/include/mcontext.h | 10 +++++++++-
sys/arch/hppa/include/mcontext.h | 10 +++++++++-
sys/arch/i386/include/mcontext.h | 10 +++++++++-
sys/arch/ia64/include/mcontext.h | 10 +++++++++-
sys/arch/sh3/include/mcontext.h | 10 +++++++++-
sys/arch/sparc/include/mcontext.h | 10 +++++++++-
sys/arch/vax/include/mcontext.h | 9 +++++++--
8 files changed, 70 insertions(+), 9 deletions(-)
diffs (242 lines):
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/alpha/include/mcontext.h
--- a/sys/arch/alpha/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/alpha/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.9 2018/02/15 15:53:56 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:16 kamil Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -102,6 +102,11 @@
#define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc)
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -113,5 +118,8 @@
return __tmp;
}
+__END_DECLS
+
+#endif
#endif /* !_ALPHA_MCONTEXT_H_ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/amd64/include/mcontext.h
--- a/sys/arch/amd64/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/amd64/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.19 2018/02/15 15:53:56 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.20 2019/12/27 00:32:16 kamil Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -84,6 +84,11 @@
#define __UCONTEXT_SIZE 784
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -93,6 +98,9 @@
return __tmp;
}
+__END_DECLS
+
+#endif
#ifdef _KERNEL
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/hppa/include/mcontext.h
--- a/sys/arch/hppa/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/hppa/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.10 2018/02/27 11:26:39 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.11 2019/12/27 00:32:17 kamil Exp $ */
#ifndef _HPPA_MCONTEXT_H_
#define _HPPA_MCONTEXT_H_
@@ -59,6 +59,11 @@
} while (/*CONSTCOND*/0)
#define _UC_MACHINE_INTRV(uc) ((uc)->uc_mcontext.__gregs[_REG_RET0])
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -68,6 +73,9 @@
return __tmp;
}
+__END_DECLS
+
+#endif
#endif /* !__ASSEMBLER__ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/i386/include/mcontext.h
--- a/sys/arch/i386/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/i386/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.14 2018/02/15 15:53:56 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.15 2019/12/27 00:32:17 kamil Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -113,6 +113,11 @@
#define __UCONTEXT_SIZE 776
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -122,5 +127,8 @@
return __tmp;
}
+__END_DECLS
+
+#endif
#endif /* !_I386_MCONTEXT_H_ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/ia64/include/mcontext.h
--- a/sys/arch/ia64/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/ia64/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.9 2019/06/17 15:08:34 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -117,10 +117,18 @@
#define _UC_MACHINE_INTRV(uc) ((uc)->uc_mcontext.__gregs[8])
#define _UC_MACHINE_SET_PC(uc, pc) (uc)->uc_mcontext.mc_special.iip = (pc)
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
return (void*)0;
}
+__END_DECLS
+
+#endif
#endif /* !_IA64_MCONTEXT_H_ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/sh3/include/mcontext.h
--- a/sys/arch/sh3/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/sh3/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.11 2018/02/15 15:53:57 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.12 2019/12/27 00:32:17 kamil Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -95,6 +95,11 @@
#define _UC_CLRSTACK 0x20000
#define _UC_TLSBASE 0x80000
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
+
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -104,5 +109,8 @@
return __gbr;
}
+__END_DECLS
+
+#endif
#endif /* !_SH3_MCONTEXT_H_ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/sparc/include/mcontext.h
--- a/sys/arch/sparc/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/sparc/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -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 @@
(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 @@
return __tmp;
}
+__END_DECLS
+
+#endif
#endif /* !_SPARC_MCONTEXT_H_ */
diff -r 00d6a37451e1 -r 7efa6a0c7d37 sys/arch/vax/include/mcontext.h
--- a/sys/arch/vax/include/mcontext.h Thu Dec 26 17:52:49 2019 +0000
+++ b/sys/arch/vax/include/mcontext.h Fri Dec 27 00:32:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.9 2018/02/15 15:53:57 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -74,9 +74,12 @@
#define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc)
-#ifndef _KERNEL
+#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \
+ defined(__LIBPTHREAD_SOURCE__)
+#include <sys/tls.h>
#include <sys/syscall.h>
+__BEGIN_DECLS
static __inline void *
__lwp_getprivate_fast(void)
{
@@ -84,6 +87,8 @@
__asm("chmk %0" :: "i"(SYS__lwp_getprivate) : "r0");
return tcb;
}
+__END_DECLS
+
#endif
#endif /* !_VAX_MCONTEXT_H_ */
Home |
Main Index |
Thread Index |
Old Index