Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_aout.c
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | struct sysentvec aout_sysvec = { | ||||
.sv_trap = NULL, | .sv_trap = NULL, | ||||
.sv_onexec_old = exec_onexec_old, | .sv_onexec_old = exec_onexec_old, | ||||
.sv_onexit = exit_onexit, | .sv_onexit = exit_onexit, | ||||
.sv_set_fork_retval = x86_set_fork_retval, | .sv_set_fork_retval = x86_set_fork_retval, | ||||
}; | }; | ||||
#elif defined(__amd64__) | #elif defined(__amd64__) | ||||
#include "vdso_ia32_offsets.h" | |||||
extern const char _binary_elf_vdso32_so_1_start[]; | |||||
extern const char _binary_elf_vdso32_so_1_end[]; | |||||
extern char _binary_elf_vdso32_so_1_size; | |||||
#define AOUT32_PS_STRINGS \ | #define AOUT32_PS_STRINGS \ | ||||
(AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) | (AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) | ||||
#define AOUT32_MINUSER FREEBSD32_MINUSER | #define AOUT32_MINUSER FREEBSD32_MINUSER | ||||
extern const char *freebsd32_syscallnames[]; | extern const char *freebsd32_syscallnames[]; | ||||
extern u_long ia32_maxssiz; | extern u_long ia32_maxssiz; | ||||
static int aout_szsigcode; | |||||
struct sysentvec aout_sysvec = { | struct sysentvec aout_sysvec = { | ||||
.sv_size = FREEBSD32_SYS_MAXSYSCALL, | .sv_size = FREEBSD32_SYS_MAXSYSCALL, | ||||
.sv_table = freebsd32_sysent, | .sv_table = freebsd32_sysent, | ||||
.sv_transtrap = NULL, | .sv_transtrap = NULL, | ||||
.sv_fixup = aout_fixup, | .sv_fixup = aout_fixup, | ||||
.sv_sendsig = ia32_sendsig, | .sv_sendsig = ia32_sendsig, | ||||
.sv_sigcode = ia32_sigcode, | .sv_szsigcode = &aout_szsigcode, | ||||
.sv_szsigcode = &sz_ia32_sigcode, | |||||
.sv_name = "FreeBSD a.out", | .sv_name = "FreeBSD a.out", | ||||
.sv_coredump = NULL, | .sv_coredump = NULL, | ||||
.sv_imgact_try = NULL, | .sv_imgact_try = NULL, | ||||
.sv_minsigstksz = MINSIGSTKSZ, | .sv_minsigstksz = MINSIGSTKSZ, | ||||
.sv_minuser = AOUT32_MINUSER, | .sv_minuser = AOUT32_MINUSER, | ||||
.sv_maxuser = AOUT32_USRSTACK, | .sv_maxuser = AOUT32_USRSTACK, | ||||
.sv_usrstack = AOUT32_USRSTACK, | .sv_usrstack = AOUT32_USRSTACK, | ||||
.sv_psstrings = AOUT32_PS_STRINGS, | .sv_psstrings = AOUT32_PS_STRINGS, | ||||
.sv_stackprot = VM_PROT_ALL, | .sv_stackprot = VM_PROT_ALL, | ||||
.sv_copyout_strings = freebsd32_copyout_strings, | .sv_copyout_strings = freebsd32_copyout_strings, | ||||
.sv_setregs = ia32_setregs, | .sv_setregs = ia32_setregs, | ||||
.sv_fixlimit = ia32_fixlimit, | .sv_fixlimit = ia32_fixlimit, | ||||
.sv_maxssiz = &ia32_maxssiz, | .sv_maxssiz = &ia32_maxssiz, | ||||
.sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, | .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, | ||||
.sv_set_syscall_retval = ia32_set_syscall_retval, | .sv_set_syscall_retval = ia32_set_syscall_retval, | ||||
.sv_fetch_syscall_args = ia32_fetch_syscall_args, | .sv_fetch_syscall_args = ia32_fetch_syscall_args, | ||||
.sv_syscallnames = freebsd32_syscallnames, | .sv_syscallnames = freebsd32_syscallnames, | ||||
.sv_onexec_old = exec_onexec_old, | .sv_onexec_old = exec_onexec_old, | ||||
.sv_onexit = exit_onexit, | .sv_onexit = exit_onexit, | ||||
.sv_set_fork_retval = x86_set_fork_retval, | .sv_set_fork_retval = x86_set_fork_retval, | ||||
}; | }; | ||||
static void | |||||
aout_sysvec_init(void *arg) | |||||
{ | |||||
aout_sysvec.sv_sigcode = _binary_elf_vdso32_so_1_start + | |||||
VDSO_IA32_OSIGCODE_OFFSET; | |||||
aout_szsigcode = _binary_elf_vdso32_so_1_end - | |||||
_binary_elf_vdso32_so_1_start + VDSO_IA32_OSIGCODE_OFFSET; | |||||
} | |||||
SYSINIT(aout, SI_SUB_EXEC, SI_ORDER_MIDDLE, (sysinit_cfunc_t)aout_sysvec_init, | |||||
NULL); | |||||
#else | #else | ||||
#error "Port me" | #error "Port me" | ||||
emaste: I guess this comment is not really applicable anymore (we're not going to add new arch a.out… | |||||
Done Inline ActionsIt is same as it was in the time the line was written. I want something to plug if people add imgact_aout.c to their files.<arch>. If you suggest to change the message to something else, I do not object. kib: It is same as it was in the time the line was written. I want something to plug if people add… | |||||
Done Inline ActionsYeah just something I noticed in passing and not related to your work. emaste: Yeah just something I noticed in passing and not related to your work. | |||||
#endif | #endif | ||||
static int | static int | ||||
aout_fixup(uintptr_t *stack_base, struct image_params *imgp) | aout_fixup(uintptr_t *stack_base, struct image_params *imgp) | ||||
{ | { | ||||
*stack_base -= sizeof(uint32_t); | *stack_base -= sizeof(uint32_t); | ||||
if (suword32((void *)*stack_base, imgp->args->argc) != 0) | if (suword32((void *)*stack_base, imgp->args->argc) != 0) | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
I guess this comment is not really applicable anymore (we're not going to add new arch a.out support)