diff options
author | peter <peter@FreeBSD.org> | 1997-04-26 11:46:25 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-04-26 11:46:25 +0000 |
commit | 6323aa10bffe459912ba8b2f8592c7ac4ffd8705 (patch) | |
tree | bf48960e09e26f0de373de093c89322724bbdd64 /sys/kern/kern_shutdown.c | |
parent | 96efe480c0c091aecb2f359675c74aca30f36a4a (diff) | |
download | FreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.zip FreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.tar.gz |
Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to
come over the next few days.
The kernel should run pretty much "as before" without the options to
activate SMP mode.
There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.
This commit is the result of the tinkering and testing over the last 14
months by many people. A special thanks to Steve Passe for implementing
the APIC code!
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index c4922d0..e445959 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 - * $Id$ + * $Id: kern_shutdown.c,v 1.13 1997/02/22 09:39:10 peter Exp $ */ #include "opt_ddb.h" @@ -166,6 +166,27 @@ boot(howto) { sle_p ep; +#ifdef SMP + int c, spins; + + /* don't accidently start it */ + if (smp_active) { + smp_active = 1; + + spins = 100; + + printf("boot() called on cpu#%d\n", cpunumber()); + while ((c = cpunumber()) != 0) { + if (spins-- < 1) { + printf("timeout waiting for cpu #0!\n"); + break; + } + printf("oops, I'm on cpu#%d, I need to be on cpu#0!\n", + c); + tsleep((caddr_t)&smp_active, PZERO, "cpu0wt", 10); + } + } +#endif ep = shutdown_list1; while (ep) { shutdown_list1 = ep->next; @@ -355,7 +376,11 @@ panic(const char *fmt, ...) else panicstr = fmt; +#ifdef SMP + printf("panic (cpu#%d): ", cpunumber()); +#else printf("panic: "); +#endif va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); |