Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/vfp Install the undefined instruction handlers ...



details:   https://anonhg.NetBSD.org/src/rev/d4a62b0011bd
branches:  trunk
changeset: 455560:d4a62b0011bd
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Apr 06 08:48:53 2019 +0000

description:
Install the undefined instruction handlers only once, i.e. when attaching
on the BP.

diffstat:

 sys/arch/arm/vfp/vfp_init.c |  26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diffs (77 lines):

diff -r 71cf44c45e32 -r d4a62b0011bd sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Sat Apr 06 08:38:23 2019 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Sat Apr 06 08:48:53 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.61 2019/03/17 08:41:42 skrll Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.62 2019/04/06 08:48:53 skrll Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -32,7 +32,7 @@
 #include "opt_cputypes.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.61 2019/03/17 08:41:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.62 2019/04/06 08:48:53 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -260,7 +260,8 @@
                if ((nsacr & nsacr_vfp) != nsacr_vfp) {
                        aprint_normal_dev(ci->ci_dev,
                            "VFP access denied (NSACR=%#x)\n", nsacr);
-                       install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+                       if (CPU_IS_PRIMARY(ci))
+                               install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                        ci->ci_vfp_id = 0;
                        evcnt_attach_dynamic(&ci->ci_vfp_evs[0],
                            EVCNT_TYPE_TRAP, NULL, ci->ci_cpuname,
@@ -290,7 +291,8 @@
                if (!vfp_p) {
                        aprint_normal_dev(ci->ci_dev,
                            "VFP access denied (CPACR=%#x)\n", cpacr);
-                       install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+                       if (CPU_IS_PRIMARY(ci))
+                               install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                        ci->ci_vfp_id = 0;
                        evcnt_attach_dynamic(&ci->ci_vfp_evs[0],
                            EVCNT_TYPE_TRAP, NULL, ci->ci_cpuname,
@@ -309,7 +311,8 @@
 
        if (undefined_test != 0) {
                aprint_normal_dev(ci->ci_dev, "No VFP detected\n");
-               install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+               if (CPU_IS_PRIMARY(ci))
+                       install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                ci->ci_vfp_id = 0;
                return;
        }
@@ -343,7 +346,8 @@
        default:
                aprint_normal_dev(ci->ci_dev, "unrecognized VFP version %#x\n",
                    fpsid);
-               install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+               if (CPU_IS_PRIMARY(ci))
+                       install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                vfp_fpscr_changable = VFP_FPSCR_CSUM|VFP_FPSCR_ESUM
                    |VFP_FPSCR_RMODE;
                vfp_fpscr_default = 0;
@@ -391,12 +395,14 @@
            ci->ci_cpuname, "vfp coproc re-use");
        evcnt_attach_dynamic(&ci->ci_vfp_evs[2], EVCNT_TYPE_TRAP, NULL,
            ci->ci_cpuname, "vfp coproc fault");
-       install_coproc_handler(VFP_COPROC, vfp_handler);
-       install_coproc_handler(VFP_COPROC2, vfp_handler);
+       if (CPU_IS_PRIMARY(ci)) {
+               install_coproc_handler(VFP_COPROC, vfp_handler);
+               install_coproc_handler(VFP_COPROC2, vfp_handler);
 #ifdef CPU_CORTEX
-       if (cpu_neon_present)
-               install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
+               if (cpu_neon_present)
+                       install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
 #endif
+       }
 }
 
 /* The real handler for VFP bounces.  */



Home | Main Index | Thread Index | Old Index