From 33622a594348f555a638dfa078d2001a23e777e1 Mon Sep 17 00:00:00 2001 From: cl Date: Fri, 2 Jan 2004 19:14:00 +0000 Subject: 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 --- lib/libpthread/pthread_stack.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/libpthread/pthread_stack.c') 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 -__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 #include #include +#include #include #include #include @@ -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)); +} -- cgit