aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exregion.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/executer/exregion.c
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exregion.c')
-rw-r--r--drivers/acpi/executer/exregion.c34
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: