Module Name: src
Committed By: snj
Date: Wed Sep 16 04:12:49 UTC 2009
Modified Files:
src/sys/arch/alpha/alpha [netbsd-5]: cpu.c
Log Message:
Pull up following revision(s) (requested by mhitch in ticket #949):
sys/arch/alpha/alpha/cpu.c: revision 1.86
There's now some per-cpu initialization that occurs before the secondary
cpus are told to begin running. Since the seconedary cpus weren't being
added to the cpu_info list until then, that initialization wasn't being
done and resulted in crashes on the secondary cpus. Add the secondary
cpus to the cpu_info_list after they've been started (but waiting to be
told to start running). This fixes the problem specifically stated in
PR port-alpha/41106. MP alphas will now at least boot and begin running,
but will eventually crash in various ways later.
To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.82.10.1 src/sys/arch/alpha/alpha/cpu.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/alpha/alpha/cpu.c
diff -u src/sys/arch/alpha/alpha/cpu.c:1.82 src/sys/arch/alpha/alpha/cpu.c:1.82.10.1
--- src/sys/arch/alpha/alpha/cpu.c:1.82 Mon Apr 28 20:23:10 2008
+++ src/sys/arch/alpha/alpha/cpu.c Wed Sep 16 04:12:48 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.82 2008/04/28 20:23:10 martin Exp $ */
+/* $NetBSD: cpu.c,v 1.82.10.1 2009/09/16 04:12:48 snj Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.82 2008/04/28 20:23:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.82.10.1 2009/09/16 04:12:48 snj Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -337,6 +337,12 @@
* on its merry way.
*/
cpu_boot_secondary(ci);
+
+ /*
+ * Link the processor into the list.
+ */
+ ci->ci_next = cpu_info_list->ci_next;
+ cpu_info_list->ci_next = ci;
#else /* ! MULTIPROCESSOR */
printf("%s: processor off-line; multiprocessor support "
"not present in kernel\n", sc->sc_dev.dv_xname);
@@ -408,10 +414,8 @@
}
/*
- * Link the processor into the list, and launch it.
+ * Launch the processor.
*/
- ci->ci_next = cpu_info_list->ci_next;
- cpu_info_list->ci_next = ci;
atomic_or_ulong(&ci->ci_flags, CPUF_RUNNING);
atomic_or_ulong(&cpus_running, (1U << i));
}