Module Name:    src
Committed By:   mrg
Date:           Thu Jan 16 06:34:24 UTC 2020

Modified Files:
        src/sys/arch/arm/arm: arm_cpu_topology.c

Log Message:
make the topology support empty on non-SMP enabled kernels.
reduces kernel sizes and also fixes the builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm/arm_cpu_topology.c

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/arm/arm_cpu_topology.c
diff -u src/sys/arch/arm/arm/arm_cpu_topology.c:1.1 src/sys/arch/arm/arm/arm_cpu_topology.c:1.2
--- src/sys/arch/arm/arm/arm_cpu_topology.c:1.1	Wed Jan 15 08:34:04 2020
+++ src/sys/arch/arm/arm/arm_cpu_topology.c	Thu Jan 16 06:34:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_cpu_topology.c,v 1.1 2020/01/15 08:34:04 mrg Exp $	*/
+/*	$NetBSD: arm_cpu_topology.c,v 1.2 2020/01/16 06:34:24 mrg Exp $	*/
 
 /*
  * Copyright (c) 2020 Matthew R. Green
@@ -28,10 +28,12 @@
  * SUCH DAMAGE.
  */
 
+/* CPU topology support for ARMv7 and ARMv8 systems.  */
+
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm_cpu_topology.c,v 1.1 2020/01/15 08:34:04 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_cpu_topology.c,v 1.2 2020/01/16 06:34:24 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,12 +42,14 @@ __KERNEL_RCSID(0, "$NetBSD: arm_cpu_topo
 
 #include <arm/cpu.h>
 #include <arm/cpu_topology.h>
+#include <arm/armreg.h>
 
 #include <prop/proplib.h>
 
 void
 arm_cpu_topology_set(struct cpu_info * const ci, uint64_t mpidr, bool slow)
 {
+#ifdef MULTIPROCESSOR
 	uint pkgid, coreid, smtid, numaid = 0;
 
 	if (mpidr & MPIDR_MT) {
@@ -58,6 +62,7 @@ arm_cpu_topology_set(struct cpu_info * c
 		smtid = 0;
 	}
 	cpu_topology_set(ci, pkgid, coreid, smtid, numaid, slow);
+#endif /* MULTIPROCESSOR */
 }
 
 void
@@ -66,7 +71,6 @@ arm_cpu_do_topology(struct cpu_info *con
 #ifdef MULTIPROCESSOR
 	struct cpu_info *ci;
 	CPU_INFO_ITERATOR cii;
-#endif /* MULTIPROCESSOR */
 	prop_dictionary_t dict;
 	uint32_t capacity_dmips_mhz = 0;
 	static uint32_t best_cap = 0;
@@ -87,7 +91,6 @@ arm_cpu_do_topology(struct cpu_info *con
 	arm_cpu_topology_set(newci, arm_cpu_mpidr(newci),
 	    newci->ci_capacity_dmips_mhz < best_cap);
 
-#ifdef MULTIPROCESSOR
 	/*
 	 * Using saved largest capacity, refresh previous topology info.
 	 * It's supposed to be OK to re-set topology.

Reply via email to