summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread_stack.c
diff options
context:
space:
mode:
authorcl <cl@NetBSD.org>2004-01-02 19:14:00 +0000
committercl <cl@NetBSD.org>2004-01-02 19:14:00 +0000
commit33622a594348f555a638dfa078d2001a23e777e1 (patch)
treec4f8a19639620dac0dc347fd4a12a0c4f92cae0a /lib/libpthread/pthread_stack.c
parent90e89977d42b5fc2ff53d911a4056c41b7118368 (diff)
userland part of no-syscall upcall stack return
- add pt_stackinfo to struct __pthread_st - add pthread__stackinfo_offset returning the offset from ss_sp to pt_stackinfo - pass stackinfo_offset to sa_register and set SA_FLAG_STACKINFO to make the kernel use it - call pthread__sa_recycle in pthread__resolve_locks; g/c recycleq and pthread__recycle_bulk - return stack in pthread__sa_recycle by incrementing sasi_stackgen - make pthread__sa_recycle debugging output formatting conditional on pthread__debug_newline
Diffstat (limited to 'lib/libpthread/pthread_stack.c')
-rw-r--r--lib/libpthread/pthread_stack.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_stack.c b/lib/libpthread/pthread_stack.c
index 058b38dacff..8727c096e8e 100644
--- a/lib/libpthread/pthread_stack.c
+++ b/lib/libpthread/pthread_stack.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_stack.c,v 1.9 2003/11/27 16:30:54 cl Exp $ */
+/* $NetBSD: pthread_stack.c,v 1.10 2004/01/02 19:14:00 cl Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,11 +37,12 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_stack.c,v 1.9 2003/11/27 16:30:54 cl Exp $");
+__RCSID("$NetBSD: pthread_stack.c,v 1.10 2004/01/02 19:14:00 cl Exp $");
#include <err.h>
#include <errno.h>
#include <signal.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <ucontext.h>
@@ -186,3 +187,14 @@ pthread__stackid_setup(void *base, size_t size)
return t;
}
+
+
+ssize_t
+pthread__stackinfo_offset()
+{
+ size_t pagesize;
+
+ pagesize = (size_t)sysconf(_SC_PAGESIZE);
+ return (-(2 * pagesize) +
+ offsetof(struct __pthread_st, pt_stackinfo));
+}