From 83f108b04dd3280195b5f0cf6bc2af10630e5f75 Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 14 Jun 2003 23:23:55 +0000 Subject: Migrate the thread stack management functions from the machine-dependent to the machine-independent parts of the VM. At the same time, this introduces vm object locking for the non-i386 platforms. Two details: 1. KSTACK_GUARD has been removed in favor of KSTACK_GUARD_PAGES. The different machine-dependent implementations used various combinations of KSTACK_GUARD and KSTACK_GUARD_PAGES. To disable guard page, set KSTACK_GUARD_PAGES to 0. 2. Remove the (unnecessary) clearing of PG_ZERO in vm_thread_new. In 5.x, (but not 4.x,) PG_ZERO can only be set if VM_ALLOC_ZERO is passed to vm_page_alloc() or vm_page_grab(). --- sys/kern/kern_kse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_kse.c') diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index bb4e3f0..32c755a 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -185,7 +186,7 @@ thread_init(void *mem, int size) td = (struct thread *)mem; mtx_lock(&Giant); - pmap_new_thread(td, 0); + vm_thread_new(td, 0); mtx_unlock(&Giant); cpu_thread_setup(td); td->td_sched = (struct td_sched *)&td[1]; @@ -200,7 +201,7 @@ thread_fini(void *mem, int size) struct thread *td; td = (struct thread *)mem; - pmap_dispose_thread(td); + vm_thread_dispose(td); } /* -- cgit v1.1