diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2015-08-19 13:14:10 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2015-08-19 13:14:10 +0000 |
commit | 855023f7b9102767bedf1c5685e109d3f4045b03 (patch) | |
tree | b3997185e068c8fca22bb9bc1fe6d88c2f352545 | |
parent | 6819929ef906887516275bfd6c88196e661a44eb (diff) |
Halt extra cores on SP kernel, to avoid trashing the system if there
is more than one active CPU. Additionally pick an init core at runtime.
This allows booting the system with a set of CPUs that does not contain
core 0, at least in terms of the early-stage boot code.
ok jasper@ (a while ago)
-rw-r--r-- | sys/arch/octeon/octeon/locore.S | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/octeon/octeon/locore.S b/sys/arch/octeon/octeon/locore.S index fe86a51a103..3c265451ae8 100644 --- a/sys/arch/octeon/octeon/locore.S +++ b/sys/arch/octeon/octeon/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.6 2014/03/13 02:17:13 yasuoka Exp $ */ +/* $OpenBSD: locore.S,v 1.7 2015/08/19 13:14:09 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -73,10 +73,11 @@ start: LA gp, _gp -#if defined(MULTIPROCESSOR) - rdhwr t2, $0 - beqz t2, 2f + /* Let the init core continue. The others have to wait. */ + bne a2, zero, 2f nop +#if defined(MULTIPROCESSOR) + rdhwr t2, $0 1: ll t0, cpu_spinup_mask bne t2, t0, 1b nop @@ -86,8 +87,13 @@ start: nop j hw_cpu_spinup_trampoline nop -2: +#else + /* Halt extra cores on single-processor kernel. */ +1: wait + j 1b + nop #endif +2: /* * Initialize stack and call machine startup. */ |