Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_exec.c
Show First 20 Lines • Show All 1,034 Lines • ▼ Show 20 Lines | exec_unmap_first_page(struct image_params *imgp) | ||||
if (imgp->firstpage != NULL) { | if (imgp->firstpage != NULL) { | ||||
m = sf_buf_page(imgp->firstpage); | m = sf_buf_page(imgp->firstpage); | ||||
sf_buf_free(imgp->firstpage); | sf_buf_free(imgp->firstpage); | ||||
imgp->firstpage = NULL; | imgp->firstpage = NULL; | ||||
vm_page_unwire(m, PQ_ACTIVE); | vm_page_unwire(m, PQ_ACTIVE); | ||||
} | } | ||||
} | } | ||||
void | |||||
exec_onexec_old(struct thread *td) | |||||
{ | |||||
sigfastblock_clear(td); | |||||
umtx_exec(td->td_proc); | |||||
} | |||||
/* | /* | ||||
* Destroy old address space, and allocate a new stack. | * Destroy old address space, and allocate a new stack. | ||||
* The new stack is only sgrowsiz large because it is grown | * The new stack is only sgrowsiz large because it is grown | ||||
* automatically on a page fault. | * automatically on a page fault. | ||||
*/ | */ | ||||
int | int | ||||
exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) | exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) | ||||
{ | { | ||||
int error; | int error; | ||||
struct proc *p = imgp->proc; | struct proc *p = imgp->proc; | ||||
struct vmspace *vmspace = p->p_vmspace; | struct vmspace *vmspace = p->p_vmspace; | ||||
struct thread *td = curthread; | struct thread *td = curthread; | ||||
vm_object_t obj; | vm_object_t obj; | ||||
struct rlimit rlim_stack; | struct rlimit rlim_stack; | ||||
vm_offset_t sv_minuser, stack_addr; | vm_offset_t sv_minuser, stack_addr; | ||||
vm_map_t map; | vm_map_t map; | ||||
vm_prot_t stack_prot; | vm_prot_t stack_prot; | ||||
u_long ssiz; | u_long ssiz; | ||||
imgp->vmspace_destroyed = 1; | imgp->vmspace_destroyed = 1; | ||||
imgp->sysent = sv; | imgp->sysent = sv; | ||||
sigfastblock_clear(td); | if (p->p_sysent->sv_onexec_old != NULL) | ||||
umtx_exec(p); | p->p_sysent->sv_onexec_old(td); | ||||
itimers_exec(p); | itimers_exec(p); | ||||
if (sv->sv_onexec != NULL) | if (sv->sv_onexec != NULL) | ||||
sv->sv_onexec(p, imgp); | sv->sv_onexec(p, imgp); | ||||
EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); | EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); | ||||
/* | /* | ||||
* Blow away entire process VM, if address space not shared, | * Blow away entire process VM, if address space not shared, | ||||
▲ Show 20 Lines • Show All 954 Lines • Show Last 20 Lines |