Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/linux/imgact_linux.c
Show First 20 Lines • Show All 207 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
/* Fill in process VM information */ | /* Fill in process VM information */ | ||||
vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; | vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; | ||||
vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; | vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; | ||||
vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; | vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; | ||||
vmspace->vm_daddr = | vmspace->vm_daddr = | ||||
(caddr_t)(void *)(uintptr_t)(virtual_offset + a_out->a_text); | (caddr_t)(void *)(uintptr_t)(virtual_offset + a_out->a_text); | ||||
error = exec_map_stack(imgp); | |||||
if (error != 0) | |||||
goto fail; | |||||
/* Fill in image_params */ | /* Fill in image_params */ | ||||
imgp->interpreted = 0; | imgp->interpreted = 0; | ||||
imgp->entry_addr = a_out->a_entry; | imgp->entry_addr = a_out->a_entry; | ||||
imgp->proc->p_sysent = &linux_sysvec; | imgp->proc->p_sysent = &linux_sysvec; | ||||
fail: | fail: | ||||
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); | vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Tell kern_execve.c about it, with a little help from the linker. | * Tell kern_execve.c about it, with a little help from the linker. | ||||
*/ | */ | ||||
static struct execsw linux_execsw = { exec_linux_imgact, "Linux a.out" }; | static struct execsw linux_execsw = { exec_linux_imgact, "Linux a.out" }; | ||||
EXEC_SET(linuxaout, linux_execsw); | EXEC_SET(linuxaout, linux_execsw); |