]> git.hungrycats.org Git - linux/commitdiff
[ACPI] create disable_acpi()
authorLen Brown <len.brown@intel.com>
Sat, 20 Mar 2004 19:23:27 +0000 (14:23 -0500)
committerLen Brown <lenb@dhcppc3.>
Sat, 20 Mar 2004 19:23:27 +0000 (14:23 -0500)
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/dmi_scan.c
arch/i386/kernel/setup.c
arch/ia64/kernel/acpi.c
drivers/acpi/bus.c
drivers/char/sonypi.h
include/acpi/acpi_bus.h
include/asm-i386/acpi.h
include/asm-ia64/acpi.h
include/asm-x86_64/acpi.h

index b9c724c8584ca9bed042f8736f4c705f9efce87c..40786de6a2e606356ac4ce5e16d3fbb4e6063eb6 100644 (file)
@@ -668,7 +668,7 @@ acpi_boot_init (void)
         */
        error = acpi_table_init();
        if (error) {
-               acpi_disabled = 1;
+               disable_acpi();
                return error;
        }
 
@@ -680,7 +680,7 @@ acpi_boot_init (void)
        error = acpi_blacklisted();
        if (error) {
                printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
-               acpi_disabled = 1;
+               disable_acpi();
                return error;
        }
 
index 1dedf33e2f1b0602bf7fd85889cb001c7a740fdf..47f7f6fb938d9bf9d9358dfcff253a49e8f4dbed 100644 (file)
@@ -523,13 +523,13 @@ static __init int print_if_true(struct dmi_blacklist *d)
 
 
 #ifdef CONFIG_ACPI_BOOT
-extern int acpi_disabled, acpi_force;
+extern int acpi_force;
 
-static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) 
+static __init __attribute__((unused)) int dmi_disable_acpi(struct dmi_blacklist *d) 
 { 
        if (!acpi_force) { 
                printk(KERN_NOTICE "%s detected: acpi off\n",d->ident); 
-               acpi_disabled = 1;
+               disable_acpi();
        } else { 
                printk(KERN_NOTICE 
                       "Warning: DMI blacklist says broken, but acpi forced\n"); 
@@ -537,8 +537,6 @@ static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d)
        return 0;
 } 
 
-extern int acpi_ht;
-
 /*
  * Limit ACPI to CPU enumeration for HT
  */
