summaryrefslogtreecommitdiff
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2002-10-02 07:44:29 +0000
committerScott Long <scottl@FreeBSD.org>2002-10-02 07:44:29 +0000
commit316ec49abd15743784b47592c00d6297dabce21b (patch)
tree0a9cc28f7570a42ae4e5df4cfc55dee42c36d9d8 /sys/kern/kern_proc.c
parenta70e34ac714c1609edfcc248799d078d66ee5f79 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 633c66e5c922..9f20562d3d58 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -164,6 +164,15 @@ proc_dtor(void *mem, int size, void *arg)
KASSERT((kg != NULL), ("proc_dtor: bad kg pointer"));
ke = FIRST_KSE_IN_KSEGRP(kg);
KASSERT((ke != NULL), ("proc_dtor: bad ke pointer"));
+
+ /* Dispose of an alternate kstack, if it exists.
+ * XXX What if there are more than one thread in the proc?
+ * The first thread in the proc is special and not
+ * freed, so you gotta do this here.
+ */
+ if (((p->p_flag & P_KTHREAD) != 0) && (td->td_altkstack != 0))
+ pmap_dispose_altkstack(td);
+
/*
* We want to make sure we know the initial linkages.
* so for now tear them down and remake them.