summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-29 17:02:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-29 17:02:50 +0000
commit830b4531a9f5ca9c276d17444e2d16c9ed87defa (patch)
treed65efbeefd39fbfc099574cc37ccebb6ca6b2d9d
parent22ba10e603c6b27c70aaeec1c6d690cd8dbe44ed (diff)
niklas pointed out the new MDP_UNCACHE_WX might break fork/exec.
always set/clear in setregs() now
-rw-r--r--sys/arch/m68k/m68k/sunos_machdep.c15
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c13
-rw-r--r--sys/compat/sunos/sunos_exec.c8
3 files changed, 12 insertions, 24 deletions
diff --git a/sys/arch/m68k/m68k/sunos_machdep.c b/sys/arch/m68k/m68k/sunos_machdep.c
index 25e3ed7694f..20250bd9565 100644
--- a/sys/arch/m68k/m68k/sunos_machdep.c
+++ b/sys/arch/m68k/m68k/sunos_machdep.c
@@ -88,21 +88,6 @@ struct sunos_sigframe {
};
/*
- * SunOS' ld.so does self-modifying code without knowing about the 040's
- * cache purging needs. So we need to uncache writeable executable pages.
- */
-void
-sunos_setregs(p, pack, stack, retval)
- register struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
- setregs(p, pack, stack, retval);
- p->p_md.md_flags |= MDP_UNCACHE_WX;
-}
-
-/*
* much simpler sendsig() for SunOS processes, as SunOS does the whole
* context-saving in usermode. For now, no hardware information (ie.
* frames for buserror etc) is saved. This could be fatal, so I take
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index f237d375f85..697c8406519 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $Id: machdep.c,v 1.4 1995/11/28 01:24:40 deraadt Exp $ */
+/* $Id: machdep.c,v 1.5 1995/11/29 17:02:49 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -416,6 +416,17 @@ setregs(p, pack, stack, retval)
p->p_addr->u_pcb.pcb_fpregs.fpf_null = 0;
m68881_restore(&p->p_addr->u_pcb.pcb_fpregs);
#endif
+#ifdef COMPAT_SUNOS
+ /*
+ * SunOS' ld.so does self-modifying code without knowing
+ * about the 040's cache purging needs. So we need to uncache
+ * writeable executable pages.
+ */
+ if (p->p_emul == &emul_sunos)
+ p->p_md.md_flags |= MDP_UNCACHE_WX;
+ else
+ p->p_md.md_flags &= ~MDP_UNCACHE_WX;
+#endif
#ifdef COMPAT_HPUX
p->p_md.md_flags &= ~MDP_HPUXMMAP;
if (p->p_emul == &emul_hpux) {
diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c
index e2ada6fff0b..3ed414feb97 100644
--- a/sys/compat/sunos/sunos_exec.c
+++ b/sys/compat/sunos/sunos_exec.c
@@ -68,10 +68,6 @@ extern struct sysent sunos_sysent[];
extern char *sunos_syscallnames[];
#endif
extern void sunos_sendsig __P((sig_t, int, int, u_long));
-#ifdef m68k
-extern void sunos_setregs __P((struct proc *, struct exec_package *, u_long,
- register_t *));
-#endif
extern char sigcode[], esigcode[];
const char sunos_emul_path[] = "/emul/sunos";
@@ -93,11 +89,7 @@ struct emul emul_sunos = {
#endif
0,
copyargs,
-#ifdef m68k
- sunos_setregs,
-#else
setregs,
-#endif
sigcode,
esigcode,
};