Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm make the topology support empty on non-SMP ...



details:   https://anonhg.NetBSD.org/src/rev/736cd9b98582
branches:  trunk
changeset: 467164:736cd9b98582
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 16 06:34:24 2020 +0000

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

diffstat:

 sys/arch/arm/arm/arm_cpu_topology.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (62 lines):

diff -r b91e9438466f -r 736cd9b98582 sys/arch/arm/arm/arm_cpu_topology.c
--- a/sys/arch/arm/arm/arm_cpu_topology.c       Wed Jan 15 19:37:41 2020 +0000
+++ b/sys/arch/arm/arm/arm_cpu_topology.c       Thu Jan 16 06:34:24 2020 +0000
@@ -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 @@
 
 #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 @@
                smtid = 0;
        }
        cpu_topology_set(ci, pkgid, coreid, smtid, numaid, slow);
+#endif /* MULTIPROCESSOR */
 }
 
 void
@@ -66,7 +71,6 @@
 #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_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.



Home | Main Index | Thread Index | Old Index