diff options
Diffstat (limited to 'drivers/acpi/executer/exregion.c')
-rw-r--r-- | drivers/acpi/executer/exregion.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c index 7cfd0684c70b..723aaef4bb4a 100644 --- a/drivers/acpi/executer/exregion.c +++ b/drivers/acpi/executer/exregion.c | |||
@@ -115,7 +115,6 @@ acpi_ex_system_memory_space_handler ( | |||
115 | return_ACPI_STATUS (AE_AML_OPERAND_VALUE); | 115 | return_ACPI_STATUS (AE_AML_OPERAND_VALUE); |
116 | } | 116 | } |
117 | 117 | ||
118 | |||
119 | #ifndef ACPI_MISALIGNED_TRANSFERS | 118 | #ifndef ACPI_MISALIGNED_TRANSFERS |
120 | /* | 119 | /* |
121 | * Hardware does not support non-aligned data transfers, we must verify | 120 | * Hardware does not support non-aligned data transfers, we must verify |
@@ -134,7 +133,8 @@ acpi_ex_system_memory_space_handler ( | |||
134 | */ | 133 | */ |
135 | if ((address < mem_info->mapped_physical_address) || | 134 | if ((address < mem_info->mapped_physical_address) || |
136 | (((acpi_integer) address + length) > | 135 | (((acpi_integer) address + length) > |
137 | ((acpi_integer) mem_info->mapped_physical_address + mem_info->mapped_length))) { | 136 | ((acpi_integer) |
137 | mem_info->mapped_physical_address + mem_info->mapped_length))) { | ||
138 | /* | 138 | /* |
139 | * The request cannot be resolved by the current memory mapping; | 139 | * The request cannot be resolved by the current memory mapping; |
140 | * Delete the existing mapping and create a new one. | 140 | * Delete the existing mapping and create a new one. |
@@ -150,7 +150,9 @@ acpi_ex_system_memory_space_handler ( | |||
150 | * Don't attempt to map memory beyond the end of the region, and | 150 | * Don't attempt to map memory beyond the end of the region, and |
151 | * constrain the maximum mapping size to something reasonable. | 151 | * constrain the maximum mapping size to something reasonable. |
152 | */ | 152 | */ |
153 | window_size = (acpi_size) ((mem_info->address + mem_info->length) - address); | 153 | window_size = (acpi_size) |
154 | ((mem_info->address + mem_info->length) - address); | ||
155 | |||
154 | if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) { | 156 | if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) { |
155 | window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE; | 157 | window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE; |
156 | } | 158 | } |
@@ -160,8 +162,9 @@ acpi_ex_system_memory_space_handler ( | |||
160 | status = acpi_os_map_memory (address, window_size, | 162 | status = acpi_os_map_memory (address, window_size, |
161 | (void **) &mem_info->mapped_logical_address); | 163 | (void **) &mem_info->mapped_logical_address); |
162 | if (ACPI_FAILURE (status)) { | 164 | if (ACPI_FAILURE (status)) { |
163 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n", | 165 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
164 | ACPI_FORMAT_UINT64 (address), (u32) window_size)); | 166 | "Could not map memory at %8.8X%8.8X, size %X\n", |
167 | ACPI_FORMAT_UINT64 (address), (u32) window_size)); | ||
165 | mem_info->mapped_length = 0; | 168 | mem_info->mapped_length = 0; |
166 | return_ACPI_STATUS (status); | 169 | return_ACPI_STATUS (status); |
167 | } | 170 | } |
@@ -177,10 +180,12 @@ acpi_ex_system_memory_space_handler ( | |||
177 | * access | 180 | * access |
178 | */ | 181 | */ |
179 | logical_addr_ptr = mem_info->mapped_logical_address + | 182 | logical_addr_ptr = mem_info->mapped_logical_address + |
180 | ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address); | 183 | ((acpi_integer) address - |
184 | (acpi_integer) mem_info->mapped_physical_address); | ||
181 | 185 | ||
182 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, | 186 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, |
183 | "system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, | 187 | "system_memory %d (%d width) Address=%8.8X%8.8X\n", |
188 | function, bit_width, | ||
184 | ACPI_FORMAT_UINT64 (address))); | 189 | ACPI_FORMAT_UINT64 (address))); |
185 | 190 | ||
186 | /* | 191 | /* |
@@ -298,13 +303,15 @@ acpi_ex_system_io_space_handler ( | |||
298 | switch (function) { | 303 | switch (function) { |
299 | case ACPI_READ: | 304 | case ACPI_READ: |
300 | 305 | ||
301 | status = acpi_os_read_port ((acpi_io_address) address, &value32, bit_width); | 306 | status = acpi_os_read_port ((acpi_io_address) address, |
307 | &value32, bit_width); | ||
302 | *value = value32; | 308 | *value = value32; |
303 | break; | 309 | break; |
304 | 310 | ||
305 | case ACPI_WRITE: | 311 | case ACPI_WRITE: |
306 | 312 | ||
307 | status = acpi_os_write_port ((acpi_io_address) address, (u32) *value, bit_width); | 313 | status = acpi_os_write_port ((acpi_io_address) address, |
314 | (u32) *value, bit_width); | ||
308 | break; | 315 | break; |
309 | 316 | ||
310 | default: | 317 | default: |
@@ -375,12 +382,14 @@ acpi_ex_pci_config_space_handler ( | |||
375 | case ACPI_READ: | 382 | case ACPI_READ: |
376 | 383 | ||
377 | *value = 0; | 384 | *value = 0; |
378 | status = acpi_os_read_pci_configuration (pci_id, pci_register, value, bit_width); | 385 | status = acpi_os_read_pci_configuration (pci_id, pci_register, |
386 | value, bit_width); | ||
379 | break; | 387 | break; |
380 | 388 | ||
381 | case ACPI_WRITE: | 389 | case ACPI_WRITE: |
382 | 390 | ||
383 | status = acpi_os_write_pci_configuration (pci_id, pci_register, *value, bit_width); | 391 | status = acpi_os_write_pci_configuration (pci_id, pci_register, |
392 | *value, bit_width); | ||
384 | break; | 393 | break; |
385 | 394 | ||
386 | default: | 395 | default: |
@@ -505,8 +514,7 @@ acpi_ex_data_table_space_handler ( | |||
505 | 514 | ||
506 | logical_addr_ptr = ACPI_PHYSADDR_TO_PTR (address); | 515 | logical_addr_ptr = ACPI_PHYSADDR_TO_PTR (address); |
507 | 516 | ||
508 | 517 | /* Perform the memory read or write */ | |
509 | /* Perform the memory read or write */ | ||
510 | 518 | ||
511 | switch (function) { | 519 | switch (function) { |
512 | case ACPI_READ: | 520 | case ACPI_READ: |