* AMIGA pages in a MACH page.
*/
#ifdef M68040
- if (mmutype == MMU_68040 && pmap == pmap_kernel() && va >= AMIGA_UPTBASE &&
- va < (AMIGA_UPTBASE + AMIGA_UPTMAXSIZE))
+ if (mmutype == MMU_68040 && pmap == pmap_kernel() &&
+ va >= AMIGA_UPTBASE && va < (AMIGA_UPTBASE + AMIGA_UPTMAXSIZE))
cacheable = FALSE; /* don't cache user page tables */
+
+ /* 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
npte = (pa & PG_FRAME) | pte_prot(pmap, prot) | PG_V;
npte |= (*(int *)pte & (PG_M|PG_U));
#define MDP_STACKADJ 0x0002 /* frame SP adjusted, might have to
undo when system call returns
ERESTART. */
+#define MDP_UNCACHE_WX 0x0004 /* The process might modify code, so
+ don't cache writeable executable pages. */
#endif /* !_MACHINE_PROC_H_ */
struct sunos_sigcontext sf_sc; /* I don't know if that's what
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.
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";
#endif
0,
copyargs,
+#ifdef m68k
+ sunos_setregs,
+#else
setregs,
+#endif
sigcode,
esigcode,
};