summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hp300/hp300/machdep.c51
-rw-r--r--sys/arch/m68k/m68k/m68k_machdep.c45
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c58
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c51
4 files changed, 47 insertions, 158 deletions
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index e56d5268cdb..b39c7a660fc 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.103 2005/09/27 22:05:37 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.104 2005/11/06 17:59:52 miod Exp $ */
/* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */
/*
@@ -447,55 +447,6 @@ allocsys(v)
}
/*
- * Set registers on exec.
- */
-void
-setregs(p, pack, stack, retval)
- struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
- struct frame *frame = (struct frame *)p->p_md.md_regs;
-
- frame->f_sr = PSL_USERSET;
- frame->f_pc = pack->ep_entry & ~1;
- frame->f_regs[D0] = 0;
- frame->f_regs[D1] = 0;
- frame->f_regs[D2] = 0;
- frame->f_regs[D3] = 0;
- frame->f_regs[D4] = 0;
- frame->f_regs[D5] = 0;
- frame->f_regs[D6] = 0;
- frame->f_regs[D7] = 0;
- frame->f_regs[A0] = 0;
- frame->f_regs[A1] = 0;
- frame->f_regs[A2] = (int)PS_STRINGS;
- frame->f_regs[A3] = 0;
- frame->f_regs[A4] = 0;
- frame->f_regs[A5] = 0;
- frame->f_regs[A6] = 0;
- frame->f_regs[SP] = stack;
-
- /* restore a null state frame */
- p->p_addr->u_pcb.pcb_fpregs.fpf_null = 0;
- if (fputype)
- m68881_restore(&p->p_addr->u_pcb.pcb_fpregs);
-
-#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
-}
-
-/*
* Info for CTL_HW
*/
char cpu_model[120];
diff --git a/sys/arch/m68k/m68k/m68k_machdep.c b/sys/arch/m68k/m68k/m68k_machdep.c
index d2c805e0da0..021aa91dfd8 100644
--- a/sys/arch/m68k/m68k/m68k_machdep.c
+++ b/sys/arch/m68k/m68k/m68k_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m68k_machdep.c,v 1.6 2005/08/06 14:26:52 miod Exp $ */
+/* $OpenBSD: m68k_machdep.c,v 1.7 2005/11/06 17:59:57 miod Exp $ */
/* $NetBSD: m68k_machdep.c,v 1.3 1997/06/12 09:57:04 veego Exp $ */
/*-
@@ -38,15 +38,58 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
#include <sys/proc.h>
#include <sys/syscall.h>
#include <sys/ktrace.h>
+#include <sys/user.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/reg.h>
/*
+ * Set registers on exec.
+ */
+void
+setregs(p, pack, stack, retval)
+ struct proc *p;
+ struct exec_package *pack;
+ u_long stack;
+ register_t *retval;
+{
+#ifdef COMPAT_SUNOS
+ extern struct emul emul_sunos;
+#endif
+ struct frame *frame = (struct frame *)p->p_md.md_regs;
+
+ frame->f_sr = PSL_USERSET;
+ frame->f_pc = pack->ep_entry & ~1;
+ bzero(frame->f_regs, 15 * sizeof(register_t));
+ frame->f_regs[A2] = (int)PS_STRINGS;
+ frame->f_regs[SP] = stack;
+
+ /* restore a null state frame */
+ p->p_addr->u_pcb.pcb_fpregs.fpf_null = 0;
+ if (fputype != FPU_NONE) {
+ m68881_restore(&p->p_addr->u_pcb.pcb_fpregs);
+ }
+
+#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
+}
+
+/*
* Process the tail end of a fork() for the child
*/
void
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index c03628ddf97..88bf5555dc0 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.119 2005/09/27 21:50:39 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.120 2005/11/06 17:59:57 miod Exp $ */
/* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */
/*
@@ -554,62 +554,6 @@ initcpu()
void doboot(void)
__attribute__((__noreturn__));
-/*
- * Set registers on exec.
- * XXX Should clear registers except sp, pc,
- * but would break init; should be fixed soon.
- */
-void
-setregs(p, pack, stack, retval)
- struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
-#ifdef COMPAT_SUNOS
- extern struct emul emul_sunos;
-#endif
- struct frame *frame = (struct frame *)p->p_md.md_regs;
-
- frame->f_sr = PSL_USERSET;
- frame->f_pc = pack->ep_entry & ~1;
- frame->f_regs[D0] = 0;
- frame->f_regs[D1] = 0;
- frame->f_regs[D2] = 0;
- frame->f_regs[D3] = 0;
- frame->f_regs[D4] = 0;
- frame->f_regs[D5] = 0;
- frame->f_regs[D6] = 0;
- frame->f_regs[D7] = 0;
- frame->f_regs[A0] = 0;
- frame->f_regs[A1] = 0;
- frame->f_regs[A2] = (int)PS_STRINGS;
- frame->f_regs[A3] = 0;
- frame->f_regs[A4] = 0;
- frame->f_regs[A5] = 0;
- frame->f_regs[A6] = 0;
- frame->f_regs[SP] = stack;
-
- /* restore a null state frame */
- p->p_addr->u_pcb.pcb_fpregs.fpf_null = 0;
-
- if (fputype) {
- m68881_restore(&p->p_addr->u_pcb.pcb_fpregs);
- }
-
-#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
-}
-
int waittime = -1;
void
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 31f3ef2354b..b379863b722 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.89 2005/09/27 21:50:39 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.90 2005/11/06 17:59:57 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -424,55 +424,6 @@ allocsys(caddr_t v)
}
/*
- * Set registers on exec.
- */
-void
-setregs(p, pack, stack, retval)
- register struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
- struct frame *frame = (struct frame *)p->p_md.md_regs;
-
- frame->f_sr = PSL_USERSET;
- frame->f_pc = pack->ep_entry & ~1;
- frame->f_regs[D0] = 0;
- frame->f_regs[D1] = 0;
- frame->f_regs[D2] = 0;
- frame->f_regs[D3] = 0;
- frame->f_regs[D4] = 0;
- frame->f_regs[D5] = 0;
- frame->f_regs[D6] = 0;
- frame->f_regs[D7] = 0;
- frame->f_regs[A0] = 0;
- frame->f_regs[A1] = 0;
- frame->f_regs[A2] = (int)PS_STRINGS;
- frame->f_regs[A3] = 0;
- frame->f_regs[A4] = 0;
- frame->f_regs[A5] = 0;
- frame->f_regs[A6] = 0;
- frame->f_regs[SP] = stack;
-
- /* restore a null state frame */
- p->p_addr->u_pcb.pcb_fpregs.fpf_null = 0;
- if (fputype)
- m68881_restore(&p->p_addr->u_pcb.pcb_fpregs);
-
-#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
-}
-
-/*
* Info for CTL_HW
*/
char cpu_model[120];