Commit 98256b56 authored by Patrick Mochel's avatar Patrick Mochel

[acpi] Fix compilation when CONFIG_SMP=n

A recent slew of ACPI "fixes" completely broke the build when one built 
without SMP, IO APICs, or Local APICs. 

Bad Intel, no cookie.
parent 632f2e90
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/io_apic.h>
#include <asm/apic.h> #include <asm/apic.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
...@@ -41,6 +42,9 @@ ...@@ -41,6 +42,9 @@
extern int acpi_disabled; extern int acpi_disabled;
extern int acpi_ht; extern int acpi_ht;
int acpi_lapic = 0;
int acpi_ioapic = 0;
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Boot-time Configuration Boot-time Configuration
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
...@@ -90,8 +94,6 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) ...@@ -90,8 +94,6 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
int acpi_lapic;
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
...@@ -158,8 +160,6 @@ acpi_parse_lapic_addr_ovr ( ...@@ -158,8 +160,6 @@ acpi_parse_lapic_addr_ovr (
return 0; return 0;
} }
#ifdef CONFIG_ACPI
static int __init static int __init
acpi_parse_lapic_nmi ( acpi_parse_lapic_nmi (
acpi_table_entry_header *header) acpi_table_entry_header *header)
...@@ -178,15 +178,11 @@ acpi_parse_lapic_nmi ( ...@@ -178,15 +178,11 @@ acpi_parse_lapic_nmi (
return 0; return 0;
} }
#endif /*CONFIG_ACPI*/
#endif /*CONFIG_X86_LOCAL_APIC*/ #endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
int acpi_ioapic;
#ifdef CONFIG_ACPI
static int __init static int __init
acpi_parse_ioapic ( acpi_parse_ioapic (
...@@ -248,7 +244,6 @@ acpi_parse_nmi_src ( ...@@ -248,7 +244,6 @@ acpi_parse_nmi_src (
return 0; return 0;
} }
#endif /*CONFIG_ACPI*/
#endif /*CONFIG_X86_IO_APIC*/ #endif /*CONFIG_X86_IO_APIC*/
...@@ -331,14 +326,12 @@ acpi_boot_init (void) ...@@ -331,14 +326,12 @@ acpi_boot_init (void)
if (result) if (result)
return result; return result;
#ifdef CONFIG_ACPI
result = acpi_blacklisted(); result = acpi_blacklisted();
if (result) { if (result) {
printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n"); printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
acpi_disabled = 1; acpi_disabled = 1;
return result; return result;
} }
#endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
...@@ -389,21 +382,18 @@ acpi_boot_init (void) ...@@ -389,21 +382,18 @@ acpi_boot_init (void)
return result; return result;
} }
#ifdef CONFIG_ACPI
result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi); result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
if (result < 0) { if (result < 0) {
printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
/* TBD: Cleanup to allow fallback to MPS */ /* TBD: Cleanup to allow fallback to MPS */
return result; return result;
} }
#endif /*CONFIG_ACPI*/
acpi_lapic = 1; acpi_lapic = 1;
#endif /*CONFIG_X86_LOCAL_APIC*/ #endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
#ifdef CONFIG_ACPI
/* /*
* I/O APIC * I/O APIC
...@@ -423,7 +413,7 @@ acpi_boot_init (void) ...@@ -423,7 +413,7 @@ acpi_boot_init (void)
/* /*
* if "noapic" boot option, don't look for IO-APICs * 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 " printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
"due to 'noapic' option.\n"); "due to 'noapic' option.\n");
return 1; return 1;
...@@ -459,8 +449,6 @@ acpi_boot_init (void) ...@@ -459,8 +449,6 @@ acpi_boot_init (void)
acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
acpi_ioapic = 1; acpi_ioapic = 1;
#endif /*CONFIG_ACPI*/
#endif /*CONFIG_X86_IO_APIC*/ #endif /*CONFIG_X86_IO_APIC*/
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
......
...@@ -1013,7 +1013,6 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1013,7 +1013,6 @@ void __init mp_config_acpi_legacy_irqs (void)
panic("Max # of irq sources exceeded!\n"); panic("Max # of irq sources exceeded!\n");
} }
} }
#endif /* CONFIG_X86_IO_APIC */
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
...@@ -1150,5 +1149,5 @@ void __init mp_parse_prt (void) ...@@ -1150,5 +1149,5 @@ void __init mp_parse_prt (void)
} }
#endif /*CONFIG_ACPI_PCI*/ #endif /*CONFIG_ACPI_PCI*/
#endif /* CONFIG_X86_IO_APIC */
#endif /*CONFIG_ACPI_BOOT*/ #endif /*CONFIG_ACPI_BOOT*/
...@@ -544,9 +544,8 @@ static void __init parse_cmdline_early (char ** cmdline_p) ...@@ -544,9 +544,8 @@ static void __init parse_cmdline_early (char ** cmdline_p)
} }
/* disable IO-APIC */ /* disable IO-APIC */
else if (!memcmp(from, "noapic", 6)) { else if (!memcmp(from, "noapic", 6))
skip_ioapic_setup = 1; disable_ioapic_setup();
}
#endif #endif
/* /*
...@@ -1003,12 +1002,11 @@ void __init setup_arch(char **cmdline_p) ...@@ -1003,12 +1002,11 @@ void __init setup_arch(char **cmdline_p)
generic_apic_probe(*cmdline_p); generic_apic_probe(*cmdline_p);
#endif #endif
#ifdef CONFIG_ACPI_BOOT
/* /*
* Parse the ACPI tables for possible boot-time SMP configuration. * Parse the ACPI tables for possible boot-time SMP configuration.
*/ */
(void) acpi_boot_init(); acpi_boot_init();
#endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
if (smp_found_config) if (smp_found_config)
get_smp_config(); get_smp_config();
......
...@@ -106,21 +106,37 @@ ...@@ -106,21 +106,37 @@
:"0"(n_hi), "1"(n_lo)) :"0"(n_hi), "1"(n_lo))
#if defined(CONFIG_ACPI_BOOT) && defined(CONFIG_X86_LOCAL_APIC) #ifdef CONFIG_ACPI_BOOT
extern int acpi_lapic; extern int acpi_lapic;
#else extern int acpi_ioapic;
#define acpi_lapic 0
#endif
#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) */ /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
#define FIX_ACPI_PAGES 4 #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 #endif
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
......
...@@ -373,6 +373,11 @@ extern int acpi_mp_config; ...@@ -373,6 +373,11 @@ extern int acpi_mp_config;
#define acpi_mp_config 0 #define acpi_mp_config 0
static inline int acpi_boot_init(void)
{
return 0;
}
#endif /*!CONFIG_ACPI_BOOT*/ #endif /*!CONFIG_ACPI_BOOT*/
...@@ -423,6 +428,13 @@ int ec_write(u8 addr, u8 val); ...@@ -423,6 +428,13 @@ int ec_write(u8 addr, u8 val);
int acpi_blacklisted(void); int acpi_blacklisted(void);
#else
static inline int acpi_blacklisted(void)
{
return 0;
}
#endif /*CONFIG_ACPI*/ #endif /*CONFIG_ACPI*/
#endif /*_LINUX_ACPI_H*/ #endif /*_LINUX_ACPI_H*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment