diff options
-rw-r--r-- | sys/alpha/alpha/elf_machdep.c | 24 | ||||
-rw-r--r-- | sys/alpha/linux/linux_sysvec.c | 18 | ||||
-rw-r--r-- | sys/alpha/osf1/osf1_sysvec.c | 18 | ||||
-rw-r--r-- | sys/amd64/amd64/elf_machdep.c | 27 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_sysvec.c | 11 | ||||
-rw-r--r-- | sys/compat/ia32/ia32_sysvec.c | 11 | ||||
-rw-r--r-- | sys/compat/pecoff/imgact_pecoff.c | 16 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_sysvec.c | 12 | ||||
-rw-r--r-- | sys/i386/i386/elf_machdep.c | 27 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_sysvec.c | 31 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 20 | ||||
-rw-r--r-- | sys/ia64/ia32/ia32_signal.c | 11 | ||||
-rw-r--r-- | sys/ia64/ia32/ia32_sysvec.c | 11 | ||||
-rw-r--r-- | sys/ia64/ia64/elf_machdep.c | 26 | ||||
-rw-r--r-- | sys/kern/imgact_aout.c | 30 | ||||
-rw-r--r-- | sys/kern/init_main.c | 30 | ||||
-rw-r--r-- | sys/kern/kern_exec.c | 2 | ||||
-rw-r--r-- | sys/powerpc/powerpc/elf_machdep.c | 26 | ||||
-rw-r--r-- | sys/sparc64/sparc64/elf_machdep.c | 27 | ||||
-rw-r--r-- | sys/sys/imgact.h | 1 | ||||
-rw-r--r-- | sys/sys/sysent.h | 10 |
21 files changed, 302 insertions, 87 deletions
diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c index 8e443e7..ddeae1b 100644 --- a/sys/alpha/alpha/elf_machdep.c +++ b/sys/alpha/alpha/elf_machdep.c @@ -28,6 +28,8 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/malloc.h> #include <sys/proc.h> #include <sys/namei.h> @@ -38,6 +40,10 @@ #include <sys/signalvar.h> #include <sys/vnode.h> #include <sys/linker.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> + #include <machine/elf.h> #include <machine/md_var.h> @@ -46,11 +52,11 @@ struct sysentvec elf64_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf64_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, sigcode, &szsigcode, @@ -58,7 +64,15 @@ struct sysentvec elf64_freebsd_sysvec = { "FreeBSD ELF64", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf64_Brandinfo freebsd_brand_info = { diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index 52af25f..9e9e1f9 100644 --- a/sys/alpha/linux/linux_sysvec.c +++ b/sys/alpha/linux/linux_sysvec.c @@ -179,19 +179,27 @@ struct sysentvec elf_linux_sysvec = { linux_sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, elf_linux_fixup, osendsig, linux_sigcode, &linux_szsigcode, - 0, + NULL, "Linux ELF", elf64_coredump, exec_linux_imgact_try, - LINUX_MINSIGSTKSZ + LINUX_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf64_Brandinfo linux_brand = { diff --git a/sys/alpha/osf1/osf1_sysvec.c b/sys/alpha/osf1/osf1_sysvec.c index 45f11a9..7b216e0 100644 --- a/sys/alpha/osf1/osf1_sysvec.c +++ b/sys/alpha/osf1/osf1_sysvec.c @@ -64,21 +64,29 @@ static int osf1_freebsd_fixup(long **stack_base, struct image_params *imgp); struct sysentvec osf1_sysvec = { OSF1_SYS_MAXSYSCALL, osf1_sysent, - 0x0, - 0, 0, 0, + NULL, 0, - 0, /* trap-to-signal translation function */ + NULL, + NULL, /* trap-to-signal translation function */ osf1_freebsd_fixup, /* fixup */ osf1_sendsig, sigcode, /* use generic trampoline */ &osf1_szsigcode, /* use generic trampoline size */ - 0, /* prepsyscall */ + NULL, /* prepsyscall */ "OSF/1 ECOFF", NULL, /* we don't have an ECOFF coredump function */ NULL, - OSF1_MINSIGSTKSZ + OSF1_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; /* diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index 188d60e..619b077 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -28,12 +28,19 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/linker.h> #include <sys/sysent.h> #include <sys/imgact_elf.h> #include <sys/syscall.h> #include <sys/signalvar.h> #include <sys/vnode.h> + +#include <vm/vm.h> +#include <vm/pmap.h> +#include <vm/vm_param.h> + #include <machine/elf.h> #include <machine/md_var.h> @@ -42,19 +49,27 @@ struct sysentvec elf32_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf32_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, sigcode, &szsigcode, - 0, + NULL, "FreeBSD ELF32", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf32_Brandinfo freebsd_brand_info = { diff --git a/sys/amd64/ia32/ia32_sysvec.c b/sys/amd64/ia32/ia32_sysvec.c index 06e6505..18f4ee2 100644 --- a/sys/amd64/ia32/ia32_sysvec.c +++ b/sys/amd64/ia32/ia32_sysvec.c @@ -93,22 +93,25 @@ struct sysentvec ia32_freebsd_sysvec = { ia32_sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, elf32_freebsd_fixup, sendsig, ia32_sigcode, &ia32_szsigcode, - 0, + NULL, "FreeBSD ELF", elf32_coredump, NULL, MINSIGSTKSZ, 4096, + 0, IA32_USRSTACK, IA32_USRSTACK, + IA32_PS_STRINGS, + VM_PROT_ALL, ia32_copyout_strings, ia32_setregs }; diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index 06e6505..18f4ee2 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -93,22 +93,25 @@ struct sysentvec ia32_freebsd_sysvec = { ia32_sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, elf32_freebsd_fixup, sendsig, ia32_sigcode, &ia32_szsigcode, - 0, + NULL, "FreeBSD ELF", elf32_coredump, NULL, MINSIGSTKSZ, 4096, + 0, IA32_USRSTACK, IA32_USRSTACK, + IA32_PS_STRINGS, + VM_PROT_ALL, ia32_copyout_strings, ia32_setregs }; diff --git a/sys/compat/pecoff/imgact_pecoff.c b/sys/compat/pecoff/imgact_pecoff.c index da9a76a..9b09632 100644 --- a/sys/compat/pecoff/imgact_pecoff.c +++ b/sys/compat/pecoff/imgact_pecoff.c @@ -95,10 +95,10 @@ static struct sysentvec pecoff_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, pecoff_fixup, sendsig, sigcode, @@ -107,7 +107,15 @@ static struct sysentvec pecoff_sysvec = { "FreeBSD PECoff", pecoff_coredump, NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c index c7d67ff..1d4ad6e 100644 --- a/sys/compat/svr4/svr4_sysvec.c +++ b/sys/compat/svr4/svr4_sysvec.c @@ -172,7 +172,7 @@ struct sysentvec svr4_sysvec = { bsd_to_svr4_sig, ELAST, /* ELAST */ bsd_to_svr4_errno, - 0, + NULL, svr4_fixup, svr4_sendsig, svr4_sigcode, @@ -181,7 +181,15 @@ struct sysentvec svr4_sysvec = { "SVR4", elf32_coredump, NULL, - SVR4_MINSIGSTKSZ + SVR4_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; Elf32_Brandinfo svr4_brand = { diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index 188d60e..619b077 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -28,12 +28,19 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/linker.h> #include <sys/sysent.h> #include <sys/imgact_elf.h> #include <sys/syscall.h> #include <sys/signalvar.h> #include <sys/vnode.h> + +#include <vm/vm.h> +#include <vm/pmap.h> +#include <vm/vm_param.h> + #include <machine/elf.h> #include <machine/md_var.h> @@ -42,19 +49,27 @@ struct sysentvec elf32_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf32_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, sigcode, &szsigcode, - 0, + NULL, "FreeBSD ELF32", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf32_Brandinfo freebsd_brand_info = { diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c index 60dd5ca..d7078ef 100644 --- a/sys/i386/ibcs2/ibcs2_sysvec.c +++ b/sys/i386/ibcs2/ibcs2_sysvec.c @@ -32,6 +32,9 @@ #include <sys/param.h> #include <sys/kernel.h> +#include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/lock.h> #include <sys/module.h> #include <sys/sysent.h> @@ -39,6 +42,10 @@ #include <sys/proc.h> #include <sys/sx.h> +#include <vm/vm.h> +#include <vm/pmap.h> +#include <vm/vm_param.h> + #include <i386/ibcs2/ibcs2_syscall.h> #include <i386/ibcs2/ibcs2_signal.h> @@ -48,6 +55,7 @@ extern int bsd_to_ibcs2_errno[]; extern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL]; extern int szsigcode; extern char sigcode[]; +static int ibcs2_fixup(register_t **, struct image_params *); struct sysentvec ibcs2_svr3_sysvec = { sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]), @@ -57,18 +65,33 @@ struct sysentvec ibcs2_svr3_sysvec = { bsd_to_ibcs2_sig, ELAST + 1, bsd_to_ibcs2_errno, - 0, /* trap-to-signal translation function */ - 0, /* fixup */ + NULL, /* trap-to-signal translation function */ + ibcs2_fixup, /* fixup */ sendsig, sigcode, /* use generic trampoline */ &szsigcode, /* use generic trampoline size */ - 0, /* prepsyscall */ + NULL, /* prepsyscall */ "IBCS2 COFF", NULL, /* we don't have a COFF coredump function */ NULL, - IBCS2_MINSIGSTKSZ + IBCS2_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; +static int +ibcs2_fixup(register_t **stack_base, struct image_params *imgp) +{ + + return (suword(--(*stack_base), imgp->argc)); +} + /* * Create an "ibcs2" module that does nothing but allow checking for * the presence of the subsystem. diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index a5ebc0a..f222089 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -774,7 +774,15 @@ struct sysentvec linux_sysvec = { "Linux a.out", aout_coredump, exec_linux_imgact_try, - LINUX_MINSIGSTKSZ + LINUX_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; struct sysentvec elf_linux_sysvec = { @@ -794,7 +802,15 @@ struct sysentvec elf_linux_sysvec = { "Linux ELF", elf32_coredump, exec_linux_imgact_try, - LINUX_MINSIGSTKSZ + LINUX_MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf32_Brandinfo linux_brand = { diff --git a/sys/ia64/ia32/ia32_signal.c b/sys/ia64/ia32/ia32_signal.c index 06e6505..18f4ee2 100644 --- a/sys/ia64/ia32/ia32_signal.c +++ b/sys/ia64/ia32/ia32_signal.c @@ -93,22 +93,25 @@ struct sysentvec ia32_freebsd_sysvec = { ia32_sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, elf32_freebsd_fixup, sendsig, ia32_sigcode, &ia32_szsigcode, - 0, + NULL, "FreeBSD ELF", elf32_coredump, NULL, MINSIGSTKSZ, 4096, + 0, IA32_USRSTACK, IA32_USRSTACK, + IA32_PS_STRINGS, + VM_PROT_ALL, ia32_copyout_strings, ia32_setregs }; diff --git a/sys/ia64/ia32/ia32_sysvec.c b/sys/ia64/ia32/ia32_sysvec.c index 06e6505..18f4ee2 100644 --- a/sys/ia64/ia32/ia32_sysvec.c +++ b/sys/ia64/ia32/ia32_sysvec.c @@ -93,22 +93,25 @@ struct sysentvec ia32_freebsd_sysvec = { ia32_sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, + NULL, + NULL, elf32_freebsd_fixup, sendsig, ia32_sigcode, &ia32_szsigcode, - 0, + NULL, "FreeBSD ELF", elf32_coredump, NULL, MINSIGSTKSZ, 4096, + 0, IA32_USRSTACK, IA32_USRSTACK, + IA32_PS_STRINGS, + VM_PROT_ALL, ia32_copyout_strings, ia32_setregs }; diff --git a/sys/ia64/ia64/elf_machdep.c b/sys/ia64/ia64/elf_machdep.c index 320ce80..4977e6e 100644 --- a/sys/ia64/ia64/elf_machdep.c +++ b/sys/ia64/ia64/elf_machdep.c @@ -28,6 +28,8 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/malloc.h> #include <sys/proc.h> #include <sys/namei.h> @@ -38,6 +40,10 @@ #include <sys/imgact_elf.h> #include <sys/syscall.h> #include <sys/signalvar.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> + #include <machine/elf.h> #include <machine/md_var.h> @@ -46,19 +52,27 @@ struct sysentvec elf64_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf64_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, sigcode, &szsigcode, - 0, + NULL, "FreeBSD ELF64", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf64_Brandinfo freebsd_brand_info = { diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 9573928..b3beb9f9 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -57,28 +57,46 @@ #include <vm/vm_object.h> static int exec_aout_imgact(struct image_params *imgp); +static int aout_fixup(register_t **stack_base, struct image_params *imgp); struct sysentvec aout_sysvec = { SYS_MAXSYSCALL, sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - 0, + NULL, + NULL, + aout_fixup, sendsig, sigcode, &szsigcode, - 0, + NULL, "FreeBSD a.out", aout_coredump, NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static int +aout_fixup(stack_base, imgp) + register_t **stack_base; + struct image_params *imgp; +{ + + return (suword(--(*stack_base), imgp->argc)); +} + +static int exec_aout_imgact(imgp) struct image_params *imgp; { diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f386085..8c4e8de 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -47,6 +47,7 @@ #include <sys/param.h> #include <sys/kernel.h> +#include <sys/exec.h> #include <sys/file.h> #include <sys/filedesc.h> #include <sys/ktr.h> @@ -255,8 +256,33 @@ set_boot_verbose(void *data __unused) } SYSINIT(boot_verbose, SI_SUB_TUNABLES, SI_ORDER_ANY, set_boot_verbose, NULL) -static struct sysentvec null_sysvec; - +struct sysentvec null_sysvec = { + 0, + NULL, + 0, + 0, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "null", + NULL, + NULL, + 0, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + NULL, + NULL +}; /* *************************************************************************** diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 5e04c90..1ee302a 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -85,8 +85,6 @@ struct execlist { TAILQ_HEAD(exec_list_head, execlist); static struct exec_list_head exec_list = TAILQ_HEAD_INITIALIZER(exec_list); -static register_t *exec_copyout_strings(struct image_params *); - /* XXX This should be vm_size_t. */ static u_long ps_strings = PS_STRINGS; SYSCTL_ULONG(_kern, KERN_PS_STRINGS, ps_strings, CTLFLAG_RD, &ps_strings, diff --git a/sys/powerpc/powerpc/elf_machdep.c b/sys/powerpc/powerpc/elf_machdep.c index 369af53..c1627b1 100644 --- a/sys/powerpc/powerpc/elf_machdep.c +++ b/sys/powerpc/powerpc/elf_machdep.c @@ -28,6 +28,8 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/malloc.h> #include <sys/proc.h> #include <sys/namei.h> @@ -38,6 +40,10 @@ #include <sys/signalvar.h> #include <sys/vnode.h> #include <sys/linker.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> + #include <machine/elf.h> #include <machine/md_var.h> @@ -46,19 +52,27 @@ struct sysentvec elf32_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf32_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, sigcode, &szsigcode, - 0, + NULL, "FreeBSD ELF32", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs }; static Elf32_Brandinfo freebsd_brand_info = { diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c index 09a9228..272b823 100644 --- a/sys/sparc64/sparc64/elf_machdep.c +++ b/sys/sparc64/sparc64/elf_machdep.c @@ -42,14 +42,19 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/linker.h> #include <sys/sysent.h> #include <sys/imgact_elf.h> #include <sys/syscall.h> #include <sys/signalvar.h> #include <sys/vnode.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> + #include <machine/elf.h> -#include <machine/md_var.h> #include "linker_if.h" @@ -58,19 +63,27 @@ struct sysentvec elf64_freebsd_sysvec = { sysent, 0, 0, + NULL, 0, - 0, - 0, - 0, - elf64_freebsd_fixup, + NULL, + NULL, + __elfN(freebsd_fixup), sendsig, NULL, NULL, - 0, + NULL, "FreeBSD ELF64", __elfN(coredump), NULL, - MINSIGSTKSZ + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_READ | VM_PROT_WRITE, + exec_copyout_strings, + exec_setregs }; static Elf64_Brandinfo freebsd_brand_info = { diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 34b091f..6b43692 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -67,6 +67,7 @@ struct image_params { #ifdef _KERNEL int exec_check_permissions(struct image_params *); +register_t *exec_copyout_strings(struct image_params *); int exec_extract_strings(struct image_params *); int exec_new_vmspace(struct image_params *, vm_offset_t, vm_offset_t, vm_offset_t); diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 7271ccf..bbc6b2f 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -79,9 +79,12 @@ struct sysentvec { /* function to dump core, or NULL */ int (*sv_imgact_try)(struct image_params *); int sv_minsigstksz; /* minimum signal stack size */ - int sv_pagesize; /* pagesize override */ - vm_offset_t sv_maxuser; /* VM_MAXUSER_ADDRESS override */ - vm_offset_t sv_usrstack; /* USRSTACK override */ + int sv_pagesize; /* pagesize */ + vm_offset_t sv_minuser; /* VM_MIN_ADDRESS */ + vm_offset_t sv_maxuser; /* VM_MAXUSER_ADDRESS */ + vm_offset_t sv_usrstack; /* USRSTACK */ + vm_offset_t sv_psstrings; /* PS_STRINGS */ + int sv_stackprot; /* vm protection for stack */ register_t *(*sv_copyout_strings)(struct image_params *); void (*sv_setregs)(struct thread *, u_long, u_long, u_long); }; @@ -89,6 +92,7 @@ struct sysentvec { #ifdef _KERNEL extern struct sysentvec aout_sysvec; extern struct sysentvec elf_freebsd_sysvec; +extern struct sysentvec null_sysvec; extern struct sysent sysent[]; #define NO_SYSCALL (-1) |