diff options
author | alc <alc@FreeBSD.org> | 2002-03-31 00:05:30 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-03-31 00:05:30 +0000 |
commit | bd314bbdd76976de3bda18d79e3067f0ca77c6e3 (patch) | |
tree | 3219508479159c552d892448e92e165cbc0c2af0 | |
parent | 688cf86e245339c72f4f3abf4dccfbb5748f103a (diff) | |
download | FreeBSD-src-bd314bbdd76976de3bda18d79e3067f0ca77c6e3.zip FreeBSD-src-bd314bbdd76976de3bda18d79e3067f0ca77c6e3.tar.gz |
Add a local proc *p in exec_new_vmspace() to avoid repeated dereferencing
to obtain it.
-rw-r--r-- | sys/kern/kern_exec.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index fe0be73..ba68e68 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -577,7 +577,8 @@ exec_new_vmspace(imgp) { int error; struct execlist *ep; - struct vmspace *vmspace = imgp->proc->p_vmspace; + struct proc *p = imgp->proc; + struct vmspace *vmspace = p->p_vmspace; vm_offset_t stack_addr = USRSTACK - maxssiz; GIANT_REQUIRED; @@ -588,7 +589,7 @@ exec_new_vmspace(imgp) * Perform functions registered with at_exec(). */ TAILQ_FOREACH(ep, &exec_list, next) - (*ep->function)(imgp->proc); + (*ep->function)(p); /* * Blow away entire process VM, if address space not shared, @@ -597,12 +598,12 @@ exec_new_vmspace(imgp) */ if (vmspace->vm_refcnt == 1) { if (vmspace->vm_shm) - shmexit(imgp->proc); + shmexit(p); pmap_remove_pages(vmspace_pmap(vmspace), 0, VM_MAXUSER_ADDRESS); vm_map_remove(&vmspace->vm_map, 0, VM_MAXUSER_ADDRESS); } else { - vmspace_exec(imgp->proc); - vmspace = imgp->proc->p_vmspace; + vmspace_exec(p); + vmspace = p->p_vmspace; } /* Allocate a new stack */ @@ -623,7 +624,7 @@ exec_new_vmspace(imgp) error = vm_map_find(&vmspace->vm_map, 0, 0, &bsaddr, 4*PAGE_SIZE, 0, VM_PROT_ALL, VM_PROT_ALL, 0); - FIRST_THREAD_IN_PROC(imgp->proc)->td_md.md_bspstore = bsaddr; + FIRST_THREAD_IN_PROC(p)->td_md.md_bspstore = bsaddr; } #endif |