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.
This commit is contained in:
joerg 2012-01-17 20:34:57 +00:00
parent e6afed1597
commit 71d0bcc69f
10 changed files with 29 additions and 40 deletions

View File

@ -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 @@ pthread__self(void)
#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() \

View File

@ -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

View File

@ -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 @@ typedef volatile char __cpu_simple_lock_t;
#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
#define __HAVE___LWP_GETPRIVATE_FAST
#define __HAVE_NO___THREAD
#define __HAVE_TLS_VARIANT_I
#endif /* _MACHTYPES_H_ */

View File

@ -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

View File

@ -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 @@ __RCSID("$NetBSD: t_tls_dlopen.c,v 1.2 2011/11/17 16:20:11 joerg Exp $");
#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 @@ ATF_TC_BODY(t_tls_dlopen, tc)
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

View File

@ -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 @@ __RCSID("$NetBSD: t_tls_dynamic.c,v 1.2 2011/11/17 16:20:11 joerg Exp $");
#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 @@ ATF_TC_BODY(t_tls_dynamic, tc)
{
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

View File

@ -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 @@ ATF_TC_BODY(t_tls_static, tc)
{
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

View File

@ -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

View File

@ -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

View File

@ -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