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 | if (rv != VM_PAGER_OK) { | ||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
return (EIO); | return (EIO); | ||||
} | } | ||||
vm_page_xunbusy(ma[0]); | vm_page_xunbusy(ma[0]); | ||||
for (i = 1; i < initial_pagein; i++) | for (i = 1; i < initial_pagein; i++) | ||||
vm_page_readahead_finish(ma[i]); | vm_page_readahead_finish(ma[i]); | ||||
} | } | ||||
vm_page_lock(ma[0]); | vm_page_lock(ma[0]); | ||||
vm_page_hold(ma[0]); | vm_page_wire(ma[0]); | ||||
vm_page_activate(ma[0]); | |||||
vm_page_unlock(ma[0]); | vm_page_unlock(ma[0]); | ||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
imgp->firstpage = sf_buf_alloc(ma[0], 0); | imgp->firstpage = sf_buf_alloc(ma[0], 0); | ||||
imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); | imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
exec_unmap_first_page(struct image_params *imgp) | exec_unmap_first_page(struct image_params *imgp) | ||||
{ | { | ||||
vm_page_t m; | vm_page_t m; | ||||
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_lock(m); | vm_page_lock(m); | ||||
vm_page_unhold(m); | vm_page_unwire(m, PQ_ACTIVE); | ||||
vm_page_unlock(m); | vm_page_unlock(m); | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* 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. | ||||
▲ Show 20 Lines • Show All 763 Lines • Show Last 20 Lines |