Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips Support "boot -1" to start an MP kernel in uni...



details:   https://anonhg.NetBSD.org/src/rev/43b87e5122fe
branches:  trunk
changeset: 936209:43b87e5122fe
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Jul 21 06:01:10 2020 +0000

description:
Support "boot -1" to start an MP kernel in uniprocessor mode.
Sort sys/* includes while here.

diffstat:

 sys/arch/mips/cavium/octeon_cpunode.c |  13 ++++++++++---
 sys/arch/mips/mips/cpu_subr.c         |  22 +++++++++++++---------
 2 files changed, 23 insertions(+), 12 deletions(-)

diffs (95 lines):

diff -r 74ff739ffdf8 -r 43b87e5122fe sys/arch/mips/cavium/octeon_cpunode.c
--- a/sys/arch/mips/cavium/octeon_cpunode.c     Tue Jul 21 05:45:38 2020 +0000
+++ b/sys/arch/mips/cavium/octeon_cpunode.c     Tue Jul 21 06:01:10 2020 +0000
@@ -29,7 +29,7 @@
 #define __INTR_PRIVATE
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: octeon_cpunode.c,v 1.15 2020/07/19 08:58:35 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_cpunode.c,v 1.16 2020/07/21 06:01:10 simonb Exp $");
 
 #include "locators.h"
 #include "cpunode.h"
@@ -37,10 +37,11 @@
 #include "opt_ddb.h"
 
 #include <sys/param.h>
+#include <sys/atomic.h>
+#include <sys/cpu.h>
 #include <sys/device.h>
 #include <sys/lwp.h>
-#include <sys/cpu.h>
-#include <sys/atomic.h>
+#include <sys/reboot.h>
 #include <sys/wdog.h>
 
 #include <uvm/uvm.h>
@@ -294,6 +295,12 @@
                return;
        }
 #ifdef MULTIPROCESSOR
+       if ((boothowto & RB_MD1) != 0) {
+               aprint_naive("\n");
+               aprint_normal(": multiprocessor boot disabled\n");
+               return;
+       }
+
        if (!kcpuset_isset(cpus_booted, cpunum)) {
                aprint_naive(" disabled\n");
                aprint_normal(" disabled (unresponsive)\n");
diff -r 74ff739ffdf8 -r 43b87e5122fe sys/arch/mips/mips/cpu_subr.c
--- a/sys/arch/mips/mips/cpu_subr.c     Tue Jul 21 05:45:38 2020 +0000
+++ b/sys/arch/mips/mips/cpu_subr.c     Tue Jul 21 06:01:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_subr.c,v 1.55 2020/07/20 14:59:57 jmcneill Exp $   */
+/*     $NetBSD: cpu_subr.c,v 1.56 2020/07/21 06:01:10 simonb Exp $     */
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.55 2020/07/20 14:59:57 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.56 2020/07/21 06:01:10 simonb Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -38,19 +38,20 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/param.h>
+#include <sys/atomic.h>
+#include <sys/bitops.h>
 #include <sys/cpu.h>
+#include <sys/device.h>
+#include <sys/idle.h>
 #include <sys/intr.h>
-#include <sys/atomic.h>
-#include <sys/device.h>
+#include <sys/ipi.h>
+#include <sys/kernel.h>
 #include <sys/lwp.h>
+#include <sys/module.h>
 #include <sys/proc.h>
 #include <sys/ras.h>
-#include <sys/module.h>
-#include <sys/bitops.h>
-#include <sys/idle.h>
+#include <sys/reboot.h>
 #include <sys/xcall.h>
-#include <sys/kernel.h>
-#include <sys/ipi.h>
 
 #include <uvm/uvm.h>
 
@@ -973,6 +974,9 @@
        CPU_INFO_ITERATOR cii;
        struct cpu_info *ci;
 
+       if ((boothowto & RB_MD1) != 0)
+               return;
+
        for (CPU_INFO_FOREACH(cii, ci)) {
                if (CPU_IS_PRIMARY(ci))
                        continue;



Home | Main Index | Thread Index | Old Index