Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/arch/arm/vfp Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/608fedc2c64f
branches:  netbsd-7
changeset: 799143:608fedc2c64f
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Mar 26 08:53:48 2015 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #643):
        sys/arch/arm/vfp/vfp_init.c: revision 1.47
Fix some inverted return values.  Don't return SIGILL if there is an active
FPU exception.

diffstat:

 sys/arch/arm/vfp/vfp_init.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 807e919ed152 -r 608fedc2c64f sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Wed Mar 25 17:25:13 2015 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Thu Mar 26 08:53:48 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.41.2.1 2015/03/21 17:51:21 snj Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.41.2.2 2015/03/26 08:53:48 snj Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -394,15 +394,19 @@
        }
 
        /*
-        * If we are just changing/fetching FPSCR, don't bother loading it.
+        * If we are just changing/fetching FPSCR, don't bother loading it
+        * just emulate the instruction.
         */
        if (!vfp_fpscr_handler(address, insn, frame, fault_code))
-               return 1;
+               return 0;
 
-       /* if we already own the FPU and it's enabled, raise SIGILL */
+       /* 
+        * If we already own the FPU and it's enabled (and no exception), raise
+        * SIGILL.  If there is an exception, drop through to raise a SIGFPE.
+        */
        if (curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp
-           && (armreg_fpexc_read() & VFP_FPEXC_EN) != 0)
-               return 0;
+           && (armreg_fpexc_read() & (VFP_FPEXC_EX|VFP_FPEXC_EN)) == VFP_FPEXC_EN)
+               return 1;
 
        /*
         * Make sure we own the FP.
@@ -474,7 +478,7 @@
        /* if we already own the FPU and it's enabled, raise SIGILL */
        if (curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp
            && (armreg_fpexc_read() & VFP_FPEXC_EN) != 0)
-               return 0;
+               return 1;
 
        pcu_load(&arm_vfp_ops);
 



Home | Main Index | Thread Index | Old Index