summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-05-23 22:06:47 +0000
committerjhb <jhb@FreeBSD.org>2001-05-23 22:06:47 +0000
commit87198ba2534a251e152fd1a9fe0cdab232e7d671 (patch)
tree1f4fb0dfbb7572d6cfde814ddcb55361053b862f /sys/kern/init_main.c
parentf8b92da193599f6ed6a514ef64db5df716d34b77 (diff)
downloadFreeBSD-src-87198ba2534a251e152fd1a9fe0cdab232e7d671.zip
FreeBSD-src-87198ba2534a251e152fd1a9fe0cdab232e7d671.tar.gz
- Lock the VM when initializing the vmspace for proc0.
- Don't bother releasing Giant while doing a lookup on the vm_map of initproc while starting up init. We have to grab it again right after the lookup anyways.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 6f5c653..5624720 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -374,12 +374,14 @@ proc0_init(void *dummy __unused)
limit0.p_refcnt = 1;
/* Allocate a prototype map so we have something to fork. */
+ mtx_lock(&vm_mtx);
pmap_pinit0(vmspace_pmap(&vmspace0));
p->p_vmspace = &vmspace0;
vmspace0.vm_refcnt = 1;
vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS),
trunc_page(VM_MAXUSER_ADDRESS));
vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0);
+ mtx_unlock(&vm_mtx);
p->p_addr = proc0paddr; /* XXX */
/*
@@ -485,7 +487,6 @@ start_init(void *dummy)
* Need just enough stack to hold the faked-up "execve()" arguments.
*/
addr = trunc_page(USRSTACK - PAGE_SIZE);
- mtx_unlock(&Giant);
mtx_lock(&vm_mtx);
if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE,
FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
@@ -493,7 +494,6 @@ start_init(void *dummy)
p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
p->p_vmspace->vm_ssize = 1;
mtx_unlock(&vm_mtx);
- mtx_lock(&Giant);
if ((var = getenv("init_path")) != NULL) {
strncpy(init_path, var, sizeof init_path);
OpenPOWER on IntegriCloud