Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Pull osi-now into release branch

Len Brown c4d36a82 fcf75356

+142 -18
+4 -1
Documentation/kernel-parameters.txt
··· 170 170 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS 171 171 Format: To spoof as Windows 98: ="Microsoft Windows" 172 172 173 - acpi_osi= [HW,ACPI] empty param disables _OSI 173 + acpi_osi= [HW,ACPI] Modify list of supported OS interface strings 174 + acpi_osi="string1" # add string1 -- only one string 175 + acpi_osi="!string2" # remove built-in string2 176 + acpi_osi= # disable all strings 174 177 175 178 acpi_serialize [HW,ACPI] force serialization of AML methods 176 179
+108 -10
drivers/acpi/osl.c
··· 33 33 #include <linux/interrupt.h> 34 34 #include <linux/kmod.h> 35 35 #include <linux/delay.h> 36 + #include <linux/dmi.h> 36 37 #include <linux/workqueue.h> 37 38 #include <linux/nmi.h> 38 39 #include <linux/acpi.h> ··· 73 72 static void *acpi_irq_context; 74 73 static struct workqueue_struct *kacpid_wq; 75 74 static struct workqueue_struct *kacpi_notify_wq; 75 + 76 + #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ 77 + static char osi_additional_string[OSI_STRING_LENGTH_MAX]; 78 + 79 + #define OSI_LINUX_ENABLED 80 + #ifdef OSI_LINUX_ENABLED 81 + int osi_linux = 1; /* enable _OSI(Linux) by default */ 82 + #else 83 + int osi_linux; /* disable _OSI(Linux) by default */ 84 + #endif 85 + 86 + 87 + #ifdef CONFIG_DMI 88 + static struct __initdata dmi_system_id acpi_osl_dmi_table[]; 89 + #endif 76 90 77 91 static void __init acpi_request_region (struct acpi_generic_address *addr, 78 92 unsigned int length, char *desc) ··· 137 121 } 138 122 device_initcall(acpi_reserve_resources); 139 123 140 - acpi_status acpi_os_initialize(void) 124 + acpi_status __init acpi_os_initialize(void) 141 125 { 126 + dmi_check_system(acpi_osl_dmi_table); 142 127 return AE_OK; 143 128 } 144 129 ··· 977 960 978 961 __setup("acpi_os_name=", acpi_os_name_setup); 979 962 963 + static void enable_osi_linux(int enable) { 964 + 965 + if (osi_linux != enable) 966 + printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n", 967 + enable ? "En": "Dis"); 968 + 969 + osi_linux = enable; 970 + return; 971 + } 972 + 980 973 /* 981 - * _OSI control 974 + * Modify the list of "OS Interfaces" reported to BIOS via _OSI 975 + * 982 976 * empty string disables _OSI 983 - * TBD additional string adds to _OSI 977 + * string starting with '!' disables that string 978 + * otherwise string is added to list, augmenting built-in strings 984 979 */ 985 980 static int __init acpi_osi_setup(char *str) 986 981 { 987 982 if (str == NULL || *str == '\0') { 988 983 printk(KERN_INFO PREFIX "_OSI method disabled\n"); 989 984 acpi_gbl_create_osi_method = FALSE; 990 - } else { 991 - /* TBD */ 992 - printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", 993 - str); 985 + } else if (*str == '!') { 986 + if (acpi_osi_invalidate(++str) == AE_OK) 987 + printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); 988 + } else if (!strcmp("!Linux", str)) { 989 + enable_osi_linux(0); 990 + } else if (!strcmp("Linux", str)) { 991 + enable_osi_linux(1); 992 + } else if (*osi_additional_string == '\0') { 993 + strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); 994 + printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); 994 995 } 995 996 996 997 return 1; ··· 1178 1143 acpi_status 1179 1144 acpi_os_validate_interface (char *interface) 1180 1145 { 1181 - 1182 - return AE_SUPPORT; 1146 + if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) 1147 + return AE_OK; 1148 + if (!strcmp("Linux", interface)) { 1149 + printk(KERN_WARNING PREFIX 1150 + "System BIOS is requesting _OSI(Linux)\n"); 1151 + #ifdef OSI_LINUX_ENABLED 1152 + printk(KERN_WARNING PREFIX 1153 + "Please test with \"acpi_osi=!Linux\"\n" 1154 + "Please send dmidecode " 1155 + "to linux-acpi@vger.kernel.org\n"); 1156 + #else 1157 + printk(KERN_WARNING PREFIX 1158 + "If \"acpi_osi=Linux\" works better,\n" 1159 + "Please send dmidecode " 1160 + "to linux-acpi@vger.kernel.org\n"); 1161 + #endif 1162 + if(osi_linux) 1163 + return AE_OK; 1164 + } 1165 + return AE_SUPPORT; 1183 1166 } 1184 - 1185 1167 1186 1168 /****************************************************************************** 1187 1169 * ··· 1226 1174 return AE_OK; 1227 1175 } 1228 1176 1177 + #ifdef CONFIG_DMI 1178 + #ifdef OSI_LINUX_ENABLED 1179 + static int dmi_osi_not_linux(struct dmi_system_id *d) 1180 + { 1181 + printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident); 1182 + enable_osi_linux(0); 1183 + return 0; 1184 + } 1185 + #else 1186 + static int dmi_osi_linux(struct dmi_system_id *d) 1187 + { 1188 + printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident); 1189 + enable_osi_linux(1); 1190 + return 0; 1191 + } 1192 + #endif 1193 + 1194 + static struct dmi_system_id acpi_osl_dmi_table[] __initdata = { 1195 + #ifdef OSI_LINUX_ENABLED 1196 + /* 1197 + * Boxes that need NOT _OSI(Linux) 1198 + */ 1199 + { 1200 + .callback = dmi_osi_not_linux, 1201 + .ident = "Toshiba Satellite P100", 1202 + .matches = { 1203 + DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"), 1204 + DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"), 1205 + }, 1206 + }, 1207 + #else 1208 + /* 1209 + * Boxes that need _OSI(Linux) 1210 + */ 1211 + { 1212 + .callback = dmi_osi_linux, 1213 + .ident = "Intel Napa CRB", 1214 + .matches = { 1215 + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 1216 + DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"), 1217 + }, 1218 + }, 1219 + #endif 1220 + {} 1221 + }; 1222 + #endif /* CONFIG_DMI */ 1229 1223 1230 1224 #endif
+26 -2
drivers/acpi/utilities/uteval.c
··· 59 59 /* 60 60 * Strings supported by the _OSI predefined (internal) method. 61 61 */ 62 - static const char *acpi_interfaces_supported[] = { 62 + static char *acpi_interfaces_supported[] = { 63 63 /* Operating System Vendor Strings */ 64 64 65 - "Linux", 66 65 "Windows 2000", 67 66 "Windows 2001", 68 67 "Windows 2001 SP0", ··· 153 154 154 155 return_desc->integer.value = 0; 155 156 return_ACPI_STATUS(AE_CTRL_TERMINATE); 157 + } 158 + 159 + /******************************************************************************* 160 + * 161 + * FUNCTION: acpi_osi_invalidate 162 + * 163 + * PARAMETERS: interface_string 164 + * 165 + * RETURN: Status 166 + * 167 + * DESCRIPTION: invalidate string in pre-defiend _OSI string list 168 + * 169 + ******************************************************************************/ 170 + 171 + acpi_status acpi_osi_invalidate(char *interface) 172 + { 173 + int i; 174 + 175 + for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) { 176 + if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) { 177 + *acpi_interfaces_supported[i] = '\0'; 178 + return AE_OK; 179 + } 180 + } 181 + return AE_NOT_FOUND; 156 182 } 157 183 158 184 /*******************************************************************************
+1 -3
drivers/acpi/utilities/utxface.c
··· 61 61 * called, so any early initialization belongs here. 62 62 * 63 63 ******************************************************************************/ 64 - acpi_status acpi_initialize_subsystem(void) 64 + acpi_status __init acpi_initialize_subsystem(void) 65 65 { 66 66 acpi_status status; 67 67 ··· 107 107 ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); 108 108 return_ACPI_STATUS(status); 109 109 } 110 - 111 - ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem) 112 110 113 111 /******************************************************************************* 114 112 *
+2 -1
include/acpi/acpiosxf.h
··· 78 78 /* 79 79 * OSL Initialization and shutdown primitives 80 80 */ 81 - acpi_status acpi_os_initialize(void); 81 + acpi_status __initdata acpi_os_initialize(void); 82 82 83 83 acpi_status acpi_os_terminate(void); 84 84 ··· 236 236 * Miscellaneous 237 237 */ 238 238 acpi_status acpi_os_validate_interface(char *interface); 239 + acpi_status acpi_osi_invalidate(char* interface); 239 240 240 241 acpi_status 241 242 acpi_os_validate_address(u8 space_id,
+1 -1
include/acpi/acpixf.h
··· 55 55 acpi_initialize_tables(struct acpi_table_desc *initial_storage, 56 56 u32 initial_table_count, u8 allow_resize); 57 57 58 - acpi_status acpi_initialize_subsystem(void); 58 + acpi_status __init acpi_initialize_subsystem(void); 59 59 60 60 acpi_status acpi_enable_subsystem(u32 flags); 61 61