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 Add support for machdep neon_present and id...



details:   https://anonhg.NetBSD.org/src/rev/ee28820351a7
branches:  trunk
changeset: 784551:ee28820351a7
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jan 31 22:35:25 2013 +0000

description:
Add support for machdep neon_present and id_mvfr sysctls

diffstat:

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

diffs (36 lines):

diff -r edc560dadbc9 -r ee28820351a7 sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Thu Jan 31 22:34:26 2013 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Thu Jan 31 22:35:25 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.17 2013/01/28 23:49:13 matt Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.18 2013/01/31 22:35:25 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -43,6 +43,9 @@
 
 #include <uvm/uvm_extern.h>            /* for pmap.h */
 
+extern int cpu_media_and_vfp_features[];
+extern int cpu_neon_present;
+
 /* 
  * Use generic co-processor instructions to avoid assembly problems.
  */
@@ -374,6 +377,7 @@
        case FPU_VFP_CORTEXA8:
        case FPU_VFP_CORTEXA9:
                model = "NEON MPE (VFP 3.0+)";
+               cpu_neon_present = 1;
                break;
        default:
                aprint_normal_dev(ci->ci_dev, "unrecognized VFP version %x\n",
@@ -383,6 +387,8 @@
        }
 
        cpu_fpu_present = 1;
+       __asm("fmrx %0, mvfr0" : "=r"(cpu_media_and_vfp_features[0]));
+       __asm("fmrx %0, mvfr1" : "=r"(cpu_media_and_vfp_features[1]));
        if (fpsid != 0) {
                aprint_normal("vfp%d at %s: %s\n",
                    device_unit(curcpu()->ci_dev), device_xname(curcpu()->ci_dev),



Home | Main Index | Thread Index | Old Index