aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exregion.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exregion.c')
-rw-r--r--drivers/acpi/executer/exregion.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 6a4cfdff606d..3cc97ba48b36 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -81,7 +81,7 @@ acpi_ex_system_memory_space_handler(u32 function,
81 u32 remainder; 81 u32 remainder;
82#endif 82#endif
83 83
84 ACPI_FUNCTION_TRACE("ex_system_memory_space_handler"); 84 ACPI_FUNCTION_TRACE(ex_system_memory_space_handler);
85 85
86 /* Validate and translate the bit width */ 86 /* Validate and translate the bit width */
87 87
@@ -103,7 +103,7 @@ acpi_ex_system_memory_space_handler(u32 function,
103 break; 103 break;
104 104
105 default: 105 default:
106 ACPI_ERROR((AE_INFO, "Invalid system_memory width %d", 106 ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %d",
107 bit_width)); 107 bit_width));
108 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 108 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
109 } 109 }
@@ -135,6 +135,7 @@ acpi_ex_system_memory_space_handler(u32 function,
135 * Delete the existing mapping and create a new one. 135 * Delete the existing mapping and create a new one.
136 */ 136 */
137 if (mem_info->mapped_length) { 137 if (mem_info->mapped_length) {
138
138 /* Valid mapping, delete it */ 139 /* Valid mapping, delete it */
139 140
140 acpi_os_unmap_memory(mem_info->mapped_logical_address, 141 acpi_os_unmap_memory(mem_info->mapped_logical_address,
@@ -181,8 +182,8 @@ acpi_ex_system_memory_space_handler(u32 function,
181 (acpi_integer) mem_info->mapped_physical_address); 182 (acpi_integer) mem_info->mapped_physical_address);
182 183
183 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 184 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
184 "system_memory %d (%d width) Address=%8.8X%8.8X\n", 185 "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
185 function, bit_width, ACPI_FORMAT_UINT64(address))); 186 bit_width, function, ACPI_FORMAT_UINT64(address)));
186 187
187 /* 188 /*
188 * Perform the memory read or write 189 * Perform the memory read or write
@@ -283,11 +284,11 @@ acpi_ex_system_io_space_handler(u32 function,
283 acpi_status status = AE_OK; 284 acpi_status status = AE_OK;
284 u32 value32; 285 u32 value32;
285 286
286 ACPI_FUNCTION_TRACE("ex_system_io_space_handler"); 287 ACPI_FUNCTION_TRACE(ex_system_io_space_handler);
287 288
288 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 289 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
289 "system_iO %d (%d width) Address=%8.8X%8.8X\n", 290 "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
290 function, bit_width, ACPI_FORMAT_UINT64(address))); 291 bit_width, function, ACPI_FORMAT_UINT64(address)));
291 292
292 /* Decode the function parameter */ 293 /* Decode the function parameter */
293 294
@@ -342,7 +343,7 @@ acpi_ex_pci_config_space_handler(u32 function,
342 struct acpi_pci_id *pci_id; 343 struct acpi_pci_id *pci_id;
343 u16 pci_register; 344 u16 pci_register;
344 345
345 ACPI_FUNCTION_TRACE("ex_pci_config_space_handler"); 346 ACPI_FUNCTION_TRACE(ex_pci_config_space_handler);
346 347
347 /* 348 /*
348 * The arguments to acpi_os(Read|Write)pci_configuration are: 349 * The arguments to acpi_os(Read|Write)pci_configuration are:
@@ -360,7 +361,7 @@ acpi_ex_pci_config_space_handler(u32 function,
360 pci_register = (u16) (u32) address; 361 pci_register = (u16) (u32) address;
361 362
362 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 363 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
363 "pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", 364 "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
364 function, bit_width, pci_id->segment, pci_id->bus, 365 function, bit_width, pci_id->segment, pci_id->bus,
365 pci_id->device, pci_id->function, pci_register)); 366 pci_id->device, pci_id->function, pci_register));
366 367
@@ -414,7 +415,7 @@ acpi_ex_cmos_space_handler(u32 function,
414{ 415{
415 acpi_status status = AE_OK; 416 acpi_status status = AE_OK;
416 417
417 ACPI_FUNCTION_TRACE("ex_cmos_space_handler"); 418 ACPI_FUNCTION_TRACE(ex_cmos_space_handler);
418 419
419 return_ACPI_STATUS(status); 420 return_ACPI_STATUS(status);
420} 421}
@@ -446,7 +447,7 @@ acpi_ex_pci_bar_space_handler(u32 function,
446{ 447{
447 acpi_status status = AE_OK; 448 acpi_status status = AE_OK;
448 449
449 ACPI_FUNCTION_TRACE("ex_pci_bar_space_handler"); 450 ACPI_FUNCTION_TRACE(ex_pci_bar_space_handler);
450 451
451 return_ACPI_STATUS(status); 452 return_ACPI_STATUS(status);
452} 453}
@@ -476,23 +477,16 @@ acpi_ex_data_table_space_handler(u32 function,
476 acpi_integer * value, 477 acpi_integer * value,
477 void *handler_context, void *region_context) 478 void *handler_context, void *region_context)
478{ 479{
479 acpi_status status = AE_OK; 480 ACPI_FUNCTION_TRACE(ex_data_table_space_handler);
480 u32 byte_width = ACPI_DIV_8(bit_width);
481 u32 i;
482 char *logical_addr_ptr;
483
484 ACPI_FUNCTION_TRACE("ex_data_table_space_handler");
485
486 logical_addr_ptr = ACPI_PHYSADDR_TO_PTR(address);
487 481
488 /* Perform the memory read or write */ 482 /* Perform the memory read or write */
489 483
490 switch (function) { 484 switch (function) {
491 case ACPI_READ: 485 case ACPI_READ:
492 486
493 for (i = 0; i < byte_width; i++) { 487 ACPI_MEMCPY(ACPI_CAST_PTR(char, value),
494 ((char *)value)[i] = logical_addr_ptr[i]; 488 ACPI_PHYSADDR_TO_PTR(address),
495 } 489 ACPI_DIV_8(bit_width));
496 break; 490 break;
497 491
498 case ACPI_WRITE: 492 case ACPI_WRITE:
@@ -501,5 +495,5 @@ acpi_ex_data_table_space_handler(u32 function,
501 return_ACPI_STATUS(AE_SUPPORT); 495 return_ACPI_STATUS(AE_SUPPORT);
502 } 496 }
503 497
504 return_ACPI_STATUS(status); 498 return_ACPI_STATUS(AE_OK);
505} 499}