diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-06 17:59:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-06 17:59:58 +0000 |
commit | 480459a5d79ffb89adef26de67138ecfc2e31ac8 (patch) | |
tree | 3c9dc3e1d2bf91bf53f67e50fc32b6388495f9af /sys/arch/mac68k | |
parent | 5805bbd00a60d59f63d1c80fdb1eec00a7aefc1d (diff) |
Factorize setregs() code to m68k-common location.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r-- | sys/arch/mac68k/mac68k/machdep.c | 58 |
1 files changed, 1 insertions, 57 deletions
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 |