summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_aout.c30
-rw-r--r--sys/kern/init_main.c30
-rw-r--r--sys/kern/kern_exec.c2
3 files changed, 52 insertions, 10 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 9573928d9fea..b3beb9f94518 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 f3860856c3a8..8c4e8de73953 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 5e04c907a731..1ee302a976f9 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,