]> git.hungrycats.org Git - linux/commitdiff
[acpi] Fix compilation when CONFIG_SMP=n
authorPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 14:21:38 +0000 (07:21 -0700)
committerPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 14:21:38 +0000 (07:21 -0700)
A recent slew of ACPI "fixes" completely broke the build when one built
without SMP, IO APICs, or Local APICs.

Bad Intel, no cookie.

arch/i386/kernel/acpi/boot.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/setup.c
include/asm-i386/acpi.h
include/linux/acpi.h

index 336b2088b80813b08676becb8006fb83b8fe0d3b..3bf5e36282f44793f407b23add64657c3c77d8bc 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/config.h>
 #include <linux/acpi.h>
 #include <asm/pgalloc.h>
+#include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
 #include <asm/mpspec.h>
@@ -41,6 +42,9 @@
 extern int acpi_disabled;
 extern int acpi_ht;
 
+int acpi_lapic = 0;
+int acpi_ioapic = 0;
+
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -90,8 +94,6 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-int acpi_lapic;
-
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 
 
@@ -158,8 +160,6 @@ acpi_parse_lapic_addr_ovr (
        return 0;
 }
 
-#ifdef CONFIG_ACPI
-
 static int __init
 acpi_parse_lapic_nmi (
        acpi_table_entry_header *header)
@@ -178,15 +178,11 @@ acpi_parse_lapic_nmi (
        return 0;
 }
 
-#endif /*CONFIG_ACPI*/
 
 #endif /*CONFIG_X86_LOCAL_APIC*/
 
 #ifdef CONFIG_X86_IO_APIC
 
-int acpi_ioapic;
-
-#ifdef CONFIG_ACPI
 
 static int __init
 acpi_parse_ioapic (
@@ -248,7 +244,6 @@ acpi_parse_nmi_src (
        return 0;
 }
 
-#endif /*CONFIG_ACPI*/ 
 #endif /*CONFIG_X86_IO_APIC*/
 
 
@@ -331,14 +326,12 @@ acpi_boot_init (void)
        if (result)
                return result;
 
-#ifdef CONFIG_ACPI
        result = acpi_blacklisted();
        if (result) {
                printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
                acpi_disabled = 1;
                return result;
        }
-#endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
@@ -389,21 +382,18 @@ acpi_boot_init (void)
                return result;
        }
 
-#ifdef CONFIG_ACPI
        result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
        if (result < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return result;
        }
-#endif /*CONFIG_ACPI*/
 
        acpi_lapic = 1;
 
 #endif /*CONFIG_X86_LOCAL_APIC*/
 
 #ifdef CONFIG_X86_IO_APIC
-#ifdef CONFIG_ACPI
 
        /* 
         * I/O APIC 
@@ -423,7 +413,7 @@ acpi_boot_init (void)
        /*
         * if "noapic" boot option, don't look for IO-APICs
         */
-       if (skip_ioapic_setup) {
+       if (ioapic_setup_disabled()) {
                printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
                        "due to 'noapic' option.\n");
                return 1;
@@ -459,8 +449,6 @@ acpi_boot_init (void)
        acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
 
        acpi_ioapic = 1;
-
-#endif /*CONFIG_ACPI*/
 #endif /*CONFIG_X86_IO_APIC*/
 
 #ifdef CONFIG_X86_LOCAL_APIC
index b57846ce7dbe5cc5fb4ff1e5706fb9782416170d..bd105ba58219842d73ca86c2f3d94123ef6e259b 100644 (file)
@@ -1013,7 +1013,6 @@ void __init mp_config_acpi_legacy_irqs (void)
                        panic("Max # of irq sources exceeded!\n");
        }
 }
-#endif /* CONFIG_X86_IO_APIC */
 
 #ifdef CONFIG_ACPI
 
@@ -1150,5 +1149,5 @@ void __init mp_parse_prt (void)
 }
 
 #endif /*CONFIG_ACPI_PCI*/
-
+#endif /* CONFIG_X86_IO_APIC */
 #endif /*CONFIG_ACPI_BOOT*/
index ab2881128c3569227643e3f58b33b1dfffea2ab4..f13a8ee9f67b74b2d640fd450ff08152a7f2c9d6 100644 (file)
@@ -544,9 +544,8 @@ static void __init parse_cmdline_early (char ** cmdline_p)
                }
 
                /* disable IO-APIC */
-               else if (!memcmp(from, "noapic", 6)) {
-                       skip_ioapic_setup = 1;
-               }
+               else if (!memcmp(from, "noapic", 6))
+                       disable_ioapic_setup();
 #endif
 
                /*
@@ -1003,12 +1002,11 @@ void __init setup_arch(char **cmdline_p)
        generic_apic_probe(*cmdline_p);
 #endif 
 
-#ifdef CONFIG_ACPI_BOOT
        /*
         * Parse the ACPI tables for possible boot-time SMP configuration.
         */
-       (void) acpi_boot_init();
-#endif
+       acpi_boot_init();
+
 #ifdef CONFIG_X86_LOCAL_APIC
        if (smp_found_config)
                get_smp_config();
index 350048b1f39ee07452b8359143335c402acdedd0..6b56aa3eaa39ecfa90a9ba6821e0b2fceab3df9a 100644 (file)
         :"0"(n_hi), "1"(n_lo))
 
 
-#if defined(CONFIG_ACPI_BOOT) && defined(CONFIG_X86_LOCAL_APIC)
-       extern int acpi_lapic;
-#else
-       #define acpi_lapic 0
-#endif
+#ifdef CONFIG_ACPI_BOOT 
+extern int acpi_lapic;
+extern int acpi_ioapic;
 
-#if defined(CONFIG_ACPI_BOOT) && defined(CONFIG_X86_IO_APIC)
-       extern int acpi_ioapic;
-#else
-       #define acpi_ioapic 0
-#endif
 
-#ifdef CONFIG_ACPI_BOOT
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
+
+#ifdef CONFIG_X86_IO_APIC
+extern int skip_ioapic_setup;
+
+static inline void disable_ioapic_setup(void)
+{
+       skip_ioapic_setup = 1;
+}
+
+static inline int ioapic_setup_disabled(void)
+{
+       return skip_ioapic_setup;
+}
+
+#else
+static inline void disable_ioapic_setup(void)
+{ }
+
+#endif
+
+#else  /* CONFIG_ACPI_BOOT */
+#  define acpi_lapic 0
+#  define acpi_ioapic 0
+
 #endif
 
 #ifdef CONFIG_ACPI_SLEEP
index 3fd526160f1a704c605ba988319bc47646eafa40..94a0f27e331cf9196e4ea5f831a6eb3764fac6be 100644 (file)
@@ -373,6 +373,11 @@ extern int acpi_mp_config;
 
 #define acpi_mp_config 0
 
+static inline int acpi_boot_init(void)
+{
+       return 0;
+}
+
 #endif         /*!CONFIG_ACPI_BOOT*/
 
 
@@ -423,6 +428,13 @@ int ec_write(u8 addr, u8 val);
 
 int acpi_blacklisted(void);
 
+#else
+
+static inline int acpi_blacklisted(void)
+{
+       return 0;
+}
+
 #endif /*CONFIG_ACPI*/
 
 #endif /*_LINUX_ACPI_H*/