Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libpthread/pthread_int.h,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libpthread/pthread_int.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.81 retrieving revision 1.81.2.3 diff -u -p -r1.81 -r1.81.2.3 --- src/lib/libpthread/pthread_int.h 2011/10/06 16:03:48 1.81 +++ src/lib/libpthread/pthread_int.h 2012/10/30 18:59:15 1.81.2.3 @@ -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.81.2.3 2012/10/30 18:59:15 yamt Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -52,9 +52,10 @@ #include #include +#include #include #include -#include +#include #ifdef __GNUC__ #define PTHREAD_HIDE __attribute__ ((visibility("hidden"))) @@ -104,6 +105,8 @@ struct __pthread_st { int pt_cancel; /* Deferred cancellation */ int pt_errno; /* Thread-specific errno. */ stack_t pt_stack; /* Our stack */ + bool pt_stack_allocated; + size_t pt_guardsize; void *pt_exitval; /* Read by pthread_join() */ char *pt_name; /* Thread's name, set by the app. */ int pt_willpark; /* About to park */ @@ -175,10 +178,8 @@ struct __pthread_st { #define PT_ATTR_MAGIC 0x22220002 #define PT_ATTR_DEAD 0xDEAD0002 -extern int pthread__stacksize_lg; extern size_t pthread__stacksize; -extern vaddr_t pthread__stackmask; -extern vaddr_t pthread__threadmask; +extern size_t pthread__pagesize; extern int pthread__nspins; extern int pthread__concurrency; extern int pthread__osrev; @@ -255,7 +256,10 @@ int pthread__find(pthread_t) PTHREAD_HID } while (/*CONSTCOND*/0) -#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II) +#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II) +#error Either __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II must be defined +#endif + static inline pthread_t __constfunc pthread__self(void) { @@ -266,23 +270,6 @@ 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())) -#endif #define pthread__abort() \ pthread__assertfunc(__FILE__, __LINE__, __func__, "unreachable") @@ -312,6 +299,9 @@ int pthread__checkpri(int) PTHREAD_HIDE; #ifndef pthread__smt_pause #define pthread__smt_pause() /* nothing */ #endif +#ifndef pthread__smt_wake +#define pthread__smt_wake() /* nothing */ +#endif /* * Bits in the owner field of the lock that indicate lock state. If the