diff options
author | 2004-05-23 06:46:09 +0000 | |
---|---|---|
committer | 2004-05-23 06:46:09 +0000 | |
commit | af24e039784e5b6e9e70cbe2421f28e2c075d4fe (patch) | |
tree | ff441f21d362da33c2ac33d4129867661aae443f | |
parent | Remove bugs section because the fix has been committed. Tested and ok krw@ (diff) | |
download | wireguard-openbsd-af24e039784e5b6e9e70cbe2421f28e2c075d4fe.tar.xz wireguard-openbsd-af24e039784e5b6e9e70cbe2421f28e2c075d4fe.zip |
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...
-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", |