Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/linux/linux_sysvec.c
Show First 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) | ||||
char *stringp; | char *stringp; | ||||
uintptr_t destp, ustringp; | uintptr_t destp, ustringp; | ||||
struct ps_strings *arginfo; | struct ps_strings *arginfo; | ||||
char canary[LINUX_AT_RANDOM_LEN]; | char canary[LINUX_AT_RANDOM_LEN]; | ||||
size_t execpath_len; | size_t execpath_len; | ||||
struct proc *p; | struct proc *p; | ||||
p = imgp->proc; | p = imgp->proc; | ||||
arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; | arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); | ||||
destp = (uintptr_t)arginfo; | destp = (uintptr_t)arginfo; | ||||
if (imgp->execpath != NULL && imgp->auxargs != NULL) { | if (imgp->execpath != NULL && imgp->auxargs != NULL) { | ||||
execpath_len = strlen(imgp->execpath) + 1; | execpath_len = strlen(imgp->execpath) + 1; | ||||
destp -= execpath_len; | destp -= execpath_len; | ||||
destp = rounddown2(destp, sizeof(void *)); | destp = rounddown2(destp, sizeof(void *)); | ||||
imgp->execpathp = (void *)destp; | imgp->execpathp = (void *)destp; | ||||
error = copyout(imgp->execpath, imgp->execpathp, execpath_len); | error = copyout(imgp->execpath, imgp->execpathp, execpath_len); | ||||
▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | struct sysentvec elf_linux_sysvec = { | ||||
.sv_elf_core_abi_vendor = LINUX_ABI_VENDOR, | .sv_elf_core_abi_vendor = LINUX_ABI_VENDOR, | ||||
.sv_elf_core_prepare_notes = linux64_prepare_notes, | .sv_elf_core_prepare_notes = linux64_prepare_notes, | ||||
.sv_imgact_try = linux_exec_imgact_try, | .sv_imgact_try = linux_exec_imgact_try, | ||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ, | .sv_minsigstksz = LINUX_MINSIGSTKSZ, | ||||
.sv_minuser = VM_MIN_ADDRESS, | .sv_minuser = VM_MIN_ADDRESS, | ||||
.sv_maxuser = VM_MAXUSER_ADDRESS_LA48, | .sv_maxuser = VM_MAXUSER_ADDRESS_LA48, | ||||
.sv_usrstack = LINUX_USRSTACK_LA48, | .sv_usrstack = LINUX_USRSTACK_LA48, | ||||
.sv_psstrings = LINUX_PS_STRINGS_LA48, | .sv_psstrings = LINUX_PS_STRINGS_LA48, | ||||
.sv_psstringssz = sizeof(struct ps_strings), | |||||
.sv_stackprot = VM_PROT_ALL, | .sv_stackprot = VM_PROT_ALL, | ||||
.sv_copyout_auxargs = linux_copyout_auxargs, | .sv_copyout_auxargs = linux_copyout_auxargs, | ||||
.sv_copyout_strings = linux_copyout_strings, | .sv_copyout_strings = linux_copyout_strings, | ||||
.sv_setregs = linux_exec_setregs, | .sv_setregs = linux_exec_setregs, | ||||
.sv_fixlimit = NULL, | .sv_fixlimit = NULL, | ||||
.sv_maxssiz = NULL, | .sv_maxssiz = NULL, | ||||
.sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN | | .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN | | ||||
SV_SIG_WAITNDQ | SV_TIMEKEEP, | SV_SIG_WAITNDQ | SV_TIMEKEEP, | ||||
▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines |