diff options
author | Robert Moore <Robert.Moore@intel.com> | 2005-09-17 00:51:15 +0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-09-22 07:51:39 +0400 |
commit | bda663d36b94c723153246a4231bbc0f1cd1836e (patch) | |
tree | cc9f75c1d010d1b99d29f13acd600b21eda5eec5 /drivers/acpi/resources/rsio.c | |
parent | efb0372bbaf5b829ff8c39db372779928af542a7 (diff) | |
download | linux-bda663d36b94c723153246a4231bbc0f1cd1836e.tar.xz |
[ACPI] ACPICA 20050916
Fixed a problem within the Resource Manager where
support for the Generic Register descriptor was not fully
implemented. This descriptor is now fully recognized,
parsed, disassembled, and displayed.
Restructured the Resource Manager code to utilize
table-driven dispatch and lookup, eliminating many of the
large switch() statements. This reduces overall subsystem
code size and code complexity. Affects the resource parsing
and construction, disassembly, and debug dump output.
Cleaned up and restructured the debug dump output for all
resource descriptors. Improved readability of the output
and reduced code size.
Fixed a problem where changes to internal data structures
caused the optional ACPI_MUTEX_DEBUG code to fail
compilation if specified.
Signed-off-by: Robert Moore <Robert.Moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/resources/rsio.c')
-rw-r--r-- | drivers/acpi/resources/rsio.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c index d53bbe89e851..6574e2ae2e52 100644 --- a/drivers/acpi/resources/rsio.c +++ b/drivers/acpi/resources/rsio.c @@ -84,7 +84,7 @@ acpi_rs_io_resource(u8 * byte_stream_buffer, *bytes_consumed = 8; - output_struct->id = ACPI_RSTYPE_IO; + output_struct->type = ACPI_RSTYPE_IO; /* Check Decode */ @@ -170,7 +170,7 @@ acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, *bytes_consumed = 4; - output_struct->id = ACPI_RSTYPE_FIXED_IO; + output_struct->type = ACPI_RSTYPE_FIXED_IO; /* Check Range Base Address */ @@ -200,7 +200,7 @@ acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, * * FUNCTION: acpi_rs_io_stream * - * PARAMETERS: linked_list - Pointer to the resource linked list + * PARAMETERS: Resource - Pointer to the resource linked list * output_buffer - Pointer to the user's return buffer * bytes_consumed - Pointer to where the number of bytes * used in the output_buffer is returned @@ -213,7 +213,7 @@ acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, ******************************************************************************/ acpi_status -acpi_rs_io_stream(struct acpi_resource *linked_list, +acpi_rs_io_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed) { u8 *buffer = *output_buffer; @@ -222,42 +222,42 @@ acpi_rs_io_stream(struct acpi_resource *linked_list, ACPI_FUNCTION_TRACE("rs_io_stream"); - /* The descriptor field is static */ + /* The Descriptor Type field is static */ - *buffer = 0x47; + *buffer = ACPI_RDESC_TYPE_IO_PORT | 0x07; buffer += 1; /* Io Information Byte */ - temp8 = (u8) (linked_list->data.io.io_decode & 0x01); + temp8 = (u8) (resource->data.io.io_decode & 0x01); *buffer = temp8; buffer += 1; /* Set the Range minimum base address */ - temp16 = (u16) linked_list->data.io.min_base_address; + temp16 = (u16) resource->data.io.min_base_address; ACPI_MOVE_16_TO_16(buffer, &temp16); buffer += 2; /* Set the Range maximum base address */ - temp16 = (u16) linked_list->data.io.max_base_address; + temp16 = (u16) resource->data.io.max_base_address; ACPI_MOVE_16_TO_16(buffer, &temp16); buffer += 2; /* Set the base alignment */ - temp8 = (u8) linked_list->data.io.alignment; + temp8 = (u8) resource->data.io.alignment; *buffer = temp8; buffer += 1; /* Set the range length */ - temp8 = (u8) linked_list->data.io.range_length; + temp8 = (u8) resource->data.io.range_length; *buffer = temp8; buffer += 1; @@ -272,7 +272,7 @@ acpi_rs_io_stream(struct acpi_resource *linked_list, * * FUNCTION: acpi_rs_fixed_io_stream * - * PARAMETERS: linked_list - Pointer to the resource linked list + * PARAMETERS: Resource - Pointer to the resource linked list * output_buffer - Pointer to the user's return buffer * bytes_consumed - Pointer to where the number of bytes * used in the output_buffer is returned @@ -285,7 +285,7 @@ acpi_rs_io_stream(struct acpi_resource *linked_list, ******************************************************************************/ acpi_status -acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, +acpi_rs_fixed_io_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed) { u8 *buffer = *output_buffer; @@ -294,22 +294,21 @@ acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, ACPI_FUNCTION_TRACE("rs_fixed_io_stream"); - /* The descriptor field is static */ - - *buffer = 0x4B; + /* The Descriptor Type field is static */ + *buffer = ACPI_RDESC_TYPE_FIXED_IO_PORT | 0x03; buffer += 1; /* Set the Range base address */ - temp16 = (u16) linked_list->data.fixed_io.base_address; + temp16 = (u16) resource->data.fixed_io.base_address; ACPI_MOVE_16_TO_16(buffer, &temp16); buffer += 2; /* Set the range length */ - temp8 = (u8) linked_list->data.fixed_io.range_length; + temp8 = (u8) resource->data.fixed_io.range_length; *buffer = temp8; buffer += 1; @@ -358,7 +357,7 @@ acpi_rs_dma_resource(u8 * byte_stream_buffer, /* The number of bytes consumed are Constant */ *bytes_consumed = 3; - output_struct->id = ACPI_RSTYPE_DMA; + output_struct->type = ACPI_RSTYPE_DMA; /* Point to the 8-bits of Byte 1 */ @@ -420,7 +419,7 @@ acpi_rs_dma_resource(u8 * byte_stream_buffer, * * FUNCTION: acpi_rs_dma_stream * - * PARAMETERS: linked_list - Pointer to the resource linked list + * PARAMETERS: Resource - Pointer to the resource linked list * output_buffer - Pointer to the user's return buffer * bytes_consumed - Pointer to where the number of bytes * used in the output_buffer is returned @@ -433,7 +432,7 @@ acpi_rs_dma_resource(u8 * byte_stream_buffer, ******************************************************************************/ acpi_status -acpi_rs_dma_stream(struct acpi_resource *linked_list, +acpi_rs_dma_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed) { u8 *buffer = *output_buffer; @@ -443,17 +442,16 @@ acpi_rs_dma_stream(struct acpi_resource *linked_list, ACPI_FUNCTION_TRACE("rs_dma_stream"); - /* The descriptor field is static */ + /* The Descriptor Type field is static */ - *buffer = 0x2A; + *buffer = ACPI_RDESC_TYPE_DMA_FORMAT | 0x02; buffer += 1; temp8 = 0; /* Loop through all of the Channels and set the mask bits */ - for (index = 0; - index < linked_list->data.dma.number_of_channels; index++) { - temp16 = (u16) linked_list->data.dma.channels[index]; + for (index = 0; index < resource->data.dma.number_of_channels; index++) { + temp16 = (u16) resource->data.dma.channels[index]; temp8 |= 0x1 << temp16; } @@ -462,9 +460,9 @@ acpi_rs_dma_stream(struct acpi_resource *linked_list, /* Set the DMA Info */ - temp8 = (u8) ((linked_list->data.dma.type & 0x03) << 5); - temp8 |= ((linked_list->data.dma.bus_master & 0x01) << 2); - temp8 |= (linked_list->data.dma.transfer & 0x03); + temp8 = (u8) ((resource->data.dma.type & 0x03) << 5); + temp8 |= ((resource->data.dma.bus_master & 0x01) << 2); + temp8 |= (resource->data.dma.transfer & 0x03); *buffer = temp8; buffer += 1; |