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>
This commit is contained in:
Bob Moore 2009-05-21 10:56:52 +08:00 committed by Len Brown
parent 3c59f96081
commit f5407af3f2
4 changed files with 23 additions and 20 deletions

View File

@ -139,7 +139,7 @@ acpi_status acpi_ev_initialize_op_regions(void);
acpi_status acpi_status
acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
u32 function, u32 function,
acpi_physical_address address, u32 region_offset,
u32 bit_width, acpi_integer * value); u32 bit_width, acpi_integer * value);
acpi_status acpi_status

View File

@ -275,7 +275,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
* *
* PARAMETERS: region_obj - Internal region object * PARAMETERS: region_obj - Internal region object
* Function - Read or Write operation * Function - Read or Write operation
* Address - Where in the space to read or write * region_offset - Where in the region to read or write
* bit_width - Field width in bits (8, 16, 32, or 64) * bit_width - Field width in bits (8, 16, 32, or 64)
* Value - Pointer to in or out value, must be * Value - Pointer to in or out value, must be
* full 64-bit acpi_integer * full 64-bit acpi_integer
@ -290,7 +290,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
acpi_status acpi_status
acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
u32 function, u32 function,
acpi_physical_address address, u32 region_offset,
u32 bit_width, acpi_integer * value) u32 bit_width, acpi_integer * value)
{ {
acpi_status status; acpi_status status;
@ -396,7 +396,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n", "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
&region_obj->region.handler->address_space, handler, &region_obj->region.handler->address_space, handler,
ACPI_FORMAT_NATIVE_UINT(address), ACPI_FORMAT_NATIVE_UINT(region_obj->region.address +
region_offset),
acpi_ut_get_region_name(region_obj->region. acpi_ut_get_region_name(region_obj->region.
space_id))); space_id)));
@ -412,8 +413,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
/* Call the handler */ /* Call the handler */
status = handler(function, address, bit_width, value, status = handler(function,
handler_desc->address_space.context, (region_obj->region.address + region_offset),
bit_width, value, handler_desc->address_space.context,
region_obj2->extra.region_context); region_obj2->extra.region_context);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {

View File

@ -280,23 +280,22 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
{ {
acpi_status status; acpi_status status;
acpi_integer value; acpi_integer value;
acpi_physical_address address; u32 region_offset = 0;
u32 i; u32 i;
address = obj_desc->region.address;
/* Bytewise reads */ /* Bytewise reads */
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ,
address, 8, &value); region_offset, 8,
&value);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return status; return status;
} }
*buffer = (u8)value; *buffer = (u8)value;
buffer++; buffer++;
address++; region_offset++;
} }
return AE_OK; return AE_OK;

View File

@ -222,7 +222,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
{ {
acpi_status status; acpi_status status;
union acpi_operand_object *rgn_desc; union acpi_operand_object *rgn_desc;
acpi_physical_address address; u32 region_offset;
ACPI_FUNCTION_TRACE(ex_access_region); ACPI_FUNCTION_TRACE(ex_access_region);
@ -243,7 +243,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
* 3) The current offset into the field * 3) The current offset into the field
*/ */
rgn_desc = obj_desc->common_field.region_obj; rgn_desc = obj_desc->common_field.region_obj;
address = rgn_desc->region.address + region_offset =
obj_desc->common_field.base_byte_offset + field_datum_byte_offset; obj_desc->common_field.base_byte_offset + field_datum_byte_offset;
if ((function & ACPI_IO_MASK) == ACPI_READ) { if ((function & ACPI_IO_MASK) == ACPI_READ) {
@ -260,16 +260,18 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
obj_desc->common_field.access_byte_width, obj_desc->common_field.access_byte_width,
obj_desc->common_field.base_byte_offset, obj_desc->common_field.base_byte_offset,
field_datum_byte_offset, ACPI_CAST_PTR(void, field_datum_byte_offset, ACPI_CAST_PTR(void,
address))); (rgn_desc->
region.
address +
region_offset))));
/* Invoke the appropriate address_space/op_region handler */ /* Invoke the appropriate address_space/op_region handler */
status = acpi_ev_address_space_dispatch(rgn_desc, function, status =
address, acpi_ev_address_space_dispatch(rgn_desc, function, region_offset,
ACPI_MUL_8(obj_desc-> ACPI_MUL_8(obj_desc->common_field.
common_field. access_byte_width),
access_byte_width), value);
value);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status == AE_NOT_IMPLEMENTED) { if (status == AE_NOT_IMPLEMENTED) {