summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread_int.h
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-11-13 17:20:08 +0000
committerad <ad@NetBSD.org>2007-11-13 17:20:08 +0000
commit66ac2ffaf293a1766211e270fcce0ba856f8f80e (patch)
tree14c1c20985051c159c5d7b74ce133f33a8efdd64 /lib/libpthread/pthread_int.h
parent3c776c8aa6570d9365bd4dc5468590e6c51103bb (diff)
Mutexes:
- Play scrooge again and chop more cycles off acquire/release. - Spin while the lock holder is running on another CPU (adaptive mutexes). - Do non-atomic release. Threadreg: - Add the necessary hooks to use a thread register. - Add the code for i386, using %gs. - Leave i386 code disabled until xen and COMPAT_NETBSD32 have the changes.
Diffstat (limited to 'lib/libpthread/pthread_int.h')
-rw-r--r--lib/libpthread/pthread_int.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libpthread/pthread_int.h b/lib/libpthread/pthread_int.h
index 77b7ee371d4..913d4a4a380 100644
--- a/lib/libpthread/pthread_int.h
+++ b/lib/libpthread/pthread_int.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_int.h,v 1.60 2007/11/13 15:57:11 ad Exp $ */
+/* $NetBSD: pthread_int.h,v 1.61 2007/11/13 17:20:09 ad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007 The NetBSD Foundation, Inc.
@@ -130,6 +130,8 @@ struct __pthread_st {
* on other CPUs will access this data frequently.
*/
int pt_dummy1 __aligned(128);
+ struct lwpctl *pt_lwpctl; /* Kernel/user comms area */
+ volatile int pt_blocking; /* Blocking in userspace */
volatile int pt_rwlocked; /* Handed rwlock successfully */
volatile int pt_sleeponq; /* On a sleep queue */
volatile int pt_signalled; /* Received pthread_cond_signal() */
@@ -252,18 +254,16 @@ int pthread__find(pthread_t) PTHREAD_HIDE;
_INITCONTEXT_U_MD(ucp) \
} while (/*CONSTCOND*/0)
-#ifdef PTHREAD_MACHINE_HAS_ID_REGISTER
-#define pthread__id(reg) (reg)
-#else
/* Stack location of pointer to a particular thread */
#define pthread__id(sp) \
((pthread_t) (((vaddr_t)(sp)) & pthread__threadmask))
-#define pthread__id_reg() pthread__sp()
+#ifdef PTHREAD__HAVE_THREADREG
+#define pthread__self() pthread__threadreg_get()
+#else
+#define pthread__self() (pthread__id(pthread__sp()))
#endif
-#define pthread__self() (pthread__id(pthread__id_reg()))
-
#define pthread__abort() \
pthread__assertfunc(__FILE__, __LINE__, __func__, "unreachable")
@@ -286,14 +286,14 @@ void pthread__errorfunc(const char *, int, const char *, const char *)
PTHREAD_HIDE;
char *pthread__getenv(const char *) PTHREAD_HIDE;
-int pthread__atomic_cas_ptr(volatile void *, void **, void *) PTHREAD_HIDE;
-void *pthread__atomic_swap_ptr(volatile void *, void *) PTHREAD_HIDE;
+void *pthread__atomic_cas_ptr(volatile void *, const void *, const void *) PTHREAD_HIDE;
+void *pthread__atomic_swap_ptr(volatile void *, const void *) PTHREAD_HIDE;
+void pthread__atomic_or_ulong(volatile unsigned long *, unsigned long) PTHREAD_HIDE;
void pthread__membar_full(void) PTHREAD_HIDE;
void pthread__membar_producer(void) PTHREAD_HIDE;
void pthread__membar_consumer(void) PTHREAD_HIDE;
int pthread__mutex_deferwake(pthread_t, pthread_mutex_t *) PTHREAD_HIDE;
-int pthread__mutex_catchup(pthread_mutex_t *) PTHREAD_HIDE;
#ifndef pthread__smt_pause
#define pthread__smt_pause() /* nothing */