From: Kevin O'Connor Date: Thu, 11 Mar 2010 03:32:26 +0000 (-0500) Subject: Fix smp cpu detect on gcc 4.5. X-Git-Tag: rel-0.6.0~17 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=808939c17f603f3c7ad5abfb882cee55f636867b;p=seabios.git Fix smp cpu detect on gcc 4.5. Bruce Rogers observed new compiler optimizing away memory assign in smp detect. Add barrier() to code to ensure gcc knows the SIPI can read/write memory. --- diff --git a/src/smp.c b/src/smp.c index dac95bf..f989ec1 100644 --- a/src/smp.c +++ b/src/smp.c @@ -103,6 +103,7 @@ smp_probe(void) } // broadcast SIPI + barrier(); writel(APIC_ICR_LOW, 0x000C4500); u32 sipi_vector = BUILD_AP_BOOT_ADDR >> 12; writel(APIC_ICR_LOW, 0x000C4600 | sipi_vector); @@ -113,7 +114,7 @@ smp_probe(void) } else { u8 cmos_smp_count = inb_cmos(CMOS_BIOS_SMP_COUNT); while (cmos_smp_count + 1 != readl(&CountCPUs)) - ; + yield(); } // Restore memory.