Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips in mips_emul_fp(), clear all pending FP e...



details:   https://anonhg.NetBSD.org/src/rev/c1e2e1d6e806
branches:  trunk
changeset: 822046:c1e2e1d6e806
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Feb 27 06:57:45 2017 +0000

description:
in mips_emul_fp(), clear all pending FP exceptions rather than
just a particular one, otherwise the kernel can take another
FPU trap when it writes back the new FCSR value.
discovered via the fesetround() bug that wrote garbage to the FCSR.

diffstat:

 sys/arch/mips/mips/fp.S |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 1cf2c6645a46 -r c1e2e1d6e806 sys/arch/mips/mips/fp.S
--- a/sys/arch/mips/mips/fp.S   Mon Feb 27 06:57:16 2017 +0000
+++ b/sys/arch/mips/mips/fp.S   Mon Feb 27 06:57:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fp.S,v 1.47 2016/10/13 18:54:46 macallan Exp $ */
+/*     $NetBSD: fp.S,v 1.48 2017/02/27 06:57:45 chs Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -145,7 +145,7 @@
 #else
        cfc1    a2, MIPS_FPU_CSR                # get exception register
        PTR_L   a3, fmt_tbl(v0)                 # switch on FUNC & FMT
-       and     a2, a2, ~MIPS_FPU_EXCEPTION_UNIMPL      # clear exception
+       and     a2, a2, ~MIPS_FPU_EXCEPTION_BITS        # clear exception
        ctc1    a2, MIPS_FPU_CSR
 #endif
        j       a3



Home | Main Index | Thread Index | Old Index