Module Name:    src
Committed By:   matt
Date:           Mon Mar  3 08:15:36 UTC 2014

Modified Files:
        src/sys/arch/arm/arm32: arm32_machdep.c cpu.c
        src/sys/arch/arm/include: locore.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/arm/arm32/arm32_machdep.c \
    src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/include/locore.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/arm32_machdep.c
diff -u src/sys/arch/arm/arm32/arm32_machdep.c:1.100 src/sys/arch/arm/arm32/arm32_machdep.c:1.101
--- src/sys/arch/arm/arm32/arm32_machdep.c:1.100	Tue Feb 25 18:30:08 2014
+++ src/sys/arch/arm/arm32/arm32_machdep.c	Mon Mar  3 08:15:36 2014
@@ -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_neon_present;
 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 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		       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 @@ cpu_boot_secondary_processors(void)
 {
 	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
Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.100 src/sys/arch/arm/arm32/cpu.c:1.101
--- src/sys/arch/arm/arm32/cpu.c:1.100	Thu Feb 20 23:24:55 2014
+++ src/sys/arch/arm/arm32/cpu.c	Mon Mar  3 08:15:36 2014
@@ -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 @@ extern const char *cpu_arch;
 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 @@ identify_features(device_t dv)
 	    ((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();

Index: src/sys/arch/arm/include/locore.h
diff -u src/sys/arch/arm/include/locore.h:1.13 src/sys/arch/arm/include/locore.h:1.14
--- src/sys/arch/arm/include/locore.h:1.13	Wed Feb 26 01:54:35 2014
+++ src/sys/arch/arm/include/locore.h	Mon Mar  3 08:15:36 2014
@@ -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 @@ void	cpu_attach(device_t, cpuid_t);
 #endif
 
 /* 1 == use cpu_sleep(), 0 == don't */
-extern int cpu_printfataltraps;
 extern int cpu_do_powersave;
+extern int cpu_printfataltraps;
 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;
 

Reply via email to