Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/cloudabi64/cloudabi64_module.c
Show All 39 Lines | |||||
#include <compat/cloudabi/cloudabi_util.h> | #include <compat/cloudabi/cloudabi_util.h> | ||||
#include <compat/cloudabi64/cloudabi64_util.h> | #include <compat/cloudabi64/cloudabi64_util.h> | ||||
extern char _binary_cloudabi64_vdso_o_start[]; | extern char _binary_cloudabi64_vdso_o_start[]; | ||||
extern char _binary_cloudabi64_vdso_o_end[]; | extern char _binary_cloudabi64_vdso_o_end[]; | ||||
register_t * | int | ||||
cloudabi64_copyout_strings(struct image_params *imgp) | cloudabi64_copyout_strings(struct image_params *imgp, register_t **stack_base) | ||||
{ | { | ||||
struct image_args *args; | struct image_args *args; | ||||
uintptr_t begin; | uintptr_t begin; | ||||
size_t len; | size_t len; | ||||
/* Copy out program arguments. */ | /* Copy out program arguments. */ | ||||
args = imgp->args; | args = imgp->args; | ||||
len = exec_args_get_begin_envv(args) - args->begin_argv; | len = exec_args_get_begin_envv(args) - args->begin_argv; | ||||
begin = rounddown2(imgp->sysent->sv_usrstack - len, sizeof(register_t)); | begin = rounddown2(imgp->sysent->sv_usrstack - len, sizeof(register_t)); | ||||
copyout(args->begin_argv, (void *)begin, len); | *stack_base = (register_t *)begin; | ||||
return ((register_t *)begin); | return (copyout(args->begin_argv, (void *)begin, len)); | ||||
} | } | ||||
int | int | ||||
cloudabi64_fixup(register_t **stack_base, struct image_params *imgp) | cloudabi64_fixup(register_t **stack_base, struct image_params *imgp) | ||||
{ | { | ||||
char canarybuf[64], pidbuf[16]; | char canarybuf[64], pidbuf[16]; | ||||
Elf64_Auxargs *args; | Elf64_Auxargs *args; | ||||
struct thread *td; | struct thread *td; | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |