diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-05-23 06:46:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-05-23 06:46:10 +0000 |
commit | f5423e77ba921961fe4b88c7cd4a64c470dc21a5 (patch) | |
tree | 00bbd99177117ee9e93cc55d8c7bcd2077ff947c /sys/arch | |
parent | 5537b3b962c9329ce00e70ccab47dab0a63d670f (diff) |
netbsd 1.54; do not count on new process having cleared condition codes;
hunted down by brian poole as relevant for the occassional cron failure
at startup...
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/sparc64/vm_machdep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/vm_machdep.c b/sys/arch/sparc64/sparc64/vm_machdep.c index 45864d16e23..a5dcebf5307 100644 --- a/sys/arch/sparc64/sparc64/vm_machdep.c +++ b/sys/arch/sparc64/sparc64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.9 2003/02/24 07:55:08 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.10 2004/05/23 06:46:09 deraadt Exp $ */ /* $NetBSD: vm_machdep.c,v 1.38 2001/06/30 00:02:20 eeh Exp $ */ /* @@ -310,11 +310,15 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) npcb->pcb_pc = (long)proc_trampoline - 8; npcb->pcb_sp = (long)rp - STACK_OFFSET; + /* Need to create a %tstate if we're forking from proc0 */ if (p1 == &proc0) tf2->tf_tstate = (ASI_PRIMARY_NO_FAULT<<TSTATE_ASI_SHIFT) | ((PSTATE_USER)<<TSTATE_PSTATE_SHIFT); - + else + /* clear condition codes and disable FPU */ + tf2->tf_tstate &= + ~((PSTATE_PEF<<TSTATE_PSTATE_SHIFT)|TSTATE_CCR); #ifdef NOTDEF_DEBUG printf("cpu_fork: Copying over trapframe: otf=%p ntf=%p sp=%p opcb=%p npcb=%p\n", |