summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2
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/i386/ibcs2
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/i386/ibcs2')
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c31
1 files changed, 27 insertions, 4 deletions
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.
OpenPOWER on IntegriCloud