.. | .. |
---|
3 | 3 | * |
---|
4 | 4 | * Module Name: hwvalid - I/O request validation |
---|
5 | 5 | * |
---|
6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
---|
7 | 7 | * |
---|
8 | 8 | *****************************************************************************/ |
---|
9 | 9 | |
---|
.. | .. |
---|
23 | 23 | * |
---|
24 | 24 | * The table is used to implement the Microsoft port access rules that |
---|
25 | 25 | * first appeared in Windows XP. Some ports are always illegal, and some |
---|
26 | | - * ports are only illegal if the BIOS calls _OSI with a win_XP string or |
---|
27 | | - * later (meaning that the BIOS itelf is post-XP.) |
---|
| 26 | + * ports are only illegal if the BIOS calls _OSI with nothing newer than |
---|
| 27 | + * the specific _OSI strings. |
---|
28 | 28 | * |
---|
29 | 29 | * This provides ACPICA with the desired port protections and |
---|
30 | 30 | * Microsoft compatibility. |
---|
.. | .. |
---|
145 | 145 | |
---|
146 | 146 | /* Port illegality may depend on the _OSI calls made by the BIOS */ |
---|
147 | 147 | |
---|
148 | | - if (acpi_gbl_osi_data >= port_info->osi_dependency) { |
---|
| 148 | + if (port_info->osi_dependency == ACPI_ALWAYS_ILLEGAL || |
---|
| 149 | + acpi_gbl_osi_data == port_info->osi_dependency) { |
---|
149 | 150 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, |
---|
150 | 151 | "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)\n", |
---|
151 | 152 | ACPI_FORMAT_UINT64(address), |
---|
.. | .. |
---|
292 | 293 | |
---|
293 | 294 | return (AE_OK); |
---|
294 | 295 | } |
---|
| 296 | + |
---|
| 297 | +/****************************************************************************** |
---|
| 298 | + * |
---|
| 299 | + * FUNCTION: acpi_hw_validate_io_block |
---|
| 300 | + * |
---|
| 301 | + * PARAMETERS: Address Address of I/O port/register blobk |
---|
| 302 | + * bit_width Number of bits (8,16,32) in each register |
---|
| 303 | + * count Number of registers in the block |
---|
| 304 | + * |
---|
| 305 | + * RETURN: Status |
---|
| 306 | + * |
---|
| 307 | + * DESCRIPTION: Validates a block of I/O ports/registers. |
---|
| 308 | + * |
---|
| 309 | + ******************************************************************************/ |
---|
| 310 | + |
---|
| 311 | +acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count) |
---|
| 312 | +{ |
---|
| 313 | + acpi_status status; |
---|
| 314 | + |
---|
| 315 | + while (count--) { |
---|
| 316 | + status = acpi_hw_validate_io_request((acpi_io_address)address, |
---|
| 317 | + bit_width); |
---|
| 318 | + if (ACPI_FAILURE(status)) |
---|
| 319 | + return_ACPI_STATUS(status); |
---|
| 320 | + |
---|
| 321 | + address += ACPI_DIV_8(bit_width); |
---|
| 322 | + } |
---|
| 323 | + |
---|
| 324 | + return_ACPI_STATUS(AE_OK); |
---|
| 325 | +} |
---|