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 most of the cpu_* variables to <arm/locore.h>



details:   https://anonhg.NetBSD.org/src/rev/98c9830b4529
branches:  trunk
changeset: 327256:98c9830b4529
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Mar 03 08:15:36 2014 +0000

description:
Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present

diffstat:

 sys/arch/arm/arm32/arm32_machdep.c |  13 +++++++++++--
 sys/arch/arm/arm32/cpu.c           |   9 ++++++---
 sys/arch/arm/include/locore.h      |  14 ++++++++++++--
 3 files changed, 29 insertions(+), 7 deletions(-)

diffs (116 lines):

diff -r d04ef2abbc6d -r 98c9830b4529 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Mon Mar 03 08:00:50 2014 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Mon Mar 03 08:15:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.100 2014/02/25 18:30:08 pooka Exp $        */
+/*     $NetBSD: arm32_machdep.c,v 1.101 2014/03/03 08:15:36 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.100 2014/02/25 18:30:08 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.101 2014/03/03 08:15:36 matt Exp $");
 
 #include "opt_modular.h"
 #include "opt_md.h"
@@ -106,6 +106,7 @@
 int cpu_simd_present;
 int cpu_simdex_present;
 int cpu_umull_present;
+int cpu_synchprim_present;
 const char *cpu_arch = "";
 
 int cpu_instruction_set_attributes[6];
@@ -491,6 +492,11 @@
                       NULL, 0, &cpu_simdex_present, 0,
                       CTL_MACHDEP, CTL_CREATE, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
+                      CTLFLAG_PERMANENT|CTLFLAG_READONLY,
+                      CTLTYPE_INT, "synchprim_present", NULL,
+                      NULL, 0, &cpu_synchprim_present, 0,
+                      CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+       sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                       CTLTYPE_INT, "printfataltraps", NULL,
                       NULL, 0, &cpu_printfataltraps, 0,
@@ -679,6 +685,9 @@
 {
        uint32_t mbox;
        kcpuset_export_u32(kcpuset_attached, &mbox, sizeof(mbox));
+#ifdef VERBOSE_ARM_INIT
+       printf("%s: writing mbox with %#x\n", __func__, mbox);
+#endif
        atomic_swap_32(&arm_cpu_mbox, mbox);
        membar_producer();
 #ifdef _ARM_ARCH_7
diff -r d04ef2abbc6d -r 98c9830b4529 sys/arch/arm/arm32/cpu.c
--- a/sys/arch/arm/arm32/cpu.c  Mon Mar 03 08:00:50 2014 +0000
+++ b/sys/arch/arm/arm32/cpu.c  Mon Mar 03 08:15:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.100 2014/02/20 23:24:55 matt Exp $   */
+/*     $NetBSD: cpu.c,v 1.101 2014/03/03 08:15:36 matt Exp $   */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.100 2014/02/20 23:24:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.101 2014/03/03 08:15:36 matt Exp $");
 
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -67,7 +67,7 @@
 volatile u_int arm_cpu_hatched = 0;
 u_int arm_cpu_max = 0;
 uint32_t arm_cpu_mbox __cacheline_aligned = 0;
-uint32_t arm_cpu_marker __cacheline_aligned = 1;
+uint32_t arm_cpu_marker[2]  __cacheline_aligned = { 0, 0 };
 #endif
 
 /* Prototypes */
@@ -784,6 +784,9 @@
            ((cpu_instruction_set_attributes[3] >> 4) & 0x0f) >= 3;
        cpu_simdex_present = cpu_simd_present
            && ((cpu_instruction_set_attributes[1] >> 12) & 0x0f) >= 2;
+       cpu_synchprim_present =
+           ((cpu_instruction_set_attributes[3] >> 8) & 0xf0)
+           | ((cpu_instruction_set_attributes[4] >> 20) & 0x0f);
 
        cpu_memory_model_features[0] = armreg_mmfr0_read();
        cpu_memory_model_features[1] = armreg_mmfr1_read();
diff -r d04ef2abbc6d -r 98c9830b4529 sys/arch/arm/include/locore.h
--- a/sys/arch/arm/include/locore.h     Mon Mar 03 08:00:50 2014 +0000
+++ b/sys/arch/arm/include/locore.h     Mon Mar 03 08:15:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.h,v 1.13 2014/02/26 01:54:35 matt Exp $ */
+/*     $NetBSD: locore.h,v 1.14 2014/03/03 08:15:36 matt Exp $ */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -148,10 +148,20 @@
 #endif
 
 /* 1 == use cpu_sleep(), 0 == don't */
+extern int cpu_do_powersave;
 extern int cpu_printfataltraps;
-extern int cpu_do_powersave;
 extern int cpu_fpu_present;
 extern int cpu_hwdiv_present;
+extern int cpu_neon_present;
+extern int cpu_simd_present;
+extern int cpu_simdex_present;
+extern int cpu_umull_present;
+extern int cpu_synchprim_present;
+
+extern int cpu_instruction_set_attributes[6];
+extern int cpu_memory_model_features[4];
+extern int cpu_processor_features[2];
+extern int cpu_media_and_vfp_features[2];
 
 extern u_int arm_cpu_max;
 



Home | Main Index | Thread Index | Old Index