diff options
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 6729a4992f2b..d1dd5160daa9 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -228,10 +228,10 @@ void acpi_os_vprintf(const char *fmt, va_list args) | |||
228 | if (acpi_in_debugger) { | 228 | if (acpi_in_debugger) { |
229 | kdb_printf("%s", buffer); | 229 | kdb_printf("%s", buffer); |
230 | } else { | 230 | } else { |
231 | printk("%s", buffer); | 231 | printk(KERN_CONT "%s", buffer); |
232 | } | 232 | } |
233 | #else | 233 | #else |
234 | printk("%s", buffer); | 234 | printk(KERN_CONT "%s", buffer); |
235 | #endif | 235 | #endif |
236 | } | 236 | } |
237 | 237 | ||
@@ -274,12 +274,19 @@ EXPORT_SYMBOL_GPL(acpi_os_map_memory); | |||
274 | 274 | ||
275 | void acpi_os_unmap_memory(void __iomem * virt, acpi_size size) | 275 | void acpi_os_unmap_memory(void __iomem * virt, acpi_size size) |
276 | { | 276 | { |
277 | if (acpi_gbl_permanent_mmap) { | 277 | if (acpi_gbl_permanent_mmap) |
278 | iounmap(virt); | 278 | iounmap(virt); |
279 | } | 279 | else |
280 | __acpi_unmap_table(virt, size); | ||
280 | } | 281 | } |
281 | EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); | 282 | EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); |
282 | 283 | ||
284 | void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size) | ||
285 | { | ||
286 | if (!acpi_gbl_permanent_mmap) | ||
287 | __acpi_unmap_table(virt, size); | ||
288 | } | ||
289 | |||
283 | #ifdef ACPI_FUTURE_USAGE | 290 | #ifdef ACPI_FUTURE_USAGE |
284 | acpi_status | 291 | acpi_status |
285 | acpi_os_get_physical_address(void *virt, acpi_physical_address * phys) | 292 | acpi_os_get_physical_address(void *virt, acpi_physical_address * phys) |
@@ -1317,6 +1324,54 @@ acpi_os_validate_interface (char *interface) | |||
1317 | return AE_SUPPORT; | 1324 | return AE_SUPPORT; |
1318 | } | 1325 | } |
1319 | 1326 | ||
1327 | #ifdef CONFIG_X86 | ||
1328 | |||
1329 | struct aml_port_desc { | ||
1330 | uint start; | ||
1331 | uint end; | ||
1332 | char* name; | ||
1333 | char warned; | ||
1334 | }; | ||
1335 | |||
1336 | static struct aml_port_desc aml_invalid_port_list[] = { | ||
1337 | {0x20, 0x21, "PIC0", 0}, | ||
1338 | {0xA0, 0xA1, "PIC1", 0}, | ||
1339 | {0x4D0, 0x4D1, "ELCR", 0} | ||
1340 | }; | ||
1341 | |||
1342 | /* | ||
1343 | * valid_aml_io_address() | ||
1344 | * | ||
1345 | * if valid, return true | ||
1346 | * else invalid, warn once, return false | ||
1347 | */ | ||
1348 | static bool valid_aml_io_address(uint address, uint length) | ||
1349 | { | ||
1350 | int i; | ||
1351 | int entries = sizeof(aml_invalid_port_list) / sizeof(struct aml_port_desc); | ||
1352 | |||
1353 | for (i = 0; i < entries; ++i) { | ||
1354 | if ((address >= aml_invalid_port_list[i].start && | ||
1355 | address <= aml_invalid_port_list[i].end) || | ||
1356 | (address + length >= aml_invalid_port_list[i].start && | ||
1357 | address + length <= aml_invalid_port_list[i].end)) | ||
1358 | { | ||
1359 | if (!aml_invalid_port_list[i].warned) | ||
1360 | { | ||
1361 | printk(KERN_ERR "ACPI: Denied BIOS AML access" | ||
1362 | " to invalid port 0x%x+0x%x (%s)\n", | ||
1363 | address, length, | ||
1364 | aml_invalid_port_list[i].name); | ||
1365 | aml_invalid_port_list[i].warned = 1; | ||
1366 | } | ||
1367 | return false; /* invalid */ | ||
1368 | } | ||
1369 | } | ||
1370 | return true; /* valid */ | ||
1371 | } | ||
1372 | #else | ||
1373 | static inline bool valid_aml_io_address(uint address, uint length) { return true; } | ||
1374 | #endif | ||
1320 | /****************************************************************************** | 1375 | /****************************************************************************** |
1321 | * | 1376 | * |
1322 | * FUNCTION: acpi_os_validate_address | 1377 | * FUNCTION: acpi_os_validate_address |
@@ -1346,6 +1401,8 @@ acpi_os_validate_address ( | |||
1346 | 1401 | ||
1347 | switch (space_id) { | 1402 | switch (space_id) { |
1348 | case ACPI_ADR_SPACE_SYSTEM_IO: | 1403 | case ACPI_ADR_SPACE_SYSTEM_IO: |
1404 | if (!valid_aml_io_address(address, length)) | ||
1405 | return AE_AML_ILLEGAL_ADDRESS; | ||
1349 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: | 1406 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: |
1350 | /* Only interference checks against SystemIO and SytemMemory | 1407 | /* Only interference checks against SystemIO and SytemMemory |
1351 | are needed */ | 1408 | are needed */ |