Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/freebsd32/freebsd32_misc.c
Show First 20 Lines • Show All 3,398 Lines • ▼ Show 20 Lines | freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) | ||||
struct freebsd32_ps_strings *arginfo; | struct freebsd32_ps_strings *arginfo; | ||||
char canary[sizeof(long) * 8]; | char canary[sizeof(long) * 8]; | ||||
int32_t pagesizes32[MAXPAGESIZES]; | int32_t pagesizes32[MAXPAGESIZES]; | ||||
size_t execpath_len; | size_t execpath_len; | ||||
int error, szsigcode; | int error, szsigcode; | ||||
sysent = imgp->sysent; | sysent = imgp->sysent; | ||||
arginfo = (struct freebsd32_ps_strings *)sysent->sv_psstrings; | arginfo = (struct freebsd32_ps_strings *)imgp->proc->p_psstrings; | ||||
imgp->ps_strings = arginfo; | imgp->ps_strings = arginfo; | ||||
destp = (uintptr_t)arginfo; | destp = (uintptr_t)arginfo; | ||||
/* | /* | ||||
* Install sigcode. | * Install sigcode. | ||||
*/ | */ | ||||
if (sysent->sv_sigcode_base == 0) { | if (sysent->sv_sigcode_base == 0) { | ||||
szsigcode = *sysent->sv_szsigcode; | szsigcode = *sysent->sv_szsigcode; | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) | ||||
imgp->pagesizeslen = sizeof(pagesizes32); | imgp->pagesizeslen = sizeof(pagesizes32); | ||||
/* | /* | ||||
* Allocate room for the argument and environment strings. | * Allocate room for the argument and environment strings. | ||||
*/ | */ | ||||
destp -= ARG_MAX - imgp->args->stringspace; | destp -= ARG_MAX - imgp->args->stringspace; | ||||
destp = rounddown2(destp, sizeof(uint32_t)); | destp = rounddown2(destp, sizeof(uint32_t)); | ||||
ustringp = destp; | ustringp = destp; | ||||
exec_stackgap(imgp, &destp); | |||||
if (imgp->auxargs) { | if (imgp->auxargs) { | ||||
/* | /* | ||||
* Allocate room on the stack for the ELF auxargs | * Allocate room on the stack for the ELF auxargs | ||||
* array. It has up to AT_COUNT entries. | * array. It has up to AT_COUNT entries. | ||||
*/ | */ | ||||
destp -= AT_COUNT * sizeof(Elf32_Auxinfo); | destp -= AT_COUNT * sizeof(Elf32_Auxinfo); | ||||
destp = rounddown2(destp, sizeof(uint32_t)); | destp = rounddown2(destp, sizeof(uint32_t)); | ||||
▲ Show 20 Lines • Show All 499 Lines • Show Last 20 Lines |