diff options
author | Bob Moore <robert.moore@intel.com> | 2009-05-20 22:56:52 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-05-27 00:35:51 -0400 |
commit | f5407af3f271ed4cd6655cf30d419d77e0f8bfaa (patch) | |
tree | 29373e219227c025111e3e72adbfc8896362c193 /drivers/acpi | |
parent | 3c59f96081259358d9d5d677f4839c36391806b6 (diff) |
ACPICA: Simplify internal operation region interface
Changed address parameter to a simple offset. This removes the
need for the caller to access the region object to obtain the
physical address.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/acevents.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/evregion.c | 12 | ||||
-rw-r--r-- | drivers/acpi/acpica/exconfig.c | 9 | ||||
-rw-r--r-- | drivers/acpi/acpica/exfldio.c | 20 |
4 files changed, 23 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index 07e20135f01..0bba148a2c6 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
@@ -139,7 +139,7 @@ acpi_status acpi_ev_initialize_op_regions(void); | |||
139 | acpi_status | 139 | acpi_status |
140 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | 140 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
141 | u32 function, | 141 | u32 function, |
142 | acpi_physical_address address, | 142 | u32 region_offset, |
143 | u32 bit_width, acpi_integer * value); | 143 | u32 bit_width, acpi_integer * value); |
144 | 144 | ||
145 | acpi_status | 145 | acpi_status |
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 538d6326455..98c7f9c6265 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -275,7 +275,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
275 | * | 275 | * |
276 | * PARAMETERS: region_obj - Internal region object | 276 | * PARAMETERS: region_obj - Internal region object |
277 | * Function - Read or Write operation | 277 | * Function - Read or Write operation |
278 | * Address - Where in the space to read or write | 278 | * region_offset - Where in the region to read or write |
279 | * bit_width - Field width in bits (8, 16, 32, or 64) | 279 | * bit_width - Field width in bits (8, 16, 32, or 64) |
280 | * Value - Pointer to in or out value, must be | 280 | * Value - Pointer to in or out value, must be |
281 | * full 64-bit acpi_integer | 281 | * full 64-bit acpi_integer |
@@ -290,7 +290,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
290 | acpi_status | 290 | acpi_status |
291 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | 291 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
292 | u32 function, | 292 | u32 function, |
293 | acpi_physical_address address, | 293 | u32 region_offset, |
294 | u32 bit_width, acpi_integer * value) | 294 | u32 bit_width, acpi_integer * value) |
295 | { | 295 | { |
296 | acpi_status status; | 296 | acpi_status status; |
@@ -396,7 +396,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
396 | ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, | 396 | ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, |
397 | "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", | 397 | "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", |
398 | ®ion_obj->region.handler->address_space, handler, | 398 | ®ion_obj->region.handler->address_space, handler, |
399 | ACPI_FORMAT_NATIVE_UINT(address), | 399 | ACPI_FORMAT_NATIVE_UINT(region_obj->region.address + |
400 | region_offset), | ||
400 | acpi_ut_get_region_name(region_obj->region. | 401 | acpi_ut_get_region_name(region_obj->region. |
401 | space_id))); | 402 | space_id))); |
402 | 403 | ||
@@ -412,8 +413,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
412 | 413 | ||
413 | /* Call the handler */ | 414 | /* Call the handler */ |
414 | 415 | ||
415 | status = handler(function, address, bit_width, value, | 416 | status = handler(function, |
416 | handler_desc->address_space.context, | 417 | (region_obj->region.address + region_offset), |
418 | bit_width, value, handler_desc->address_space.context, | ||
417 | region_obj2->extra.region_context); | 419 | region_obj2->extra.region_context); |
418 | 420 | ||
419 | if (ACPI_FAILURE(status)) { | 421 | if (ACPI_FAILURE(status)) { |
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index eca6f63a53f..277fd609611 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -280,23 +280,22 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer) | |||
280 | { | 280 | { |
281 | acpi_status status; | 281 | acpi_status status; |
282 | acpi_integer value; | 282 | acpi_integer value; |
283 | acpi_physical_address address; | 283 | u32 region_offset = 0; |
284 | u32 i; | 284 | u32 i; |
285 | 285 | ||
286 | address = obj_desc->region.address; | ||
287 | |||
288 | /* Bytewise reads */ | 286 | /* Bytewise reads */ |
289 | 287 | ||
290 | for (i = 0; i < length; i++) { | 288 | for (i = 0; i < length; i++) { |
291 | status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, | 289 | status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, |
292 | address, 8, &value); | 290 | region_offset, 8, |
291 | &value); | ||
293 | if (ACPI_FAILURE(status)) { | 292 | if (ACPI_FAILURE(status)) { |
294 | return status; | 293 | return status; |
295 | } | 294 | } |
296 | 295 | ||
297 | *buffer = (u8)value; | 296 | *buffer = (u8)value; |
298 | buffer++; | 297 | buffer++; |
299 | address++; | 298 | region_offset++; |
300 | } | 299 | } |
301 | 300 | ||
302 | return AE_OK; | 301 | return AE_OK; |
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index 99cee61e655..d4075b82102 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -222,7 +222,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
222 | { | 222 | { |
223 | acpi_status status; | 223 | acpi_status status; |
224 | union acpi_operand_object *rgn_desc; | 224 | union acpi_operand_object *rgn_desc; |
225 | acpi_physical_address address; | 225 | u32 region_offset; |
226 | 226 | ||
227 | ACPI_FUNCTION_TRACE(ex_access_region); | 227 | ACPI_FUNCTION_TRACE(ex_access_region); |
228 | 228 | ||
@@ -243,7 +243,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
243 | * 3) The current offset into the field | 243 | * 3) The current offset into the field |
244 | */ | 244 | */ |
245 | rgn_desc = obj_desc->common_field.region_obj; | 245 | rgn_desc = obj_desc->common_field.region_obj; |
246 | address = rgn_desc->region.address + | 246 | region_offset = |
247 | obj_desc->common_field.base_byte_offset + field_datum_byte_offset; | 247 | obj_desc->common_field.base_byte_offset + field_datum_byte_offset; |
248 | 248 | ||
249 | if ((function & ACPI_IO_MASK) == ACPI_READ) { | 249 | if ((function & ACPI_IO_MASK) == ACPI_READ) { |
@@ -260,16 +260,18 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
260 | obj_desc->common_field.access_byte_width, | 260 | obj_desc->common_field.access_byte_width, |
261 | obj_desc->common_field.base_byte_offset, | 261 | obj_desc->common_field.base_byte_offset, |
262 | field_datum_byte_offset, ACPI_CAST_PTR(void, | 262 | field_datum_byte_offset, ACPI_CAST_PTR(void, |
263 | address))); | 263 | (rgn_desc-> |
264 | region. | ||
265 | address + | ||
266 | region_offset)))); | ||
264 | 267 | ||
265 | /* Invoke the appropriate address_space/op_region handler */ | 268 | /* Invoke the appropriate address_space/op_region handler */ |
266 | 269 | ||
267 | status = acpi_ev_address_space_dispatch(rgn_desc, function, | 270 | status = |
268 | address, | 271 | acpi_ev_address_space_dispatch(rgn_desc, function, region_offset, |
269 | ACPI_MUL_8(obj_desc-> | 272 | ACPI_MUL_8(obj_desc->common_field. |
270 | common_field. | 273 | access_byte_width), |
271 | access_byte_width), | 274 | value); |
272 | value); | ||
273 | 275 | ||
274 | if (ACPI_FAILURE(status)) { | 276 | if (ACPI_FAILURE(status)) { |
275 | if (status == AE_NOT_IMPLEMENTED) { | 277 | if (status == AE_NOT_IMPLEMENTED) { |