summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-06-22 23:00:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-06-22 23:00:16 +0000
commitac41f72cfb5fcff54aefd94138a2ac29e19d060b (patch)
treeb502b166dd85c00abac9889a29f307205b5e1546
parente536bc7c874452cef9c8c9f24d93a7972b756e8c (diff)
During exception processing, we are not supposed to fault immediately
after re-enabling the FPU (unless exception handling code is suffering from bugs, of course). Should this happen, invoke the error fault handler, but at least clear the exception state first, so that it gets a chance to run.
-rw-r--r--sys/arch/mvme88k/mvme88k/eh.S13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S
index e8178194dba..4e97857437a 100644
--- a/sys/arch/mvme88k/mvme88k/eh.S
+++ b/sys/arch/mvme88k/mvme88k/eh.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: eh.S,v 1.53 2004/06/22 18:27:08 miod Exp $ */
+/* $OpenBSD: eh.S,v 1.54 2004/06/22 23:00:15 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -2371,7 +2371,16 @@ ASLOCAL(m88110_use_SR3_pcb)
* use it as scratch storage.
*/
#if 1
- br _C_LABEL(m88110_error_handler)
+ ldcr TMP, PSR
+ clr TMP, TMP, 1<PSR_FPU_DISABLE_BIT> /* enable the FPU */
+ clr TMP, TMP, 1<PSR_SHADOW_FREEZE_BIT> /* and shadowing */
+ stcr TMP, EPSR
+
+ or.u TMP, r0, hi16(_C_LABEL(m88110_error_handler))
+ or TMP, TMP, lo16(_C_LABEL(m88110_error_handler))
+ stcr TMP, EXIP
+
+ RTE
#else
/* Testing!!! */
xcr r30, r30, SR3 /* r30 = old exception frame */