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 Cleanup a bit of the init logic.



details:   https://anonhg.NetBSD.org/src/rev/05c689d2942d
branches:  trunk
changeset: 329969:05c689d2942d
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Jun 15 23:07:36 2014 +0000

description:
Cleanup a bit of the init logic.

diffstat:

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

diffs (34 lines):

diff -r 4dcd4fad5b56 -r 05c689d2942d sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Sun Jun 15 20:14:41 2014 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Sun Jun 15 23:07:36 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.39 2014/05/16 00:48:41 rmind Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.40 2014/06/15 23:07:36 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -242,7 +242,8 @@
                const uint32_t nsacr = armreg_nsacr_read();
                const uint32_t nsacr_vfp = __BITS(VFP_COPROC,VFP_COPROC2);
                if ((nsacr & nsacr_vfp) != nsacr_vfp) {
-                       aprint_normal_dev(ci->ci_dev, "VFP access denied\n");
+                       aprint_normal_dev(ci->ci_dev,
+                           "VFP access denied (NSACR=%#x)\n", nsacr);
                        install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                        ci->ci_vfp_id = 0;
                        evcnt_attach_dynamic(&ci->ci_vfp_evs[0],
@@ -266,10 +267,11 @@
                 * If we could enable them, then they exist.
                 */
                cpacr = armreg_cpacr_read();
-               bool vfp_p = __SHIFTOUT(cpacr, cpacr_vfp2) != CPACR_NOACCESS
-                   || __SHIFTOUT(cpacr, cpacr_vfp) != CPACR_NOACCESS;
+               bool vfp_p = __SHIFTOUT(cpacr, cpacr_vfp2) == CPACR_ALL
+                   && __SHIFTOUT(cpacr, cpacr_vfp) == CPACR_ALL;
                if (!vfp_p) {
-                       aprint_normal_dev(ci->ci_dev, "No VFP detected\n");
+                       aprint_normal_dev(ci->ci_dev,
+                           "VFP access denied (CPACR=%#x)\n", cpacr);
                        install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
                        ci->ci_vfp_id = 0;
                        evcnt_attach_dynamic(&ci->ci_vfp_evs[0],



Home | Main Index | Thread Index | Old Index