Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hp700/dev Fixup the cpu_{match, attach} functions to...



details:   https://anonhg.NetBSD.org/src/rev/0e3349c7b5a7
branches:  trunk
changeset: 785089:0e3349c7b5a7
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Feb 21 15:16:02 2013 +0000

description:
Fixup the cpu_{match,attach} functions to not allow more that HPPA_MAXCPUs
to be used.

Fixes problem booting on a dual-cpu j6700 with GENERIC (which doesn't
define MULTIPROCESSOR) reported by KIYOHARA Takashi on port-hp700.

diffstat:

 sys/arch/hp700/dev/cpu.c |  20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 39bd17228831 -r 0e3349c7b5a7 sys/arch/hp700/dev/cpu.c
--- a/sys/arch/hp700/dev/cpu.c  Thu Feb 21 15:13:10 2013 +0000
+++ b/sys/arch/hp700/dev/cpu.c  Thu Feb 21 15:16:02 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.29 2012/10/10 15:46:34 skrll Exp $   */
+/*     $NetBSD: cpu.c,v 1.30 2013/02/21 15:16:02 skrll Exp $   */
 
 /*     $OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $   */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2012/10/10 15:46:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.30 2013/02/21 15:16:02 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -74,9 +74,6 @@
            ca->ca_type.iodc_sv_model != HPPA_NPROC_HPPA)
                return 0;
 
-       if (cf->cf_unit >= MAXCPUS)
-               return 0;
-
        return 1;
 }
 
@@ -105,10 +102,6 @@
 
        sc->sc_dev = self;
 
-       ci = &cpus[cpuno];
-       ci->ci_cpuid = cpuno;
-       ci->ci_hpa = ca->ca_hpa;
-
        /* Print the CPU chip name, nickname, and rev. */
        aprint_normal(": %s", hppa_cpu_info->hci_chip_name);
        if (hppa_cpu_info->hci_chip_nickname != NULL)
@@ -162,6 +155,15 @@
            hppa_mod_info(HPPA_TYPE_FPU, (fpu_version >> 16) & 0x1f),
            (fpu_version >> 11) & 0x1f);
 
+       if (cpuno >= HPPA_MAXCPUS) {
+               aprint_normal_dev(self, "not started\n");
+               return;
+       }
+
+       ci = &cpus[cpuno];
+       ci->ci_cpuid = cpuno;
+       ci->ci_hpa = ca->ca_hpa;
+
        hp700_intr_initialise(ci);
 
        ir = &ci->ci_ir;



Home | Main Index | Thread Index | Old Index