-# $OpenBSD: DISKLESS,v 1.13 1997/02/16 14:37:06 downsj Exp $
+# $OpenBSD: DISKLESS,v 1.14 1997/02/24 01:16:06 downsj Exp $
# $NetBSD: GENERIC,v 1.23 1997/01/31 06:12:57 thorpej Exp $
#
# Generic kernel - one size fits all.
option COMPAT_HPUX # HP-UX binary compatibility
option COMPAT_M68K4K # compat. with NetBSD/m68k4k binaries
+option COMPAT_SUNOS # SunOS/sun3 binaries
# Verbose descriptions of unconfigured DIO devices
# (Warning: this compiles in a large string table)
-# $OpenBSD: GENERIC,v 1.17 1997/02/16 14:37:08 downsj Exp $
+# $OpenBSD: GENERIC,v 1.18 1997/02/24 01:16:07 downsj Exp $
# $NetBSD: GENERIC,v 1.23 1997/01/31 06:12:57 thorpej Exp $
#
# Generic kernel - one size fits all.
option COMPAT_HPUX # HP-UX binary compatibility
option COMPAT_M68K4K # compat. with NetBSD/m68k4k binaries
+option COMPAT_SUNOS # SunOS/sun3 binaries
# Verbose descriptions of unconfigured DIO devices
# (Warning: this compiles in a large string table)
-# $OpenBSD: files.hp300,v 1.6 1997/02/16 10:42:18 downsj Exp $
+# $OpenBSD: files.hp300,v 1.7 1997/02/24 01:16:07 downsj Exp $
# $NetBSD: files.hp300,v 1.22 1997/01/30 22:11:19 scottr Exp $
#
# hp300-specific configuration info
#
include "compat/hpux/files.hpux"
file arch/hp300/hp300/hpux_machdep.c compat_hpux
+
+#
+# SunOS binary compatibility
+#
+include "compat/sunos/files.sunos"
+file arch/m68k/m68k/sunos_machdep.c compat_sunos
-/* $OpenBSD: machdep.c,v 1.19 1997/02/23 21:42:55 downsj Exp $ */
+/* $OpenBSD: machdep.c,v 1.20 1997/02/24 01:16:09 downsj Exp $ */
/* $NetBSD: machdep.c,v 1.80 1997/02/02 07:58:49 thorpej Exp $ */
/*
#ifdef COMPAT_HPUX
extern struct emul emul_hpux;
#endif
+#ifdef COMPAT_SUNOS
+extern struct emul emul_sunos;
+#endif
/* prototypes for local functions */
caddr_t allocsys __P((caddr_t));
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) {
struct proc *p;
struct exec_package *epp;
{
-#if defined(COMPAT_NOMID) || defined(COMPAT_44)
+#if defined(COMPAT_NOMID) || defined(COMPAT_44) || defined(COMPAT_SUNOS)
u_long midmag, magic;
u_short mid;
int error;
struct exec *execp = epp->ep_hdr;
+#ifdef COMPAT_SUNOS
+ extern sunos_exec_aout_makecmds
+ __P((struct proc *, struct exec_package *));
+#endif
midmag = ntohl(execp->a_midmag);
mid = (midmag >> 16) & 0xffff;
break;
#endif
default:
+#ifdef COMPAT_SUNOS
+ /* Hand it over to the SunOS emulation package. */
+ error = sunos_exec_aout_makecmds(p, epp);
+#else
error = ENOEXEC;
+#endif
}
return error;
-/* $OpenBSD: pmap.c,v 1.4 1997/02/10 11:13:32 downsj Exp $ */
+/* $OpenBSD: pmap.c,v 1.5 1997/02/24 01:16:09 downsj Exp $ */
/* $NetBSD: pmap.c,v 1.28 1997/02/02 08:01:32 thorpej Exp $ */
/*
npte = pa | pte_prot(pmap, prot) | (*pte & (PG_M|PG_U)) | PG_V;
if (wired)
npte |= PG_W;
+
+#if defined(M68040)
+ /* Don't cache if process can't take it, like SunOS ones. */
+ if (mmutype == MMU_68040 && pmap != pmap_kernel() &&
+ (curproc->p_md.md_flags & MDP_UNCACHE_WX) &&
+ (prot & VM_PROT_EXECUTE) && (prot & VM_PROT_WRITE))
+ checkpv = cacheable = FALSE;
+#endif
+
if (!checkpv && !cacheable)
npte |= PG_CI;
#if defined(M68040)
-/* $OpenBSD: proc.h,v 1.2 1997/01/12 15:13:40 downsj Exp $ */
+/* $OpenBSD: proc.h,v 1.3 1997/02/24 01:16:11 downsj Exp $ */
/* $NetBSD: proc.h,v 1.6 1994/10/26 07:26:35 cgd Exp $ */
/*
};
/* md_flags */
+#define MDP_STACKADJ 0x0002 /* frame SP adjusted; undo when syscall does ERE
+START */
#define MDP_HPUXTRACE 0x0004 /* being traced by HP-UX process */
#define MDP_HPUXMMAP 0x0008 /* VA space is multiply mapped */
#define MDP_CCBDATA 0x0010 /* copyback caching of data (68040) */
#define MDP_CCBSTACK 0x0020 /* copyback caching of stack (68040) */
+#define MDP_UNCACHE_WX 0x0040 /* The process might modify code, so
+ don't cache writeable executable pages. */