Remove cmos access from cpu detect loop to make it faster.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 10 Nov 2009 00:21:44 +0000 (19:21 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 10 Nov 2009 00:21:44 +0000 (19:21 -0500)
Signed-off-by: Magnus Christensson <mch@virtutech.com>
src/smp.c

index a912857eab6e57f17ef2df5e0a673574786dfcbc..71b0da8ce39994759877ebdb2f206957f0f73538 100644 (file)
--- a/src/smp.c
+++ b/src/smp.c
@@ -97,11 +97,13 @@ smp_probe(void)
     writel(APIC_ICR_LOW, 0x000C4600 | sipi_vector);
 
     // Wait for other CPUs to process the SIPI.
-    if (CONFIG_COREBOOT)
+    if (CONFIG_COREBOOT) {
         msleep(10);
-    else
-        while (inb_cmos(CMOS_BIOS_SMP_COUNT) + 1 != readl(&CountCPUs))
-            ;
+    } else {
+        u8 cmos_smp_count = inb_cmos(CMOS_BIOS_SMP_COUNT);
+        while (cmos_smp_count + 1 != readl(&CountCPUs))
+             ;
+    }
 
     // Restore memory.
     *(u64*)BUILD_AP_BOOT_ADDR = old;