From: deraadt Date: Wed, 29 Nov 1995 17:02:41 +0000 (+0000) Subject: niklas pointed out the new MDP_UNCACHE_WX might break fork/exec. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2343fc6162a6b76a5bfe55fb27168842b9c05d18;p=openbsd niklas pointed out the new MDP_UNCACHE_WX might break fork/exec. always set/clear in setregs() now --- 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 @@ -87,21 +87,6 @@ struct sunos_sigframe { comes here */ }; -/* - * 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. 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, };