Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Add a machdep.fpu_present sysctl for ld.elf_so ...



details:   https://anonhg.NetBSD.org/src/rev/9daa80c2fb03
branches:  trunk
changeset: 784463:9daa80c2fb03
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jan 28 23:49:12 2013 +0000

description:
Add a machdep.fpu_present sysctl for ld.elf_so to use in ld.so.conf to load
libc_vfp.so.

diffstat:

 sys/arch/arm/arm32/arm32_machdep.c |  10 ++++++++--
 sys/arch/arm/include/cpu.h         |   1 +
 sys/arch/arm/vfp/vfp_init.c        |   3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diffs (66 lines):

diff -r 4b61f564898b -r 9daa80c2fb03 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Mon Jan 28 23:47:38 2013 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Mon Jan 28 23:49:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.89 2013/01/19 10:16:56 skrll Exp $ */
+/*     $NetBSD: arm32_machdep.c,v 1.90 2013/01/28 23:49:12 matt Exp $  */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.89 2013/01/19 10:16:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.90 2013/01/28 23:49:12 matt Exp $");
 
 #include "opt_modular.h"
 #include "opt_md.h"
@@ -97,6 +97,7 @@
 extern paddr_t msgbufphys;
 
 int kernel_debug = 0;
+int cpu_fpu_present;
 
 /* exported variable to be filled in by the bootloaders */
 char *booted_kernel;
@@ -360,6 +361,11 @@
                       CTLTYPE_INT, "powersave", NULL,
                       sysctl_machdep_powersave, 0, &cpu_do_powersave, 0,
                       CTL_MACHDEP, CPU_POWERSAVE, CTL_EOL);
+       sysctl_createv(clog, 0, NULL, NULL,
+                      CTLFLAG_PERMANENT|CTLFLAG_READONLY,
+                      CTLTYPE_INT, "fpu_present", NULL,
+                      NULL, 0, &cpu_fpu_present, 0,
+                      CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
 
 void
diff -r 4b61f564898b -r 9daa80c2fb03 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Mon Jan 28 23:47:38 2013 +0000
+++ b/sys/arch/arm/include/cpu.h        Mon Jan 28 23:49:12 2013 +0000
@@ -85,6 +85,7 @@
 #ifndef _LOCORE
 /* 1 == use cpu_sleep(), 0 == don't */
 extern int cpu_do_powersave;
+extern int cpu_fpu_present;
 #endif
 
 #ifdef _LOCORE
diff -r 4b61f564898b -r 9daa80c2fb03 sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Mon Jan 28 23:47:38 2013 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Mon Jan 28 23:49:12 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.16 2013/01/28 06:14:45 matt Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.17 2013/01/28 23:49:13 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -382,6 +382,7 @@
                return;
        }
 
+       cpu_fpu_present = 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