@@ -546,7 +544,7 @@ static __init __attribute__((unused)) int force_acpi_ht(struct dmi_blacklist *d)
 { 
        if (!acpi_force) { 
                printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident); 
-               acpi_disabled = 1; 
+               disable_acpi();
                acpi_ht = 1; 
        } else { 
                printk(KERN_NOTICE 
@@ -933,7 +931,7 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
         *      Boxes that need ACPI disabled
         */
 
-       { acpi_disable, "IBM Thinkpad", {
+       { dmi_disable_acpi, "IBM Thinkpad", {
                        MATCH(DMI_BOARD_VENDOR, "IBM"),
                        MATCH(DMI_BOARD_NAME, "2629H1G"),
                        NO_MATCH, NO_MATCH }},
@@ -1063,8 +1061,7 @@ static __init void dmi_check_blacklist(void)
                        if (disable && !acpi_force) { 
                                printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
                                printk(KERN_NOTICE "You can enable it with acpi=force\n");
-                               acpi_disabled = 1; 
-                               acpi_ht = 0;
+                               disable_acpi();
                        } 
                }
        }
index d59ef5abc5e7f99159b86926f204a5ce7aadf600..b229585170eef906087c1bd400cd2917c10ecf74 100644 (file)
@@ -78,7 +78,6 @@ EXPORT_SYMBOL_GPL(mmu_cr4_features);
 EXPORT_SYMBOL(acpi_disabled);
 
 #ifdef CONFIG_ACPI_BOOT
-extern int __initdata acpi_ht;
 int __initdata acpi_force = 0;
 #endif
 
@@ -570,14 +569,13 @@ static void __init parse_cmdline_early (char ** cmdline_p)
 #ifdef CONFIG_ACPI_BOOT
                /* "acpi=off" disables both ACPI table parsing and interpreter */
                else if (!memcmp(from, "acpi=off", 8)) {
-                       acpi_ht = 0;
-                       acpi_disabled = 1;
+                       disable_acpi();
                }
 
                /* acpi=force to over-ride black-list */
                else if (!memcmp(from, "acpi=force", 10)) {
                        acpi_force = 1;
-                       acpi_ht=1;
+                       acpi_ht = 1;
                        acpi_disabled = 0;
                }
 
@@ -588,8 +586,9 @@ static void __init parse_cmdline_early (char ** cmdline_p)
 
                /* Limit ACPI just to boot-time to enable HT */
                else if (!memcmp(from, "acpi=ht", 7)) {
+                       if (!acpi_force)
+                               disable_acpi();
                        acpi_ht = 1;
-                       if (!acpi_force) acpi_disabled = 1;
                }
 
                /* "pci=noacpi" disables ACPI interrupt routing */
index 0d7bac913de4d60bff453c15965864f5a59d3d40..97747e6422451f507fc05ac0aa3df6c9e1d39eb5 100644 (file)
@@ -62,8 +62,6 @@ void (*pm_power_off) (void);
 unsigned char acpi_kbd_controller_present = 1;
 unsigned char acpi_legacy_devices;
 
-int acpi_disabled;     /* XXX this shouldn't be needed---we can't boot without ACPI! */
-
 const char *
 acpi_get_sysname (void)
 {
index 92d271af01c2c0da757b8c7a4d052d19e362e015..fb1a5efe7755f6a0e5f05c21a3aa1a1b4d9a21b5 100644 (file)
@@ -704,29 +704,14 @@ static int __init acpi_init (void)
                        pm_active = 1;
                else {
                        printk(KERN_INFO PREFIX "APM is already active, exiting\n");
-                       acpi_disabled = 1;
+                       disable_acpi();
                        result = -ENODEV;
                }
 #endif
        } else
-               acpi_disabled = 1;
+               disable_acpi();
 
        return_VALUE(result);
 }
 
-
-static int __init acpi_setup(char *str)
-{
-       while (str && *str) {
-               if (strncmp(str, "off", 3) == 0)
-                       acpi_disabled = 1;
-               str = strchr(str, ',');
-               if (str)
-                       str += strspn(str, ", \t");
-       }
-       return 1;
-}
-
 subsys_initcall(acpi_init);
-
-__setup("acpi=", acpi_setup);
index 78b56129e4f0e4bb8098a23d1b3f305501c5f64e..eef5852c07dbcc24253b79286a2481e364f86b09 100644 (file)
@@ -396,7 +396,6 @@ struct sonypi_device {
 }
 
 #ifdef CONFIG_ACPI
-extern int acpi_disabled;
 #define SONYPI_ACPI_ACTIVE (!acpi_disabled)
 #else
 #define SONYPI_ACPI_ACTIVE 0
index 82d1fce42e5ec9eba1a089ab0687c16492284be8..af33ae5a29afb62d350a3a944b3ea22e142b10e9 100644 (file)
@@ -32,8 +32,6 @@
 
 #define PREFIX                 "ACPI: "
 
-extern int                     acpi_disabled;
-
 /* TBD: Make dynamic */
 #define ACPI_MAX_HANDLES       10
 struct acpi_handle_list {
index 5fded776d968f2898d6229d7ac3a855550c02fc5..5b4585cfd129f9aef6d9c320b28548692cef91d2 100644 (file)
@@ -116,6 +116,9 @@ extern int acpi_lapic;
 extern int acpi_ioapic;
 extern int acpi_noirq;
 extern int acpi_strict;
+extern int acpi_disabled;
+extern int acpi_ht;
+static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; }
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
index fd1b5061d72526d8e5acedd5f5a3e6cb40a06017..5ef935e11be56430864d99cd533a1cf66e5bcc4b 100644 (file)
@@ -88,7 +88,9 @@ ia64_acpi_release_global_lock (unsigned int *lock)
 #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)                           \
        ((Acq) = ia64_acpi_release_global_lock((unsigned int *) GLptr))
 
+#define acpi_disabled 0        /* ACPI always enabled on IA64 */
 #define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
+static inline void disable_acpi(void) { }
 
 const char *acpi_get_sysname (void);
 int acpi_request_vector (u32 int_type);
index ed854328680cfa0fba4ea772480f0a5738a057ae..78e3fcf4b756e7223d19deca2f3e85abdb485b42 100644 (file)
@@ -105,6 +105,9 @@ extern int acpi_lapic;
 extern int acpi_ioapic;
 extern int acpi_noirq;
 extern int acpi_strict;
+extern int acpi_disabled;
+extern int acpi_ht;
+static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; }
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4