From 5ab87a6c387c591c4a1386fa706b6ca79c4a66a9 Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Thu, 29 Mar 2012 00:53:38 -0700 Subject: [PATCH] ioapic - missing volatiles leads to a kernel panic when using clang and SMP reported by trd --- kernel/arch/i386/apic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index cdb601e4a..69f7c4d94 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -178,14 +178,14 @@ static u32_t lapic_bus_freq[CONFIG_MAX_CPUS]; static u32_t ioapic_read(u32_t ioa_base, u32_t reg) { - *((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff); - return *(u32_t *)(ioa_base + IOAPIC_IOWIN); + *((volatile u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff); + return *(volatile u32_t *)(ioa_base + IOAPIC_IOWIN); } static void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val) { - *((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = reg; - *((u32_t *)(ioa_base + IOAPIC_IOWIN)) = val; + *((volatile u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = reg; + *((volatile u32_t *)(ioa_base + IOAPIC_IOWIN)) = val; } void lapic_microsec_sleep(unsigned count); -- 2.44.0