summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-08-29 21:53:08 +0000
committerkib <kib@FreeBSD.org>2009-08-29 21:53:08 +0000
commitd105721a2238d8018e13ee3e8aa7face7a10a2e5 (patch)
treeac1b3c153ca3423ba66347e6a8bb50406e26038c /sys/kern/kern_thread.c
parent7e88789784ae0e3126509bacd97d46cc20dbf6f8 (diff)
downloadFreeBSD-src-d105721a2238d8018e13ee3e8aa7face7a10a2e5.zip
FreeBSD-src-d105721a2238d8018e13ee3e8aa7face7a10a2e5.tar.gz
Reverse r196640 and r196644 for now.
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 4f3b32c..d47bd8c 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -283,7 +283,7 @@ thread_reap(void)
* Allocate a thread.
*/
struct thread *
-thread_alloc(int pages)
+thread_alloc(void)
{
struct thread *td;
@@ -291,7 +291,7 @@ thread_alloc(int pages)
td = (struct thread *)uma_zalloc(thread_zone, M_WAITOK);
KASSERT(td->td_kstack == 0, ("thread_alloc got thread with kstack"));
- if (!vm_thread_new(td, pages)) {
+ if (!vm_thread_new(td, 0)) {
uma_zfree(thread_zone, td);
return (NULL);
}
@@ -299,17 +299,6 @@ thread_alloc(int pages)
return (td);
}
-int
-thread_alloc_stack(struct thread *td, int pages)
-{
-
- KASSERT(td->td_kstack == 0,
- ("thread_alloc_stack called on a thread with kstack"));
- if (!vm_thread_new(td, pages))
- return (0);
- cpu_thread_alloc(td);
- return (1);
-}
/*
* Deallocate a thread.
@@ -323,6 +312,8 @@ thread_free(struct thread *td)
cpuset_rel(td->td_cpuset);
td->td_cpuset = NULL;
cpu_thread_free(td);
+ if (td->td_altkstack != 0)
+ vm_thread_dispose_altkstack(td);
if (td->td_kstack != 0)
vm_thread_dispose(td);
uma_zfree(thread_zone, td);
OpenPOWER on IntegriCloud