Commit ae00d812 authored by Len Brown's avatar Len Brown

ACPI: extend "acpi_osi=" boot option

The boot option "acpi_osi=" has always disabled Linux _OSI support,
thus disabling all OS Interface strings which are advertised
by Linux to the BIOS.

Now...
acpi_osi="string" adds the interface string, and
acpi_osi="!string" invalidates the pre-defined interface string

eg. acpi_osi="!Windows 2006"
would disable Linux's claim of Vista compatibility.
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c420bc9f
...@@ -170,7 +170,10 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -170,7 +170,10 @@ and is between 256 and 4096 characters. It is defined in the file
acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
Format: To spoof as Windows 98: ="Microsoft Windows" Format: To spoof as Windows 98: ="Microsoft Windows"
acpi_osi= [HW,ACPI] empty param disables _OSI acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
acpi_osi="string1" # add string1 -- only one string
acpi_osi="!string2" # remove built-in string2
acpi_osi= # disable all strings
acpi_serialize [HW,ACPI] force serialization of AML methods acpi_serialize [HW,ACPI] force serialization of AML methods
......
...@@ -73,6 +73,9 @@ static void *acpi_irq_context; ...@@ -73,6 +73,9 @@ static void *acpi_irq_context;
static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpid_wq;
static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_notify_wq;
#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
static char osi_additional_string[OSI_STRING_LENGTH_MAX];
static void __init acpi_request_region (struct acpi_generic_address *addr, static void __init acpi_request_region (struct acpi_generic_address *addr,
unsigned int length, char *desc) unsigned int length, char *desc)
{ {
...@@ -961,19 +964,23 @@ static int __init acpi_os_name_setup(char *str) ...@@ -961,19 +964,23 @@ static int __init acpi_os_name_setup(char *str)
__setup("acpi_os_name=", acpi_os_name_setup); __setup("acpi_os_name=", acpi_os_name_setup);
/* /*
* _OSI control * Modify the list of "OS Interfaces" reported to BIOS via _OSI
*
* empty string disables _OSI * empty string disables _OSI
* TBD additional string adds to _OSI * string starting with '!' disables that string
* otherwise string is added to list, augmenting built-in strings
*/ */
static int __init acpi_osi_setup(char *str) static int __init acpi_osi_setup(char *str)
{ {
if (str == NULL || *str == '\0') { if (str == NULL || *str == '\0') {
printk(KERN_INFO PREFIX "_OSI method disabled\n"); printk(KERN_INFO PREFIX "_OSI method disabled\n");
acpi_gbl_create_osi_method = FALSE; acpi_gbl_create_osi_method = FALSE;
} else { } else if (*str == '!') {
/* TBD */ if (acpi_osi_invalidate(++str) == AE_OK)
printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
str); } else if (*osi_additional_string == '\0') {
strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
} }
return 1; return 1;
...@@ -1143,11 +1150,11 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) ...@@ -1143,11 +1150,11 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
acpi_status acpi_status
acpi_os_validate_interface (char *interface) acpi_os_validate_interface (char *interface)
{ {
if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
return AE_SUPPORT; return AE_OK;
return AE_SUPPORT;
} }
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: acpi_os_validate_address * FUNCTION: acpi_os_validate_address
......
...@@ -59,7 +59,7 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, ...@@ -59,7 +59,7 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
/* /*
* Strings supported by the _OSI predefined (internal) method. * Strings supported by the _OSI predefined (internal) method.
*/ */
static const char *acpi_interfaces_supported[] = { static char *acpi_interfaces_supported[] = {
/* Operating System Vendor Strings */ /* Operating System Vendor Strings */
"Linux", "Linux",
...@@ -156,6 +156,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) ...@@ -156,6 +156,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
return_ACPI_STATUS(AE_CTRL_TERMINATE); return_ACPI_STATUS(AE_CTRL_TERMINATE);
} }
/*******************************************************************************
*
* FUNCTION: acpi_osi_invalidate
*
* PARAMETERS: interface_string
*
* RETURN: Status
*
* DESCRIPTION: invalidate string in pre-defiend _OSI string list
*
******************************************************************************/
acpi_status acpi_osi_invalidate(char *interface)
{
int i;
for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) {
*acpi_interfaces_supported[i] = '\0';
return AE_OK;
}
}
return AE_NOT_FOUND;
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ut_evaluate_object * FUNCTION: acpi_ut_evaluate_object
......
...@@ -236,6 +236,7 @@ acpi_os_derive_pci_id(acpi_handle rhandle, ...@@ -236,6 +236,7 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
* Miscellaneous * Miscellaneous
*/ */
acpi_status acpi_os_validate_interface(char *interface); acpi_status acpi_os_validate_interface(char *interface);
acpi_status acpi_osi_invalidate(char* interface);
acpi_status acpi_status
acpi_os_validate_address(u8 space_id, acpi_os_validate_address(u8 space_id,
......
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