summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-12-13 15:09:40 +0000
committerjhb <jhb@FreeBSD.org>2005-12-13 15:09:40 +0000
commit76cd6764a47666f310f54363214c051d6bcc6672 (patch)
tree0a0c1a423ce0603c9556d0d11d0fb32bb54ea3a1 /sys/i386
parent54f6e603e2a06ac3e0ca4919af83a0cc72ef99c1 (diff)
downloadFreeBSD-src-76cd6764a47666f310f54363214c051d6bcc6672.zip
FreeBSD-src-76cd6764a47666f310f54363214c051d6bcc6672.tar.gz
Don't check the CPUID_APIC bit in the cpu_features flags field to determine
if the boot CPU has a local APIC because some BIOS vendors are not competent enough to set this bit. Instead, just assume that we always have a local APIC on amd64. For i386 the check is a bit more subtle. FreeBSD requires either an MP Table or an ACPI MADT table to enumerate APICs. The only systems that have one of those tables that don't have local APICs are some presumably rare (and old) SMP 486 systems using external APICs. Thus, instead of checking the CPUID_APIC flag, check the CPU class and abort if we are running on a 486. MFC after: 1 week Reported by: bz
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/local_apic.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/i386/i386/local_apic.c b/sys/i386/i386/local_apic.c
index f2d96b5..53ebc0a 100644
--- a/sys/i386/i386/local_apic.c
+++ b/sys/i386/i386/local_apic.c
@@ -834,8 +834,15 @@ apic_init(void *dummy __unused)
uint64_t apic_base;
int retval, best;
- /* We only support built in local APICs. */
- if (!(cpu_feature & CPUID_APIC))
+ /*
+ * We only support built in local APICs. Unfortunately, we can't
+ * just check the CPUID_APIC bit in cpu_features because some BIOSen
+ * don't set that flag. Instead, we assume that all Pentium-class
+ * and later machines have a local APIC. The only non-Pentium-class
+ * CPUs that can talk to an external APIC are 486s, so we just
+ * bail if we are on a 486.
+ */
+ if (cpu_class == CPUCLASS_486)
return;
/* Don't probe if APIC mode is disabled. */
OpenPOWER on IntegriCloud