diff options
-rw-r--r-- | sys/arch/amiga/amiga/machdep.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index db3c42bd11a..26f83ac34f0 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.30 1999/01/07 23:15:54 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.31 1999/01/20 12:06:52 niklas Exp $ */ /* $NetBSD: machdep.c,v 1.95 1997/08/27 18:31:17 is Exp $ */ /* @@ -549,8 +549,6 @@ again: /* * 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) @@ -561,9 +559,24 @@ setregs(p, pack, stack, 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[SP] = stack; + 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; |