summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2011-06-06 13:19:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2011-06-06 13:19:30 +0000
commitb97269c7302cd15ad50a2953cac973299c02e3c2 (patch)
tree61648d7c24ab26f0ac3dfa1bcc9a4feecef20271 /sys
parent7cfef195cbdc64bb24b5240b10ab25498d49cb73 (diff)
Set FEF bit in the %fprs register when handling an fp_disabled trap from
userland. Prevents userland applications from trapping forever on the next floating point instruction executed after clearing this flag. Fixes issues with threaded applications, sinc our pthreads library clears the FEF bit under some circumstances. ok miod@, tested by ajacoutot@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/sparc64/trap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index d5e4bc32f7c..ed9dde460ef 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.67 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.68 2011/06/06 13:19:29 kettenis Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
@@ -606,6 +606,7 @@ badtrap:
uvmexp.fpswtch++;
}
tf->tf_tstate |= (PSTATE_PEF<<TSTATE_PSTATE_SHIFT);
+ sparc_wr(fprs, FPRS_FEF, 0);
break;
}