Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Introduce __HAVE_NO___THREAD for sun2 and vax to disable the...



details:   https://anonhg.NetBSD.org/src/rev/8ba855d46cea
branches:  trunk
changeset: 772841:8ba855d46cea
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Jan 17 20:34:57 2012 +0000

description:
Introduce __HAVE_NO___THREAD for sun2 and vax to disable the TLS usage.
Require __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II as well as
__lwp_getprivate_fast / __lwp_gettcb_fast to exist for libpthread.
Define VAX as going to use TLS variant I, if it is ever implemented.

diffstat:

 lib/libpthread/pthread_int.h                        |  18 ++----------------
 sys/arch/sun2/include/types.h                       |   3 ++-
 sys/arch/vax/include/types.h                        |   4 +++-
 tests/lib/libc/tls/dso/h_tls_dlopen.c               |   6 +++---
 tests/lib/libc/tls/t_tls_dlopen.c                   |   8 ++++----
 tests/lib/libc/tls/t_tls_dynamic.c                  |   8 ++++----
 tests/lib/libc/tls/t_tls_static.c                   |   8 ++++----
 tests/lib/libc/tls/t_tls_static_helper.c            |   6 +++---
 tests/lib/libc/tls_dso/h_tls_dynamic.c              |   6 +++---
 tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c |   2 +-
 10 files changed, 29 insertions(+), 40 deletions(-)

diffs (254 lines):

diff -r 793035107b0a -r 8ba855d46cea lib/libpthread/pthread_int.h
--- a/lib/libpthread/pthread_int.h      Tue Jan 17 19:46:55 2012 +0000
+++ b/lib/libpthread/pthread_int.h      Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_int.h,v 1.81 2011/10/06 16:03:48 christos Exp $        */
+/*     $NetBSD: pthread_int.h,v 1.82 2012/01/17 20:34:57 joerg Exp $   */
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -266,22 +266,8 @@
 #endif
        return (pthread_t)tcb->tcb_pthread;
 }
-#elif 0 && defined(__HAVE___LWP_GETPRIVATE_FAST)
-static inline pthread_t __constfunc
-pthread__self(void)
-{
-       return (pthread_t)__lwp_getprivate_fast();
-}
 #else
-/* Stack location of pointer to a particular thread */
-extern vaddr_t pthread__mainbase;
-extern vaddr_t pthread__mainstruct;
-static inline pthread_t
-pthread__id(vaddr_t sp) {
-       vaddr_t va = sp & pthread__threadmask;
-       return (pthread_t)(va == pthread__mainbase ? pthread__mainstruct : va);
-}
-#define pthread__self()        (pthread__id(pthread__sp()))
+#error Either __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II must be defined
 #endif
 
 #define pthread__abort()                                               \
diff -r 793035107b0a -r 8ba855d46cea sys/arch/sun2/include/types.h
--- a/sys/arch/sun2/include/types.h     Tue Jan 17 19:46:55 2012 +0000
+++ b/sys/arch/sun2/include/types.h     Tue Jan 17 20:34:57 2012 +0000
@@ -1,7 +1,8 @@
-/*     $NetBSD: types.h,v 1.10 2011/06/12 03:35:47 rmind Exp $ */
+/*     $NetBSD: types.h,v 1.11 2012/01/17 20:34:57 joerg Exp $ */
 
 #include <m68k/types.h>
 #define        __HAVE_MM_MD_KERNACC
 #define        __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #define        __HAVE_MM_MD_READWRITE
 #define        __HAVE_MM_MD_MMAP
