Merge branches 'acpi-numa', 'acpi-tables' and 'acpi-osi'
[linux-2.6-block.git] / drivers / acpi / osl.c
index 0155f8b8a79aebd875160ea8a3eb870e14f88acb..b108f1358a32b54931cbf9640410851ab7f736c1 100644 (file)
@@ -92,72 +92,6 @@ struct acpi_ioremap {
 static LIST_HEAD(acpi_ioremaps);
 static DEFINE_MUTEX(acpi_ioremap_lock);
 
-static void __init acpi_osi_setup_late(void);
-
-/*
- * The story of _OSI(Linux)
- *
- * From pre-history through Linux-2.6.22,
- * Linux responded TRUE upon a BIOS OSI(Linux) query.
- *
- * Unfortunately, reference BIOS writers got wind of this
- * and put OSI(Linux) in their example code, quickly exposing
- * this string as ill-conceived and opening the door to
- * an un-bounded number of BIOS incompatibilities.
- *
- * For example, OSI(Linux) was used on resume to re-POST a
- * video card on one system, because Linux at that time
- * could not do a speedy restore in its native driver.
- * But then upon gaining quick native restore capability,
- * Linux has no way to tell the BIOS to skip the time-consuming
- * POST -- putting Linux at a permanent performance disadvantage.
- * On another system, the BIOS writer used OSI(Linux)
- * to infer native OS support for IPMI!  On other systems,
- * OSI(Linux) simply got in the way of Linux claiming to
- * be compatible with other operating systems, exposing
- * BIOS issues such as skipped device initialization.
- *
- * So "Linux" turned out to be a really poor chose of
- * OSI string, and from Linux-2.6.23 onward we respond FALSE.
- *
- * BIOS writers should NOT query _OSI(Linux) on future systems.
- * Linux will complain on the console when it sees it, and return FALSE.
- * To get Linux to return TRUE for your system  will require
- * a kernel source update to add a DMI entry,
- * or boot with "acpi_osi=Linux"
- */
-
-static struct osi_linux {
-       unsigned int    enable:1;
-       unsigned int    dmi:1;
-       unsigned int    cmdline:1;
-       unsigned int    default_disabling:1;
-} osi_linux = {0, 0, 0, 0};
-
-static u32 acpi_osi_handler(acpi_string interface, u32 supported)
-{
-       if (!strcmp("Linux", interface)) {
-
-               printk_once(KERN_NOTICE FW_BUG PREFIX
-                       "BIOS _OSI(Linux) query %s%s\n",
-                       osi_linux.enable ? "honored" : "ignored",
-                       osi_linux.cmdline ? " via cmdline" :
-                       osi_linux.dmi ? " via DMI" : "");
-       }
-
-       if (!strcmp("Darwin", interface)) {
-               /*
-                * Apple firmware will behave poorly if it receives positive
-                * answers to "Darwin" and any other OS. Respond positively
-                * to Darwin and then disable all other vendor strings.
-                */
-               acpi_update_interfaces(ACPI_DISABLE_ALL_VENDOR_STRINGS);
-               supported = ACPI_UINT32_MAX;
-       }
-
-       return supported;
-}
-
 static void __init acpi_request_region (struct acpi_generic_address *gas,
        unsigned int length, char *desc)
 {
@@ -578,7 +512,7 @@ static char acpi_os_name[ACPI_MAX_OVERRIDE_LEN];
 
 acpi_status
 acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
-                           char **new_val)
+                           acpi_string *new_val)
 {
        if (!init_val || !new_val)
                return AE_BAD_PARAMETER;
@@ -1439,156 +1373,6 @@ static int __init acpi_os_name_setup(char *str)
 
 __setup("acpi_os_name=", acpi_os_name_setup);
 
-#define        OSI_STRING_LENGTH_MAX 64        /* arbitrary */
-#define        OSI_STRING_ENTRIES_MAX 16       /* arbitrary */
-
-struct osi_setup_entry {
-       char string[OSI_STRING_LENGTH_MAX];
-       bool enable;
-};
-
-static struct osi_setup_entry
-               osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = {
-       {"Module Device", true},
-       {"Processor Device", true},
-       {"3.0 _SCP Extensions", true},
-       {"Processor Aggregator Device", true},
-};
-
-void __init acpi_osi_setup(char *str)
-{
-       struct osi_setup_entry *osi;
-       bool enable = true;
-       int i;
-
-       if (!acpi_gbl_create_osi_method)
-               return;
-
-       if (str == NULL || *str == '\0') {
-               printk(KERN_INFO PREFIX "_OSI method disabled\n");
-               acpi_gbl_create_osi_method = FALSE;
-               return;
-       }
-
-       if (*str == '!') {
-               str++;
-               if (*str == '\0') {
-                       osi_linux.default_disabling = 1;
-                       return;
-               } else if (*str == '*') {
-                       acpi_update_interfaces(ACPI_DISABLE_ALL_STRINGS);
-                       for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
-                               osi = &osi_setup_entries[i];
-                               osi->enable = false;
-                       }
-                       return;
-               }
-               enable = false;
-       }
-
-       for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
-               osi = &osi_setup_entries[i];
-               if (!strcmp(osi->string, str)) {
-                       osi->enable = enable;
-                       break;
-               } else if (osi->string[0] == '\0') {
-                       osi->enable = enable;
-                       strncpy(osi->string, str, OSI_STRING_LENGTH_MAX);
-                       break;
-               }
-       }
-}
-
-static void __init set_osi_linux(unsigned int enable)
-{
-       if (osi_linux.enable != enable)
-               osi_linux.enable = enable;
-
-       if (osi_linux.enable)
-               acpi_osi_setup("Linux");
-       else
-               acpi_osi_setup("!Linux");
-
-       return;
-}
-
-static void __init acpi_cmdline_osi_linux(unsigned int enable)
-{
-       osi_linux.cmdline = 1;  /* cmdline set the default and override DMI */
-       osi_linux.dmi = 0;
-       set_osi_linux(enable);
-
-       return;
-}
-
-void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
-{
-       printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
-
-       if (enable == -1)
-               return;
-
-       osi_linux.dmi = 1;      /* DMI knows that this box asks OSI(Linux) */
-       set_osi_linux(enable);
-
-       return;
-}
-
-/*
- * Modify the list of "OS Interfaces" reported to BIOS via _OSI
- *
- * empty string disables _OSI
- * string starting with '!' disables that string
- * otherwise string is added to list, augmenting built-in strings
- */
-static void __init acpi_osi_setup_late(void)
-{
-       struct osi_setup_entry *osi;
-       char *str;
-       int i;
-       acpi_status status;
-
-       if (osi_linux.default_disabling) {
-               status = acpi_update_interfaces(ACPI_DISABLE_ALL_VENDOR_STRINGS);
-
-               if (ACPI_SUCCESS(status))
-                       printk(KERN_INFO PREFIX "Disabled all _OSI OS vendors\n");
-       }
-
-       for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
-               osi = &osi_setup_entries[i];
-               str = osi->string;
-
-               if (*str == '\0')
-                       break;
-               if (osi->enable) {
-                       status = acpi_install_interface(str);
-
-                       if (ACPI_SUCCESS(status))
-                               printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
-               } else {
-                       status = acpi_remove_interface(str);
-
-                       if (ACPI_SUCCESS(status))
-                               printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
-               }
-       }
-}
-
-static int __init osi_setup(char *str)
-{
-       if (str && !strcmp("Linux", str))
-               acpi_cmdline_osi_linux(1);
-       else if (str && !strcmp("!Linux", str))
-               acpi_cmdline_osi_linux(0);
-       else
-               acpi_osi_setup(str);
-
-       return 1;
-}
-
-__setup("acpi_osi=", osi_setup);
-
 /*
  * Disable the auto-serialization of named objects creation methods.
  *
@@ -1708,12 +1492,6 @@ int acpi_resources_are_enforced(void)
 }
 EXPORT_SYMBOL(acpi_resources_are_enforced);
 
-bool acpi_osi_is_win8(void)
-{
-       return acpi_gbl_osi_data >= ACPI_OSI_WIN_8;
-}
-EXPORT_SYMBOL(acpi_osi_is_win8);
-
 /*
  * Deallocate the memory for a spinlock.
  */
@@ -1879,8 +1657,7 @@ acpi_status __init acpi_os_initialize1(void)
        BUG_ON(!kacpid_wq);
        BUG_ON(!kacpi_notify_wq);
        BUG_ON(!kacpi_hotplug_wq);
-       acpi_install_interface_handler(acpi_osi_handler);
-       acpi_osi_setup_late();
+       acpi_osi_init();
        return AE_OK;
 }