Use local APIC id to determine boot CPU.

Fixes PR kern/20690 from Jaromir Dolecek.  Fix from fvdl.
This commit is contained in:
simonb 2003-07-22 12:10:20 +00:00
parent 4754215738
commit ea8d25e941
1 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpacpi.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */
/* $NetBSD: mpacpi.c,v 1.8 2003/07/22 12:10:20 simonb Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.7 2003/07/14 22:32:40 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.8 2003/07/22 12:10:20 simonb Exp $");
#include "opt_acpi.h"
#include "opt_mpbios.h"
@ -290,12 +290,7 @@ mpacpi_config_cpu(APIC_HEADER *hdrp, void *aux)
if (hdrp->Type == APIC_PROC) {
p = (PROCESSOR_APIC *)hdrp;
if (p->ProcessorEnabled) {
/*
* Assume ACPI Id 0 == BSP.
* XXX check if that's correct.
* XXX field name in structure is wrong.
*/
if (p->ProcessorApicId == 0)
if (p->LocalApicId == lapic_cpu_number())
caa.cpu_role = CPU_ROLE_BP;
else
caa.cpu_role = CPU_ROLE_AP;