+#define        __HAVE_NO___THREAD
diff -r 793035107b0a -r 8ba855d46cea sys/arch/vax/include/types.h
--- a/sys/arch/vax/include/types.h      Tue Jan 17 19:46:55 2012 +0000
+++ b/sys/arch/vax/include/types.h      Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.43 2011/06/12 03:35:49 rmind Exp $ */
+/*     $NetBSD: types.h,v 1.44 2012/01/17 20:34:57 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -80,5 +80,7 @@
 #define        __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 
 #define        __HAVE___LWP_GETPRIVATE_FAST
+#define        __HAVE_NO___THREAD
+#define        __HAVE_TLS_VARIANT_I
 
 #endif /* _MACHTYPES_H_ */
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls/dso/h_tls_dlopen.c
--- a/tests/lib/libc/tls/dso/h_tls_dlopen.c     Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls/dso/h_tls_dlopen.c     Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_tls_dlopen.c,v 1.3 2011/11/17 16:39:11 joerg Exp $   */
+/*     $NetBSD: h_tls_dlopen.c,v 1.4 2012/01/17 20:34:57 joerg Exp $   */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,13 +32,13 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: h_tls_dlopen.c,v 1.3 2011/11/17 16:39:11 joerg Exp $");
+__RCSID("$NetBSD: h_tls_dlopen.c,v 1.4 2012/01/17 20:34:57 joerg Exp $");
 
 #include <atf-c.h>
 #include <unistd.h>
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls/t_tls_dlopen.c
--- a/tests/lib/libc/tls/t_tls_dlopen.c Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls/t_tls_dlopen.c Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_tls_dlopen.c,v 1.2 2011/11/17 16:20:11 joerg Exp $   */
+/*     $NetBSD: t_tls_dlopen.c,v 1.3 2012/01/17 20:34:57 joerg Exp $   */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_tls_dlopen.c,v 1.2 2011/11/17 16:20:11 joerg Exp $");
+__RCSID("$NetBSD: t_tls_dlopen.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
 
 #include <atf-c.h>
 #include <dlfcn.h>
@@ -41,7 +41,7 @@
 
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
@@ -84,7 +84,7 @@
        void *handle;
        pthread_t t;
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
        atf_tc_skip("no TLS support on this platform");
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls/t_tls_dynamic.c
--- a/tests/lib/libc/tls/t_tls_dynamic.c        Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls/t_tls_dynamic.c        Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_tls_dynamic.c,v 1.2 2011/11/17 16:20:11 joerg Exp $  */
+/*     $NetBSD: t_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $  */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_tls_dynamic.c,v 1.2 2011/11/17 16:20:11 joerg Exp $");
+__RCSID("$NetBSD: t_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
 
 #include <atf-c.h>
 #include <pthread.h>
@@ -40,7 +40,7 @@
 
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
@@ -84,7 +84,7 @@
 {
        pthread_t t;
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
        atf_tc_skip("no TLS support on this platform");
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls/t_tls_static.c
--- a/tests/lib/libc/tls/t_tls_static.c Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls/t_tls_static.c Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_tls_static.c,v 1.1 2011/03/09 23:10:07 joerg Exp $   */
+/*     $NetBSD: t_tls_static.c,v 1.2 2012/01/17 20:34:57 joerg Exp $   */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,14 +32,14 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_tls_static.c,v 1.1 2011/03/09 23:10:07 joerg Exp $");
+__RCSID("$NetBSD: t_tls_static.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
 
 #include <atf-c.h>
 #include <pthread.h>
 
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
@@ -72,7 +72,7 @@
 {
        pthread_t t;
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
        atf_tc_skip("no TLS support on this platform");
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls/t_tls_static_helper.c
--- a/tests/lib/libc/tls/t_tls_static_helper.c  Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls/t_tls_static_helper.c  Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_tls_static_helper.c,v 1.1 2011/03/09 23:10:07 joerg Exp $    */
+/*     $NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $    */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,11 +32,11 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_tls_static_helper.c,v 1.1 2011/03/09 23:10:07 joerg Exp $");
+__RCSID("$NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
 
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/lib/libc/tls_dso/h_tls_dynamic.c
--- a/tests/lib/libc/tls_dso/h_tls_dynamic.c    Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/lib/libc/tls_dso/h_tls_dynamic.c    Tue Jan 17 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_tls_dynamic.c,v 1.2 2011/11/17 16:20:11 joerg Exp $  */
+/*     $NetBSD: h_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $  */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,12 +32,12 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: h_tls_dynamic.c,v 1.2 2011/11/17 16:20:11 joerg Exp $");
+__RCSID("$NetBSD: h_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
 
 #include <unistd.h>
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 
diff -r 793035107b0a -r 8ba855d46cea tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c
--- a/tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c       Tue Jan 17 19:46:55 2012 +0000
+++ b/tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c       Tue Jan 17 20:34:57 2012 +0000
@@ -31,7 +31,7 @@
 #include <stddef.h>
 #include <sys/tls.h>
 
-#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#ifdef __HAVE_NO___THREAD
 #define        __thread
 #endif
 



Home | Main Index | Thread Index | Old Index