summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-09-01 21:41:24 +0000
committerjake <jake@FreeBSD.org>2002-09-01 21:41:24 +0000
commitce650f8c333de3130e1beb1e3caa213af385e085 (patch)
treed075a9970497c96d66b9507960a9e101b7f40fb7 /sys/kern
parentae4b45674cf31dbfe2ca333e6d3b5faf3f214ff4 (diff)
downloadFreeBSD-src-ce650f8c333de3130e1beb1e3caa213af385e085.zip
FreeBSD-src-ce650f8c333de3130e1beb1e3caa213af385e085.tar.gz
Added fields for VM_MIN_ADDRESS, PS_STRINGS and stack protections to
sysentvec. Initialized all fields of all sysentvecs, which will allow them to be used instead of constants in more places. Provided stack fixup routines for emulations that previously used the default.
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 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,
OpenPOWER on IntegriCloud