]> xenbits.xensource.com Git - seabios.git/commitdiff
Read APIC version from APIC instead of using a hard-coded value.
authorMagnus Christensson <mch@virtutech.com>
Mon, 23 Nov 2009 13:01:19 +0000 (14:01 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 18 Jan 2010 05:26:25 +0000 (00:26 -0500)
Signed-off-by: Magnus Christensson <mch@virtutech.com>
src/mptable.c

index f65bbebd08703971f081b5d1c0a29bdb835c5f66..5357c032309b570091f06154cfa7bc7e6e108317 100644 (file)
@@ -36,6 +36,7 @@ mptable_init(void)
     // Detect cpu info
     u32 cpuid_signature, ebx, ecx, cpuid_features;
     cpuid(1, &cpuid_signature, &ebx, &ecx, &cpuid_features);
+    u8 apic_version = readl((u8*)BUILD_APIC_ADDR + 0x30) & 0xff;
     int pkgcpus = 1;
     if (cpuid_features & (1 << 28)) {
         /* Only populate the MPS tables with the first logical CPU in
@@ -51,7 +52,7 @@ mptable_init(void)
         memset(cpu, 0, sizeof(*cpu));
         cpu->type = MPT_TYPE_CPU;
         cpu->apicid = i;
-        cpu->apicver = 0x11;
+        cpu->apicver = apic_version;
         /* cpu flags: enabled, bootstrap cpu */
         cpu->cpuflag = (i < CountCPUs) | ((i == 0) << 1);
         if (cpuid_signature) {