Commit bda663d3 authored by Robert Moore's avatar Robert Moore Committed by Len Brown

[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: default avatarRobert Moore <Robert.Moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent efb0372b
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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;
......
......@@ -88,7 +88,7 @@ acpi_rs_irq_resource(u8 * byte_stream_buffer,
*/
temp8 = *buffer;
*bytes_consumed = (temp8 & 0x03) + 1;
output_struct->id = ACPI_RSTYPE_IRQ;
output_struct->type = ACPI_RSTYPE_IRQ;
/* Point to the 16-bits of Bytes 1 and 2 */
......@@ -177,7 +177,7 @@ acpi_rs_irq_resource(u8 * byte_stream_buffer,
*
* FUNCTION: acpi_rs_irq_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
......@@ -190,7 +190,7 @@ acpi_rs_irq_resource(u8 * byte_stream_buffer,
******************************************************************************/
acpi_status
acpi_rs_irq_stream(struct acpi_resource *linked_list,
acpi_rs_irq_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed)
{
u8 *buffer = *output_buffer;
......@@ -205,13 +205,13 @@ acpi_rs_irq_stream(struct acpi_resource *linked_list,
* The descriptor field is set based upon whether a third byte is
* needed to contain the IRQ Information.
*/
if (ACPI_EDGE_SENSITIVE == linked_list->data.irq.edge_level &&
ACPI_ACTIVE_HIGH == linked_list->data.irq.active_high_low &&
ACPI_EXCLUSIVE == linked_list->data.irq.shared_exclusive) {
*buffer = 0x22;
if (ACPI_EDGE_SENSITIVE == resource->data.irq.edge_level &&
ACPI_ACTIVE_HIGH == resource->data.irq.active_high_low &&
ACPI_EXCLUSIVE == resource->data.irq.shared_exclusive) {
*buffer = ACPI_RDESC_TYPE_IRQ_FORMAT | 0x02;
IRqinfo_byte_needed = FALSE;
} else {
*buffer = 0x23;
*buffer = ACPI_RDESC_TYPE_IRQ_FORMAT | 0x03;
IRqinfo_byte_needed = TRUE;
}
......@@ -221,8 +221,8 @@ acpi_rs_irq_stream(struct acpi_resource *linked_list,
/* Loop through all of the interrupts and set the mask bits */
for (index = 0;
index < linked_list->data.irq.number_of_interrupts; index++) {
temp8 = (u8) linked_list->data.irq.interrupts[index];
index < resource->data.irq.number_of_interrupts; index++) {
temp8 = (u8) resource->data.irq.interrupts[index];
temp16 |= 0x1 << temp8;
}
......@@ -233,11 +233,11 @@ acpi_rs_irq_stream(struct acpi_resource *linked_list,
if (IRqinfo_byte_needed) {
temp8 = 0;
temp8 = (u8) ((linked_list->data.irq.shared_exclusive &
temp8 = (u8) ((resource->data.irq.shared_exclusive &
0x01) << 4);
if (ACPI_LEVEL_SENSITIVE == linked_list->data.irq.edge_level &&
ACPI_ACTIVE_LOW == linked_list->data.irq.active_high_low) {
if (ACPI_LEVEL_SENSITIVE == resource->data.irq.edge_level &&
ACPI_ACTIVE_LOW == resource->data.irq.active_high_low) {
temp8 |= 0x08;
} else {
temp8 |= 0x01;
......@@ -302,7 +302,7 @@ acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
}
*bytes_consumed = temp16 + 3;
output_struct->id = ACPI_RSTYPE_EXT_IRQ;
output_struct->type = ACPI_RSTYPE_EXT_IRQ;
/* Point to the Byte3 */
......@@ -441,7 +441,7 @@ acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
*
* FUNCTION: acpi_rs_extended_irq_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
......@@ -454,7 +454,7 @@ acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
******************************************************************************/
acpi_status
acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
acpi_rs_extended_irq_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed)
{
u8 *buffer = *output_buffer;
......@@ -476,9 +476,8 @@ acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
/* Set the Interrupt vector flags */
temp8 = (u8) (linked_list->data.extended_irq.producer_consumer & 0x01);
temp8 |=
((linked_list->data.extended_irq.shared_exclusive & 0x01) << 3);
temp8 = (u8) (resource->data.extended_irq.producer_consumer & 0x01);
temp8 |= ((resource->data.extended_irq.shared_exclusive & 0x01) << 3);
/*
* Set the Interrupt Mode
......@@ -489,44 +488,44 @@ acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
*
* - Edge/Level are defined opposite in the table vs the headers
*/
if (ACPI_EDGE_SENSITIVE == linked_list->data.extended_irq.edge_level) {
if (ACPI_EDGE_SENSITIVE == resource->data.extended_irq.edge_level) {
temp8 |= 0x2;
}
/* Set the Interrupt Polarity */
temp8 |= ((linked_list->data.extended_irq.active_high_low & 0x1) << 2);
temp8 |= ((resource->data.extended_irq.active_high_low & 0x1) << 2);
*buffer = temp8;
buffer += 1;
/* Set the Interrupt table length */
temp8 = (u8) linked_list->data.extended_irq.number_of_interrupts;
temp8 = (u8) resource->data.extended_irq.number_of_interrupts;
*buffer = temp8;
buffer += 1;
for (index = 0;
index < linked_list->data.extended_irq.number_of_interrupts;
index < resource->data.extended_irq.number_of_interrupts;
index++) {
ACPI_MOVE_32_TO_32(buffer,
&linked_list->data.extended_irq.
&resource->data.extended_irq.
interrupts[index]);
buffer += 4;
}
/* Resource Source Index and Resource Source are optional */
if (0 != linked_list->data.extended_irq.resource_source.string_length) {
if (0 != resource->data.extended_irq.resource_source.string_length) {
*buffer =
(u8) linked_list->data.extended_irq.resource_source.index;
(u8) resource->data.extended_irq.resource_source.index;
buffer += 1;
/* Copy the string */
ACPI_STRCPY((char *)buffer,
linked_list->data.extended_irq.resource_source.
resource->data.extended_irq.resource_source.
string_ptr);
/*
......@@ -535,8 +534,8 @@ acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
*/
buffer +=
(acpi_size) (ACPI_STRLEN
(linked_list->data.extended_irq.
resource_source.string_ptr) + 1);
(resource->data.extended_irq.resource_source.
string_ptr) + 1);
}
/* Return the number of bytes consumed in this operation */
......
This diff is collapsed.
......@@ -84,11 +84,11 @@ acpi_rs_memory24_resource(u8 * byte_stream_buffer,
/* Point past the Descriptor to get the number of bytes consumed */
buffer += 1;
ACPI_MOVE_16_TO_16(&temp16, buffer);
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_MEM24;
output_struct->type = ACPI_RSTYPE_MEM24;
/* Check Byte 3 the Read/Write bit */
......@@ -133,7 +133,7 @@ acpi_rs_memory24_resource(u8 * byte_stream_buffer,
*
* FUNCTION: acpi_rs_memory24_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
......@@ -146,7 +146,7 @@ acpi_rs_memory24_resource(u8 * byte_stream_buffer,
******************************************************************************/
acpi_status
acpi_rs_memory24_stream(struct acpi_resource *linked_list,
acpi_rs_memory24_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed)
{
u8 *buffer = *output_buffer;
......@@ -155,9 +155,9 @@ acpi_rs_memory24_stream(struct acpi_resource *linked_list,
ACPI_FUNCTION_TRACE("rs_memory24_stream");
/* The descriptor field is static */
/* The Descriptor Type field is static */
*buffer = 0x81;
*buffer = ACPI_RDESC_TYPE_MEMORY_24;
buffer += 1;
/* The length field is static */
......@@ -168,30 +168,28 @@ acpi_rs_memory24_stream(struct acpi_resource *linked_list,
/* Set the Information Byte */
temp8 = (u8) (linked_list->data.memory24.read_write_attribute & 0x01);
temp8 = (u8) (resource->data.memory24.read_write_attribute & 0x01);
*buffer = temp8;
buffer += 1;
/* Set the Range minimum base address */
ACPI_MOVE_32_TO_16(buffer,
&linked_list->data.memory24.min_base_address);
ACPI_MOVE_32_TO_16(buffer, &resource->data.memory24.min_base_address);
buffer += 2;
/* Set the Range maximum base address */
ACPI_MOVE_32_TO_16(buffer,
&linked_list->data.memory24.max_base_address);
ACPI_MOVE_32_TO_16(buffer, &resource->data.memory24.max_base_address);
buffer += 2;
/* Set the base alignment */
ACPI_MOVE_32_TO_16(buffer, &linked_list->data.memory24.alignment);
ACPI_MOVE_32_TO_16(buffer, &resource->data.memory24.alignment);
buffer += 2;
/* Set the range length */
ACPI_MOVE_32_TO_16(buffer, &linked_list->data.memory24.range_length);
ACPI_MOVE_32_TO_16(buffer, &resource->data.memory24.range_length);
buffer += 2;
/* Return the number of bytes consumed in this operation */
......@@ -238,12 +236,11 @@ acpi_rs_memory32_range_resource(u8 * byte_stream_buffer,
/* Point past the Descriptor to get the number of bytes consumed */
buffer += 1;
ACPI_MOVE_16_TO_16(&temp16, buffer);
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_MEM32;
output_struct->type = ACPI_RSTYPE_MEM32;
/*
* Point to the place in the output buffer where the data portion will
......@@ -335,8 +332,7 @@ acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_FIXED_MEM32;
output_struct->type = ACPI_RSTYPE_FIXED_MEM32;
/* Check Byte 3 the Read/Write bit */
......@@ -369,7 +365,7 @@ acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
*
* FUNCTION: acpi_rs_memory32_range_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
......@@ -382,7 +378,7 @@ acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
******************************************************************************/
acpi_status
acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
acpi_rs_memory32_range_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed)
{
u8 *buffer = *output_buffer;
......@@ -391,9 +387,9 @@ acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
ACPI_FUNCTION_TRACE("rs_memory32_range_stream");
/* The descriptor field is static */
/* The Descriptor Type field is static */
*buffer = 0x85;
*buffer = ACPI_RDESC_TYPE_MEMORY_32;
buffer += 1;
/* The length field is static */
......@@ -405,30 +401,28 @@ acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
/* Set the Information Byte */
temp8 = (u8) (linked_list->data.memory32.read_write_attribute & 0x01);
temp8 = (u8) (resource->data.memory32.read_write_attribute & 0x01);
*buffer = temp8;
buffer += 1;
/* Set the Range minimum base address */
ACPI_MOVE_32_TO_32(buffer,
&linked_list->data.memory32.min_base_address);
ACPI_MOVE_32_TO_32(buffer, &resource->data.memory32.min_base_address);
buffer += 4;
/* Set the Range maximum base address */
ACPI_MOVE_32_TO_32(buffer,
&linked_list->data.memory32.max_base_address);
ACPI_MOVE_32_TO_32(buffer, &resource->data.memory32.max_base_address);
buffer += 4;
/* Set the base alignment */
ACPI_MOVE_32_TO_32(buffer, &linked_list->data.memory32.alignment);
ACPI_MOVE_32_TO_32(buffer, &resource->data.memory32.alignment);
buffer += 4;
/* Set the range length */
ACPI_MOVE_32_TO_32(buffer, &linked_list->data.memory32.range_length);
ACPI_MOVE_32_TO_32(buffer, &resource->data.memory32.range_length);
buffer += 4;
/* Return the number of bytes consumed in this operation */
......@@ -441,7 +435,7 @@ acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
*
* FUNCTION: acpi_rs_fixed_memory32_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
......@@ -454,7 +448,7 @@ acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
******************************************************************************/
acpi_status
acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
acpi_rs_fixed_memory32_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed)
{
u8 *buffer = *output_buffer;
......@@ -463,9 +457,9 @@ acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
ACPI_FUNCTION_TRACE("rs_fixed_memory32_stream");
/* The descriptor field is static */
/* The Descriptor Type field is static */
*buffer = 0x86;
*buffer = ACPI_RDESC_TYPE_FIXED_MEMORY_32;
buffer += 1;
/* The length field is static */
......@@ -478,21 +472,19 @@ acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
/* Set the Information Byte */
temp8 =
(u8) (linked_list->data.fixed_memory32.read_write_attribute & 0x01);
(u8) (resource->data.fixed_memory32.read_write_attribute & 0x01);
*buffer = temp8;
buffer += 1;
/* Set the Range base address */
ACPI_MOVE_32_TO_32(buffer,
&linked_list->data.fixed_memory32.
range_base_address);
&resource->data.fixed_memory32.range_base_address);
buffer += 4;
/* Set the range length */
ACPI_MOVE_32_TO_32(buffer,
&linked_list->data.fixed_memory32.range_length);
ACPI_MOVE_32_TO_32(buffer, &resource->data.fixed_memory32.range_length);
buffer += 4;
/* Return the number of bytes consumed in this operation */
......
This diff is collapsed.
......@@ -269,7 +269,7 @@ acpi_walk_resources(acpi_handle device_handle,
/* Walk the resource list */
for (;;) {
if (!resource || resource->id == ACPI_RSTYPE_END_TAG) {
if (!resource || resource->type == ACPI_RSTYPE_END_TAG) {
break;
}
......@@ -360,8 +360,8 @@ EXPORT_SYMBOL(acpi_set_current_resources);
*
* FUNCTION: acpi_resource_to_address64
*
* PARAMETERS: resource - Pointer to a resource
* out - Pointer to the users's return
* PARAMETERS: Resource - Pointer to a resource
* Out - Pointer to the users's return
* buffer (a struct
* struct acpi_resource_address64)
*
......@@ -381,7 +381,7 @@ acpi_resource_to_address64(struct acpi_resource *resource,
struct acpi_resource_address16 *address16;
struct acpi_resource_address32 *address32;
switch (resource->id) {
switch (resource->type) {
case ACPI_RSTYPE_ADDRESS16:
address16 = (struct acpi_resource_address16 *)&resource->data;
......
......@@ -811,7 +811,7 @@ u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc)
while (buffer < end_buffer) {
buffer_byte = *buffer;
if (buffer_byte & ACPI_RDESC_TYPE_MASK) {
if (buffer_byte & ACPI_RDESC_TYPE_LARGE) {
/* Large Descriptor - Length is next 2 bytes */
buffer += ((*(buffer + 1) | (*(buffer + 2) << 8)) + 3);
......
......@@ -214,7 +214,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
* the ACPI subsystem code.
*/
for (i = mutex_id; i < MAX_MUTEX; i++) {
if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) {
if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
if (i == mutex_id) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Mutex [%s] already acquired by this thread [%X]\n",
......@@ -313,7 +313,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
* the ACPI subsystem code.
*/
for (i = mutex_id; i < MAX_MUTEX; i++) {
if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) {
if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
if (i == mutex_id) {
continue;
}
......
......@@ -61,9 +61,9 @@
*
*/
/* Version string */
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20050902
#define ACPI_CA_VERSION 0x20050916
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
......
......@@ -187,73 +187,73 @@ void acpi_dm_decode_attribute(u8 attribute);
* dmresrcl
*/
void
acpi_dm_word_descriptor(struct asl_word_address_desc *resource,
acpi_dm_word_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource,
acpi_dm_dword_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource,
acpi_dm_extended_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource,
acpi_dm_qword_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource,
acpi_dm_memory24_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource,
acpi_dm_memory32_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource,
acpi_dm_fixed_memory32_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource,
acpi_dm_generic_register_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource,
acpi_dm_interrupt_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource,
acpi_dm_vendor_large_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
/*
* dmresrcs
*/
void
acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource,
acpi_dm_irq_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource,
acpi_dm_dma_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level);
acpi_dm_io_descriptor(union asl_resource_desc *resource, u32 length, u32 level);
void
acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource,
acpi_dm_fixed_io_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource,
acpi_dm_start_dependent_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource,
acpi_dm_end_dependent_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
void
acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource,
acpi_dm_vendor_small_descriptor(union asl_resource_desc *resource,
u32 length, u32 level);
/*
......
......@@ -744,12 +744,13 @@ struct acpi_bit_register_info {
#define ACPI_RDESC_TYPE_LARGE 0x80
#define ACPI_RDESC_TYPE_SMALL 0x00
#define ACPI_RDESC_TYPE_MASK 0x80
#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
#define ACPI_RDESC_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
#define ACPI_RDESC_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
#define ACPI_RDESC_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
/*
* Small resource descriptor types
* Note: The 3 length bits (2:0) must be zero
* Note: Bits 2:0 are used for the descriptor length
*/
#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20
#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28
......@@ -757,6 +758,10 @@ struct acpi_bit_register_info {
#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38
#define ACPI_RDESC_TYPE_IO_PORT 0x40
#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48
#define ACPI_RDESC_TYPE_RESERVED_S1 0x50
#define ACPI_RDESC_TYPE_RESERVED_S2 0x58
#define ACPI_RDESC_TYPE_RESERVED_S3 0x60
#define ACPI_RDESC_TYPE_RESERVED_S4 0x68
#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70
#define ACPI_RDESC_TYPE_END_TAG 0x78
......@@ -764,7 +769,8 @@ struct acpi_bit_register_info {
* Large resource descriptor types
*/
#define ACPI_RDESC_TYPE_MEMORY_24 0x81
#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82
#define ACPI_RDESC_TYPE_GENERIC_REGISTER 0x82
#define ACPI_RDESC_TYPE_RESERVED_L1 0x83
#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84
#define ACPI_RDESC_TYPE_MEMORY_32 0x85
#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86
......@@ -773,6 +779,15 @@ struct acpi_bit_register_info {
#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89
#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B
#define ACPI_RDESC_LARGE_MAX 0x8B
/*
* Minimum lengths for descriptors with optional fields
*/
#define ACPI_RDESC_QWORD_MIN 43
#define ACPI_RDESC_DWORD_MIN 23
#define ACPI_RDESC_WORD_MIN 13
#define ACPI_RDESC_EXT_XRUPT_MIN 6
/*****************************************************************************
*
......
......@@ -110,7 +110,7 @@ acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
u32 byte_stream_buffer_length, u8 * output_buffer);
acpi_status
acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list,
acpi_rs_list_to_byte_stream(struct acpi_resource *resource,
acpi_size byte_stream_size_needed,
u8 * output_buffer);
......@@ -125,11 +125,11 @@ acpi_rs_fixed_io_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
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);
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);
acpi_status
......@@ -138,7 +138,7 @@ acpi_rs_irq_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_irq_stream(struct acpi_resource *linked_list,
acpi_rs_irq_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -147,7 +147,7 @@ acpi_rs_dma_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
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);
acpi_status
......@@ -156,7 +156,7 @@ acpi_rs_address16_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_address16_stream(struct acpi_resource *linked_list,
acpi_rs_address16_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -165,7 +165,7 @@ acpi_rs_address32_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_address32_stream(struct acpi_resource *linked_list,
acpi_rs_address32_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -174,7 +174,7 @@ acpi_rs_address64_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_address64_stream(struct acpi_resource *linked_list,
acpi_rs_address64_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -190,12 +190,12 @@ acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer,
acpi_size * structure_size);
acpi_status
acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list,
acpi_rs_start_depend_fns_stream(struct acpi_resource *resource,
u8 ** output_buffer,
acpi_size * bytes_consumed);
acpi_status
acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list,
acpi_rs_end_depend_fns_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -204,7 +204,7 @@ acpi_rs_memory24_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_memory24_stream(struct acpi_resource *linked_list,
acpi_rs_memory24_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -220,11 +220,11 @@ acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
acpi_size * structure_size);
acpi_status
acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
acpi_rs_memory32_range_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
acpi_rs_fixed_memory32_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -233,7 +233,7 @@ acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
acpi_rs_extended_irq_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -242,7 +242,7 @@ acpi_rs_end_tag_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_end_tag_stream(struct acpi_resource *linked_list,
acpi_rs_end_tag_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
acpi_status
......@@ -251,9 +251,23 @@ acpi_rs_vendor_resource(u8 * byte_stream_buffer,
u8 ** output_buffer, acpi_size * structure_size);
acpi_status
acpi_rs_vendor_stream(struct acpi_resource *linked_list,
acpi_rs_vendor_stream(struct acpi_resource *resource,
u8 ** output_buffer, acpi_size * bytes_consumed);
u8 acpi_rs_get_resource_type(u8 resource_start_byte);
/*
* rsmisc
*/
acpi_status
acpi_rs_generic_register_resource(u8 * byte_stream_buffer,
acpi_size * bytes_consumed,
u8 ** output_buffer,
acpi_size * structure_size);
acpi_status
acpi_rs_generic_register_stream(struct acpi_resource *resource,
u8 ** output_buffer,
acpi_size * bytes_consumed);
#endif /* __ACRESRC_H__ */
......@@ -1125,6 +1125,14 @@ struct acpi_resource_ext_irq {
u32 interrupts[1];
};
struct acpi_resource_generic_reg {
u32 space_id;
u32 bit_width;
u32 bit_offset;
u32 address_size;
u64 address;
};
/* ACPI_RESOURCE_TYPEs */
#define ACPI_RSTYPE_IRQ 0
......@@ -1142,6 +1150,8 @@ struct acpi_resource_ext_irq {
#define ACPI_RSTYPE_ADDRESS32 12
#define ACPI_RSTYPE_ADDRESS64 13
#define ACPI_RSTYPE_EXT_IRQ 14
#define ACPI_RSTYPE_GENERIC_REG 15
#define ACPI_RSTYPE_MAX 15
typedef u32 acpi_resource_type;
......@@ -1161,10 +1171,11 @@ union acpi_resource_data {
struct acpi_resource_address32 address32;
struct acpi_resource_address64 address64;
struct acpi_resource_ext_irq extended_irq;
struct acpi_resource_generic_reg generic_reg;
};
struct acpi_resource {
acpi_resource_type id;
acpi_resource_type type;
u32 length;
union acpi_resource_data data;
};
......
This diff is collapsed.
......@@ -68,6 +68,7 @@
#define ACPI_APPLICATION
#define ACPI_DEBUGGER
#define ACPI_DISASSEMBLER
#define ACPI_MUTEX_DEBUG
#endif
#ifdef ACPI_ASL_COMPILER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment