Initialize curthread before we save the APs MCA state. Saving the

MCA state requires a spin lock, which requires a valid curthread.
This change allows SMP kernels to boot into multi-user again.

While here, update the copyright notice and use __FBSDID for the
revision string.
This commit is contained in:
Marcel Moolenaar 2005-04-15 00:21:23 +00:00
parent 76b5c0aa50
commit 64c92ba929
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145092

View File

@ -1,4 +1,5 @@
/*-
* Copyright (c) 2001-2005 Marcel Moolenaar
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
*
@ -22,10 +23,11 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_kstack_pages.h"
#include <sys/param.h>
@ -104,6 +106,10 @@ ia64_ap_startup(void)
__asm __volatile("ssm psr.i;; srlz.d;;");
/* Initialize curthread. */
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
PCPU_SET(curthread, PCPU_GET(idlethread));
/*
* Get and save the CPU specific MCA records. Should we get the
* MCA state for each processor, or just the CMC state?
@ -111,10 +117,6 @@ ia64_ap_startup(void)
ia64_mca_save_state(SAL_INFO_MCA);
ia64_mca_save_state(SAL_INFO_CMC);
/* Initialize curthread. */
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
PCPU_SET(curthread, PCPU_GET(idlethread));
ap_awake++;
while (!smp_started)
/* spin */;