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 For armv7 (cortex), disable access to the u...



details:   https://anonhg.NetBSD.org/src/rev/a5ce65d9453a
branches:  trunk
changeset: 783106:a5ce65d9453a
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Dec 05 19:30:10 2012 +0000

description:
For armv7 (cortex), disable access to the upper 16 FP registers (restrict
the register space to 16 64-bit FP registers).

diffstat:

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

diffs (22 lines):

diff -r ddc80845a2f9 -r a5ce65d9453a sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Wed Dec 05 19:15:11 2012 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Wed Dec 05 19:30:10 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.8 2012/12/05 19:05:46 matt Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.9 2012/12/05 19:30:10 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -231,6 +231,12 @@
                uint32_t cpacr = armreg_cpacr_read();
                cpacr |= __SHIFTIN(CPACR_ALL, cpacr_vfp);
                cpacr |= __SHIFTIN(CPACR_ALL, cpacr_vfp2);
+               if (CPU_ID_CORTEX_P(curcpu()->ci_arm_cpuid)) {
+                       /*
+                        * Disable access to the upper 16 FP registers.
+                        */
+                       cpacr |= CPACR_V7_D32DIS;
+               }
                armreg_cpacr_write(cpacr);
 
                /*



Home | Main Index | Thread Index | Old Index