Commit 0897831b authored by Bob Moore's avatar Bob Moore Committed by Len Brown

[ACPI] ACPICA 20051021

Implemented support for the EM64T and other x86_64
processors. This essentially entails recognizing
that these processors support non-aligned memory
transfers. Previously, all 64-bit processors were assumed
to lack hardware support for non-aligned transfers.

Completed conversion of the Resource Manager to nearly
full table-driven operation. Specifically, the resource
conversion code (convert AML to internal format and the
reverse) and the debug code to dump internal resource
descriptors are fully table-driven, reducing code and data
size and improving maintainability.

The OSL interfaces for Acquire and Release Lock now use a
64-bit flag word on 64-bit processors instead of a fixed
32-bit word. (Alexey Starikovskiy)

Implemented support within the resource conversion code
for the Type-Specific byte within the various ACPI 3.0
*WordSpace macros.

Fixed some issues within the resource conversion code for
the type-specific flags for both Memory and I/O address
resource descriptors. For Memory, implemented support
for the MTP and TTP flags. For I/O, split the TRS and TTP
flags into two separate fields.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 50eca3eb
...@@ -195,7 +195,7 @@ add_io_space (struct pci_root_info *info, struct acpi_resource_address64 *addr) ...@@ -195,7 +195,7 @@ add_io_space (struct pci_root_info *info, struct acpi_resource_address64 *addr)
min = addr->minimum; min = addr->minimum;
max = min + addr->address_length - 1; max = min + addr->address_length - 1;
if (addr->attribute.io.translation_attribute == ACPI_SPARSE_TRANSLATION) if (addr->info.io.translation_type == ACPI_SPARSE_TRANSLATION)
sparse = 1; sparse = 1;
space_nr = new_space(addr->translation_offset, sparse); space_nr = new_space(addr->translation_offset, sparse);
......
...@@ -372,14 +372,14 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, ...@@ -372,14 +372,14 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
{ {
acpi_status status;
struct acpi_gpe_block_info *gpe_block;
struct acpi_gpe_register_info *gpe_register_info;
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
u8 enabled_status_byte; u8 enabled_status_byte;
struct acpi_gpe_register_info *gpe_register_info;
u32 status_reg; u32 status_reg;
u32 enable_reg; u32 enable_reg;
u32 flags; acpi_native_uint flags;
acpi_status status;
struct acpi_gpe_block_info *gpe_block;
acpi_native_uint i; acpi_native_uint i;
acpi_native_uint j; acpi_native_uint j;
......
...@@ -136,7 +136,7 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback) ...@@ -136,7 +136,7 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback)
struct acpi_gpe_block_info *gpe_block; struct acpi_gpe_block_info *gpe_block;
struct acpi_gpe_xrupt_info *gpe_xrupt_info; struct acpi_gpe_xrupt_info *gpe_xrupt_info;
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("ev_walk_gpe_list"); ACPI_FUNCTION_TRACE("ev_walk_gpe_list");
...@@ -479,7 +479,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 ...@@ -479,7 +479,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
struct acpi_gpe_xrupt_info *next_gpe_xrupt; struct acpi_gpe_xrupt_info *next_gpe_xrupt;
struct acpi_gpe_xrupt_info *gpe_xrupt; struct acpi_gpe_xrupt_info *gpe_xrupt;
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block"); ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block");
...@@ -553,7 +553,7 @@ static acpi_status ...@@ -553,7 +553,7 @@ static acpi_status
acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
{ {
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt"); ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt");
...@@ -610,7 +610,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, ...@@ -610,7 +610,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
struct acpi_gpe_block_info *next_gpe_block; struct acpi_gpe_block_info *next_gpe_block;
struct acpi_gpe_xrupt_info *gpe_xrupt_block; struct acpi_gpe_xrupt_info *gpe_xrupt_block;
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("ev_install_gpe_block"); ACPI_FUNCTION_TRACE("ev_install_gpe_block");
...@@ -663,7 +663,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, ...@@ -663,7 +663,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
{ {
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("ev_install_gpe_block"); ACPI_FUNCTION_TRACE("ev_install_gpe_block");
......
...@@ -562,7 +562,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, ...@@ -562,7 +562,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
struct acpi_gpe_event_info *gpe_event_info; struct acpi_gpe_event_info *gpe_event_info;
struct acpi_handler_info *handler; struct acpi_handler_info *handler;
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("acpi_install_gpe_handler"); ACPI_FUNCTION_TRACE("acpi_install_gpe_handler");
...@@ -653,7 +653,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, ...@@ -653,7 +653,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
struct acpi_gpe_event_info *gpe_event_info; struct acpi_gpe_event_info *gpe_event_info;
struct acpi_handler_info *handler; struct acpi_handler_info *handler;
acpi_status status; acpi_status status;
u32 flags; acpi_native_uint flags;
ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler"); ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler");
......
...@@ -625,9 +625,8 @@ acpi_ex_do_logical_op(u16 opcode, ...@@ -625,9 +625,8 @@ acpi_ex_do_logical_op(u16 opcode,
/* Lexicographic compare: compare the data bytes */ /* Lexicographic compare: compare the data bytes */
compare = ACPI_MEMCMP((const char *)operand0->buffer.pointer, compare = ACPI_MEMCMP(operand0->buffer.pointer,
(const char *)local_operand1->buffer. local_operand1->buffer.pointer,
pointer,
(length0 > length1) ? length1 : length0); (length0 > length1) ? length1 : length0);
switch (opcode) { switch (opcode) {
......
...@@ -77,7 +77,7 @@ acpi_ex_system_memory_space_handler(u32 function, ...@@ -77,7 +77,7 @@ acpi_ex_system_memory_space_handler(u32 function,
struct acpi_mem_space_context *mem_info = region_context; struct acpi_mem_space_context *mem_info = region_context;
u32 length; u32 length;
acpi_size window_size; acpi_size window_size;
#ifndef ACPI_MISALIGNED_TRANSFERS #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
u32 remainder; u32 remainder;
#endif #endif
...@@ -109,7 +109,7 @@ acpi_ex_system_memory_space_handler(u32 function, ...@@ -109,7 +109,7 @@ acpi_ex_system_memory_space_handler(u32 function,
return_ACPI_STATUS(AE_AML_OPERAND_VALUE); return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
} }
#ifndef ACPI_MISALIGNED_TRANSFERS #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
/* /*
* Hardware does not support non-aligned data transfers, we must verify * Hardware does not support non-aligned data transfers, we must verify
* the request. * the request.
......
...@@ -1058,11 +1058,9 @@ EXPORT_SYMBOL(max_cstate); ...@@ -1058,11 +1058,9 @@ EXPORT_SYMBOL(max_cstate);
* Acquire a spinlock. * Acquire a spinlock.
* *
* handle is a pointer to the spinlock_t. * handle is a pointer to the spinlock_t.
* flags is *not* the result of save_flags - it is an ACPI-specific flag variable
* that indicates whether we are at interrupt level.
*/ */
unsigned long acpi_os_acquire_lock(acpi_handle handle) acpi_native_uint acpi_os_acquire_lock(acpi_handle handle)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave((spinlock_t *) handle, flags); spin_lock_irqsave((spinlock_t *) handle, flags);
...@@ -1073,7 +1071,7 @@ unsigned long acpi_os_acquire_lock(acpi_handle handle) ...@@ -1073,7 +1071,7 @@ unsigned long acpi_os_acquire_lock(acpi_handle handle)
* Release a spinlock. See above. * Release a spinlock. See above.
*/ */
void acpi_os_release_lock(acpi_handle handle, unsigned long flags) void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags)
{ {
spin_unlock_irqrestore((spinlock_t *) handle, flags); spin_unlock_irqrestore((spinlock_t *) handle, flags);
} }
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("rscalc") ...@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("rscalc")
/* Local prototypes */ /* Local prototypes */
static u8 acpi_rs_count_set_bits(u16 bit_field); static u8 acpi_rs_count_set_bits(u16 bit_field);
static acpi_size static acpi_rs_length
acpi_rs_struct_option_length(struct acpi_resource_source *resource_source); acpi_rs_struct_option_length(struct acpi_resource_source *resource_source);
static u32 static u32
...@@ -100,7 +100,7 @@ static u8 acpi_rs_count_set_bits(u16 bit_field) ...@@ -100,7 +100,7 @@ static u8 acpi_rs_count_set_bits(u16 bit_field)
* *
******************************************************************************/ ******************************************************************************/
static acpi_size static acpi_rs_length
acpi_rs_struct_option_length(struct acpi_resource_source *resource_source) acpi_rs_struct_option_length(struct acpi_resource_source *resource_source)
{ {
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -111,7 +111,7 @@ acpi_rs_struct_option_length(struct acpi_resource_source *resource_source) ...@@ -111,7 +111,7 @@ acpi_rs_struct_option_length(struct acpi_resource_source *resource_source)
* resource_source_index (1). * resource_source_index (1).
*/ */
if (resource_source->string_ptr) { if (resource_source->string_ptr) {
return ((acpi_size) resource_source->string_length + 1); return ((acpi_rs_length) (resource_source->string_length + 1));
} }
return (0); return (0);
...@@ -184,7 +184,7 @@ acpi_status ...@@ -184,7 +184,7 @@ acpi_status
acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
{ {
acpi_size aml_size_needed = 0; acpi_size aml_size_needed = 0;
acpi_size segment_size; acpi_rs_length total_size;
ACPI_FUNCTION_TRACE("rs_get_aml_length"); ACPI_FUNCTION_TRACE("rs_get_aml_length");
...@@ -199,7 +199,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -199,7 +199,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
/* Get the base size of the (external stream) resource descriptor */ /* Get the base size of the (external stream) resource descriptor */
segment_size = acpi_gbl_aml_resource_sizes[resource->type]; total_size = acpi_gbl_aml_resource_sizes[resource->type];
/* /*
* Augment the base size for descriptors with optional and/or * Augment the base size for descriptors with optional and/or
...@@ -216,13 +216,14 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -216,13 +216,14 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
if (resource->data.vendor.byte_length > 7) { if (resource->data.vendor.byte_length > 7) {
/* Base size of a Large resource descriptor */ /* Base size of a Large resource descriptor */
segment_size = total_size =
sizeof(struct aml_resource_large_header); sizeof(struct aml_resource_large_header);
} }
/* Add the size of the vendor-specific data */ /* Add the size of the vendor-specific data */
segment_size += resource->data.vendor.byte_length; total_size = (acpi_rs_length)
(total_size + resource->data.vendor.byte_length);
break; break;
case ACPI_RESOURCE_TYPE_END_TAG: case ACPI_RESOURCE_TYPE_END_TAG:
...@@ -230,7 +231,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -230,7 +231,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
* End Tag: * End Tag:
* We are done -- return the accumulated total size. * We are done -- return the accumulated total size.
*/ */
*size_needed = aml_size_needed + segment_size; *size_needed = aml_size_needed + total_size;
/* Normal exit */ /* Normal exit */
...@@ -241,10 +242,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -241,10 +242,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
* 16-Bit Address Resource: * 16-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
segment_size += total_size = (acpi_rs_length)
acpi_rs_struct_option_length(&resource->data. (total_size +
address16. acpi_rs_struct_option_length(&resource->data.
resource_source); address16.
resource_source));
break; break;
case ACPI_RESOURCE_TYPE_ADDRESS32: case ACPI_RESOURCE_TYPE_ADDRESS32:
...@@ -252,10 +254,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -252,10 +254,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
* 32-Bit Address Resource: * 32-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
segment_size += total_size = (acpi_rs_length)
acpi_rs_struct_option_length(&resource->data. (total_size +
address32. acpi_rs_struct_option_length(&resource->data.
resource_source); address32.
resource_source));
break; break;
case ACPI_RESOURCE_TYPE_ADDRESS64: case ACPI_RESOURCE_TYPE_ADDRESS64:
...@@ -263,10 +266,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -263,10 +266,11 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
* 64-Bit Address Resource: * 64-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
segment_size += total_size = (acpi_rs_length)
acpi_rs_struct_option_length(&resource->data. (total_size +
address64. acpi_rs_struct_option_length(&resource->data.
resource_source); address64.
resource_source));
break; break;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
...@@ -275,16 +279,14 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -275,16 +279,14 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
* Add the size of each additional optional interrupt beyond the * Add the size of each additional optional interrupt beyond the
* required 1 (4 bytes for each u32 interrupt number) * required 1 (4 bytes for each u32 interrupt number)
*/ */
segment_size += (((acpi_size) total_size = (acpi_rs_length)
resource->data.extended_irq. (total_size +
interrupt_count - 1) * 4); ((resource->data.extended_irq.interrupt_count -
1) * 4) +
/* Add the size of the optional resource_source info */ /* Add the size of the optional resource_source info */
acpi_rs_struct_option_length(&resource->data.
segment_size += extended_irq.
acpi_rs_struct_option_length(&resource->data. resource_source));
extended_irq.
resource_source);
break; break;
default: default:
...@@ -293,7 +295,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -293,7 +295,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
/* Update the total */ /* Update the total */
aml_size_needed += segment_size; aml_size_needed += total_size;
/* Point to the next object */ /* Point to the next object */
...@@ -341,7 +343,7 @@ acpi_rs_get_list_length(u8 * aml_buffer, ...@@ -341,7 +343,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
while (bytes_parsed < aml_buffer_length) { while (bytes_parsed < aml_buffer_length) {
/* The next byte in the stream is the resource descriptor type */ /* The next byte in the stream is the resource descriptor type */
resource_type = acpi_rs_get_resource_type(*aml_buffer); resource_type = acpi_ut_get_resource_type(aml_buffer);
/* Get the base stream size and structure sizes for the descriptor */ /* Get the base stream size and structure sizes for the descriptor */
...@@ -352,10 +354,7 @@ acpi_rs_get_list_length(u8 * aml_buffer, ...@@ -352,10 +354,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
/* Get the Length field from the input resource descriptor */ /* Get the Length field from the input resource descriptor */
resource_length = resource_length = acpi_ut_get_resource_length(aml_buffer);
acpi_rs_get_resource_length(ACPI_CAST_PTR
(union aml_resource,
aml_buffer));
/* Augment the size for descriptors with optional fields */ /* Augment the size for descriptors with optional fields */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
ACPI_MODULE_NAME("rslist") ACPI_MODULE_NAME("rslist")
/* Local prototypes */ /* Local prototypes */
static ACPI_GET_RESOURCE_HANDLER acpi_rs_get_resource_handler(u8 resource_type); static struct acpi_rsconvert_info *acpi_rs_get_conversion_info(u8
resource_type);
static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml); static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml);
...@@ -83,7 +84,7 @@ static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml) ...@@ -83,7 +84,7 @@ static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml)
return (AE_AML_INVALID_RESOURCE_TYPE); return (AE_AML_INVALID_RESOURCE_TYPE);
} }
resource_length = acpi_rs_get_resource_length(aml); resource_length = acpi_ut_get_resource_length(aml);
minimum_aml_resource_length = minimum_aml_resource_length =
resource_info->minimum_aml_resource_length; resource_info->minimum_aml_resource_length;
...@@ -115,18 +116,17 @@ static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml) ...@@ -115,18 +116,17 @@ static acpi_status acpi_rs_validate_resource_length(union aml_resource *aml)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_rs_get_resource_handler * FUNCTION: acpi_rs_get_conversion_info
* *
* PARAMETERS: resource_type - Byte 0 of a resource descriptor * PARAMETERS: resource_type - Byte 0 of a resource descriptor
* *
* RETURN: Pointer to the resource conversion handler * RETURN: Pointer to the resource conversion info table
* *
* DESCRIPTION: Extract the Resource Type/Name from the first byte of * DESCRIPTION: Get the conversion table associated with this resource type
* a resource descriptor.
* *
******************************************************************************/ ******************************************************************************/
static ACPI_GET_RESOURCE_HANDLER acpi_rs_get_resource_handler(u8 resource_type) static struct acpi_rsconvert_info *acpi_rs_get_conversion_info(u8 resource_type)
{ {
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -174,33 +174,24 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer, ...@@ -174,33 +174,24 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
acpi_status status; acpi_status status;
acpi_size bytes_parsed = 0; acpi_size bytes_parsed = 0;
struct acpi_resource *resource; struct acpi_resource *resource;
u16 resource_length; acpi_rsdesc_size descriptor_length;
u32 descriptor_length; struct acpi_rsconvert_info *info;
ACPI_GET_RESOURCE_HANDLER handler;
ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources"); ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
/* Loop until end-of-buffer or an end_tag is found */ /* Loop until end-of-buffer or an end_tag is found */
while (bytes_parsed < aml_buffer_length) { while (bytes_parsed < aml_buffer_length) {
/* Get the handler associated with this Descriptor Type */ /* Get the conversion table associated with this Descriptor Type */
handler = acpi_rs_get_resource_handler(*aml_buffer); info = acpi_rs_get_conversion_info(*aml_buffer);
if (!handler) { if (!info) {
/* No handler indicates invalid resource type */ /* No table indicates an invalid resource type */
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
} }
resource_length = descriptor_length = acpi_ut_get_descriptor_length(aml_buffer);
acpi_rs_get_resource_length(ACPI_CAST_PTR
(union aml_resource,
aml_buffer));
descriptor_length =
acpi_rs_get_descriptor_length(ACPI_CAST_PTR
(union aml_resource,
aml_buffer));
/* /*
* Perform limited validation of the resource length, based upon * Perform limited validation of the resource length, based upon
...@@ -214,11 +205,16 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer, ...@@ -214,11 +205,16 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* Convert a byte stream resource to local resource struct */ /* Convert the AML byte stream resource to a local resource struct */
status = handler(ACPI_CAST_PTR(union aml_resource, aml_buffer), status =
resource_length, acpi_rs_convert_aml_to_resource(ACPI_CAST_PTR
ACPI_CAST_PTR(struct acpi_resource, buffer)); (struct acpi_resource,
buffer),
ACPI_CAST_PTR(union
aml_resource,
aml_buffer),
info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("Could not convert AML resource (type %X) to resource, %s\n", *aml_buffer, acpi_format_exception(status))); ACPI_REPORT_ERROR(("Could not convert AML resource (type %X) to resource, %s\n", *aml_buffer, acpi_format_exception(status)));
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -232,7 +228,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer, ...@@ -232,7 +228,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
/* Normal exit on completion of an end_tag resource descriptor */ /* Normal exit on completion of an end_tag resource descriptor */
if (acpi_rs_get_resource_type(*aml_buffer) == if (acpi_ut_get_resource_type(aml_buffer) ==
ACPI_RESOURCE_NAME_END_TAG) { ACPI_RESOURCE_NAME_END_TAG) {
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
...@@ -276,14 +272,15 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, ...@@ -276,14 +272,15 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
acpi_size aml_size_needed, u8 * output_buffer) acpi_size aml_size_needed, u8 * output_buffer)
{ {
u8 *aml_buffer = output_buffer; u8 *aml_buffer = output_buffer;
u8 *end_aml_buffer = output_buffer + aml_size_needed;
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("rs_convert_resources_to_aml"); ACPI_FUNCTION_TRACE("rs_convert_resources_to_aml");
/* Convert each resource descriptor in the list */ /* Walk the resource descriptor list, convert each descriptor */
while (1) { while (aml_buffer < end_aml_buffer) {
/* Validate Resource Descriptor Type before dispatch */ /* Validate the Resource Type */
if (resource->type > ACPI_RESOURCE_TYPE_MAX) { if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
...@@ -292,14 +289,14 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, ...@@ -292,14 +289,14 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
return_ACPI_STATUS(AE_BAD_DATA); return_ACPI_STATUS(AE_BAD_DATA);
} }
/* Perform the conversion per resource type */ /* Perform the conversion */
status = status = acpi_rs_convert_resource_to_aml(resource,
acpi_gbl_set_resource_dispatch[resource->type] (resource, ACPI_CAST_PTR(union
ACPI_CAST_PTR aml_resource,
(union aml_buffer),
aml_resource, acpi_gbl_set_resource_dispatch
aml_buffer)); [resource->type]);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("Could not convert resource (type %X) to AML, %s\n", resource->type, acpi_format_exception(status))); ACPI_REPORT_ERROR(("Could not convert resource (type %X) to AML, %s\n", resource->type, acpi_format_exception(status)));
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -323,18 +320,23 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, ...@@ -323,18 +320,23 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* Extract the total length of the new descriptor */ /*
/* Set the aml_buffer to point to the next (output) resource descriptor */ * Extract the total length of the new descriptor and set the
* aml_buffer to point to the next (output) resource descriptor
aml_buffer += */
acpi_rs_get_descriptor_length(ACPI_CAST_PTR aml_buffer += acpi_ut_get_descriptor_length(aml_buffer);
(union aml_resource,
aml_buffer));
/* Point to the next input resource descriptor */ /* Point to the next input resource descriptor */
resource = resource =
ACPI_PTR_ADD(struct acpi_resource, resource, ACPI_PTR_ADD(struct acpi_resource, resource,
resource->length); resource->length);
/* Check for end-of-list, normal exit */
} }
/* Completed buffer, but did not find an end_tag resource descriptor */
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -57,7 +57,7 @@ ACPI_MODULE_NAME("rsxface") ...@@ -57,7 +57,7 @@ ACPI_MODULE_NAME("rsxface")
ACPI_COPY_FIELD(out, in, decode); \ ACPI_COPY_FIELD(out, in, decode); \
ACPI_COPY_FIELD(out, in, min_address_fixed); \ ACPI_COPY_FIELD(out, in, min_address_fixed); \
ACPI_COPY_FIELD(out, in, max_address_fixed); \ ACPI_COPY_FIELD(out, in, max_address_fixed); \
ACPI_COPY_FIELD(out, in, attribute); \ ACPI_COPY_FIELD(out, in, info); \
ACPI_COPY_FIELD(out, in, granularity); \ ACPI_COPY_FIELD(out, in, granularity); \
ACPI_COPY_FIELD(out, in, minimum); \ ACPI_COPY_FIELD(out, in, minimum); \
ACPI_COPY_FIELD(out, in, maximum); \ ACPI_COPY_FIELD(out, in, maximum); \
......
...@@ -94,9 +94,8 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc) ...@@ -94,9 +94,8 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc)
new_table_desc->pointer->length) new_table_desc->pointer->length)
&& &&
(!ACPI_MEMCMP (!ACPI_MEMCMP
((const char *)table_desc->pointer, (table_desc->pointer, new_table_desc->pointer,
(const char *)new_table_desc->pointer, new_table_desc->pointer->length))) {
(acpi_size) new_table_desc->pointer->length))) {
/* Match: this table is already installed */ /* Match: this table is already installed */
ACPI_DEBUG_PRINT((ACPI_DB_TABLES, ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
......
...@@ -866,7 +866,7 @@ void acpi_ut_dump_allocations(u32 component, char *module) ...@@ -866,7 +866,7 @@ void acpi_ut_dump_allocations(u32 component, char *module)
if (!num_outstanding) { if (!num_outstanding) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"No outstanding allocations.\n")); "No outstanding allocations\n"));
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"%d(%X) Outstanding allocations\n", "%d(%X) Outstanding allocations\n",
......
...@@ -217,23 +217,23 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = { ...@@ -217,23 +217,23 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = {
* 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
* perform a Notify() operation on it. * perform a Notify() operation on it.
*/ */
const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
{ {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_THERMAL, NULL}, {"_TZ_", ACPI_TYPE_THERMAL, NULL},
{"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL}, {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, (char *)1}, {"_GL_", ACPI_TYPE_MUTEX, (char *)1},
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, (char *)1}, {"_OSI", ACPI_TYPE_METHOD, (char *)1},
#endif #endif
/* Table terminator */ /* Table terminator */
{NULL, ACPI_TYPE_ANY, NULL} {NULL, ACPI_TYPE_ANY, NULL}
}; };
/* /*
...@@ -503,11 +503,13 @@ char *acpi_ut_get_region_name(u8 space_id) ...@@ -503,11 +503,13 @@ char *acpi_ut_get_region_name(u8 space_id)
/* Event type decoding */ /* Event type decoding */
static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {
/*! [Begin] no source code translation (keep these strings as-is) */
"PM_Timer", "PM_Timer",
"global_lock", "GlobalLock",
"power_button", "PowerButton",
"sleep_button", "SleepButton",
"real_time_clock", "RealTimeClock",
/*! [End] no source code translation !*/
}; };
char *acpi_ut_get_event_name(u32 event_id) char *acpi_ut_get_event_name(u32 event_id)
...@@ -545,12 +547,13 @@ static const char acpi_gbl_bad_type[] = "UNDEFINED"; ...@@ -545,12 +547,13 @@ static const char acpi_gbl_bad_type[] = "UNDEFINED";
/* Printable names of the ACPI object types */ /* Printable names of the ACPI object types */
static const char *acpi_gbl_ns_type_names[] = { static const char *acpi_gbl_ns_type_names[] = {
/*! [Begin] no source code translation (keep these strings as-is) */
/* 00 */ "Untyped", /* 00 */ "Untyped",
/* 01 */ "Integer", /* 01 */ "Integer",
/* 02 */ "String", /* 02 */ "String",
/* 03 */ "Buffer", /* 03 */ "Buffer",
/* 04 */ "Package", /* 04 */ "Package",
/* 05 */ "field_unit", /* 05 */ "FieldUnit",
/* 06 */ "Device", /* 06 */ "Device",
/* 07 */ "Event", /* 07 */ "Event",
/* 08 */ "Method", /* 08 */ "Method",
...@@ -559,23 +562,24 @@ static const char *acpi_gbl_ns_type_names[] = { ...@@ -559,23 +562,24 @@ static const char *acpi_gbl_ns_type_names[] = {
/* 11 */ "Power", /* 11 */ "Power",
/* 12 */ "Processor", /* 12 */ "Processor",
/* 13 */ "Thermal", /* 13 */ "Thermal",
/* 14 */ "buffer_field", /* 14 */ "BufferField",
/* 15 */ "ddb_handle", /* 15 */ "DdbHandle",
/* 16 */ "debug_object", /* 16 */ "DebugObject",
/* 17 */ "region_field", /* 17 */ "RegionField",
/* 18 */ "bank_field", /* 18 */ "BankField",
/* 19 */ "index_field", /* 19 */ "IndexField",
/* 20 */ "Reference", /* 20 */ "Reference",
/* 21 */ "Alias", /* 21 */ "Alias",
/* 22 */ "method_alias", /* 22 */ "MethodAlias",
/* 23 */ "Notify", /* 23 */ "Notify",
/* 24 */ "addr_handler", /* 24 */ "AddrHandler",
/* 25 */ "resource_desc", /* 25 */ "ResourceDesc",
/* 26 */ "resource_fld", /* 26 */ "ResourceFld",
/* 27 */ "Scope", /* 27 */ "Scope",
/* 28 */ "Extra", /* 28 */ "Extra",
/* 29 */ "Data", /* 29 */ "Data",
/* 30 */ "Invalid" /* 30 */ "Invalid"
/*! [End] no source code translation !*/
}; };
char *acpi_ut_get_type_name(acpi_object_type type) char *acpi_ut_get_type_name(acpi_object_type type)
...@@ -658,15 +662,16 @@ char *acpi_ut_get_node_name(void *object) ...@@ -658,15 +662,16 @@ char *acpi_ut_get_node_name(void *object)
/* Printable names of object descriptor types */ /* Printable names of object descriptor types */
static const char *acpi_gbl_desc_type_names[] = { static const char *acpi_gbl_desc_type_names[] = {
/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
/* 00 */ "Invalid", /* 00 */ "Invalid",
/* 01 */ "Cached", /* 01 */ "Cached",
/* 02 */ "State-Generic", /* 02 */ "State-Generic",
/* 03 */ "State-Update", /* 03 */ "State-Update",
/* 04 */ "State-Package", /* 04 */ "State-Package",
/* 05 */ "State-Control", /* 05 */ "State-Control",
/* 06 */ "State-root_parse_scope", /* 06 */ "State-RootParseScope",
/* 07 */ "State-parse_scope", /* 07 */ "State-ParseScope",
/* 08 */ "State-walk_scope", /* 08 */ "State-WalkScope",
/* 09 */ "State-Result", /* 09 */ "State-Result",
/* 10 */ "State-Notify", /* 10 */ "State-Notify",
/* 11 */ "State-Thread", /* 11 */ "State-Thread",
...@@ -674,6 +679,7 @@ static const char *acpi_gbl_desc_type_names[] = { ...@@ -674,6 +679,7 @@ static const char *acpi_gbl_desc_type_names[] = {
/* 13 */ "Parser", /* 13 */ "Parser",
/* 14 */ "Operand", /* 14 */ "Operand",
/* 15 */ "Node" /* 15 */ "Node"
/*! [End] no source code translation !*/
}; };
char *acpi_ut_get_descriptor_name(void *object) char *acpi_ut_get_descriptor_name(void *object)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/amlresrc.h>
#define _COMPONENT ACPI_UTILITIES #define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME("utmisc") ACPI_MODULE_NAME("utmisc")
...@@ -788,6 +789,113 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length) ...@@ -788,6 +789,113 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
return ((u8) (0 - sum)); return ((u8) (0 - sum));
} }
/*******************************************************************************
*
* FUNCTION: acpi_ut_get_resource_type
*
* PARAMETERS: Aml - Pointer to the raw AML resource descriptor
*
* RETURN: The Resource Type with no extraneous bits (except the
* Large/Small descriptor bit -- this is left alone)
*
* DESCRIPTION: Extract the Resource Type/Name from the first byte of
* a resource descriptor.
*
******************************************************************************/
u8 acpi_ut_get_resource_type(void *aml)
{
ACPI_FUNCTION_ENTRY();
/*
* Byte 0 contains the descriptor name (Resource Type)
* Determine if this is a small or large resource
*/
if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
/* Large Resource Type -- bits 6:0 contain the name */
return (*((u8 *) aml));
} else {
/* Small Resource Type -- bits 6:3 contain the name */
return ((u8) (*((u8 *) aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
}
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_get_resource_length
*
* PARAMETERS: Aml - Pointer to the raw AML resource descriptor
*
* RETURN: Byte Length
*
* DESCRIPTION: Get the "Resource Length" of a raw AML descriptor. By
* definition, this does not include the size of the descriptor
* header or the length field itself.
*
******************************************************************************/
u16 acpi_ut_get_resource_length(void *aml)
{
u16 resource_length;
ACPI_FUNCTION_ENTRY();
/*
* Byte 0 contains the descriptor name (Resource Type)
* Determine if this is a small or large resource
*/
if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
/* Large Resource type -- bytes 1-2 contain the 16-bit length */
ACPI_MOVE_16_TO_16(&resource_length, &((u8 *) aml)[1]);
} else {
/* Small Resource type -- bits 2:0 of byte 0 contain the length */
resource_length = (u16) (*((u8 *) aml) &
ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
}
return (resource_length);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_get_descriptor_length
*
* PARAMETERS: Aml - Pointer to the raw AML resource descriptor
*
* RETURN: Byte length
*
* DESCRIPTION: Get the total byte length of a raw AML descriptor, including the
* length of the descriptor header and the length field itself.
* Used to walk descriptor lists.
*
******************************************************************************/
u32 acpi_ut_get_descriptor_length(void *aml)
{
u32 descriptor_length;
ACPI_FUNCTION_ENTRY();
/* First get the Resource Length (Does not include header length) */
descriptor_length = acpi_ut_get_resource_length(aml);
/* Determine if this is a small or large resource */
if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
descriptor_length += sizeof(struct aml_resource_large_header);
} else {
descriptor_length += sizeof(struct aml_resource_small_header);
}
return (descriptor_length);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ut_get_resource_end_tag * FUNCTION: acpi_ut_get_resource_end_tag
...@@ -796,42 +904,34 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length) ...@@ -796,42 +904,34 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
* *
* RETURN: Pointer to the end tag * RETURN: Pointer to the end tag
* *
* DESCRIPTION: Find the END_TAG resource descriptor in a resource template * DESCRIPTION: Find the END_TAG resource descriptor in an AML resource template
* *
******************************************************************************/ ******************************************************************************/
u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc) u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc)
{ {
u8 buffer_byte; u8 *aml;
u8 *buffer; u8 *end_aml;
u8 *end_buffer;
buffer = obj_desc->buffer.pointer;
end_buffer = buffer + obj_desc->buffer.length;
while (buffer < end_buffer) { aml = obj_desc->buffer.pointer;
buffer_byte = *buffer; end_aml = aml + obj_desc->buffer.length;
if (buffer_byte & ACPI_RESOURCE_NAME_LARGE) {
/* Large Descriptor - Length is next 2 bytes */
buffer += ((*(buffer + 1) | (*(buffer + 2) << 8)) + 3); /* Walk the resource template, one descriptor per loop */
} else {
/* Small Descriptor. End Tag will be found here */
if ((buffer_byte & ACPI_RESOURCE_NAME_SMALL_MASK) == while (aml < end_aml) {
ACPI_RESOURCE_NAME_END_TAG) { if (acpi_ut_get_resource_type(aml) ==
/* Found the end tag descriptor, all done. */ ACPI_RESOURCE_NAME_END_TAG) {
/* Found the end_tag descriptor, all done */
return (buffer); return (aml);
} }
/* Length is in the header */ /* Point to the next resource descriptor */
buffer += ((buffer_byte & 0x07) + 1); aml += acpi_ut_get_resource_length(aml);
}
} }
/* End tag not found */ /* End tag was not found */
return (NULL); return (NULL);
} }
......
...@@ -401,7 +401,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option, ...@@ -401,7 +401,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option,
mem->align = p->alignment; mem->align = p->alignment;
mem->size = p->address_length; mem->size = p->address_length;
mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option,mem);
...@@ -424,7 +424,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option, ...@@ -424,7 +424,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option,
mem->align = p->alignment; mem->align = p->alignment;
mem->size = p->address_length; mem->size = p->address_length;
mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option,mem);
...@@ -446,7 +446,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, ...@@ -446,7 +446,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
mem->size = p->address_length; mem->size = p->address_length;
mem->align = 0; mem->align = 0;
mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option,mem);
...@@ -734,7 +734,7 @@ static void pnpacpi_encode_mem24(struct acpi_resource *resource, ...@@ -734,7 +734,7 @@ static void pnpacpi_encode_mem24(struct acpi_resource *resource,
resource->type = ACPI_RESOURCE_TYPE_MEMORY24; resource->type = ACPI_RESOURCE_TYPE_MEMORY24;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
/* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */ /* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */
resource->data.memory24.read_write_attribute = resource->data.memory24.write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ? (p->flags & IORESOURCE_MEM_WRITEABLE) ?
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
resource->data.memory24.minimum = p->start; resource->data.memory24.minimum = p->start;
...@@ -748,7 +748,7 @@ static void pnpacpi_encode_mem32(struct acpi_resource *resource, ...@@ -748,7 +748,7 @@ static void pnpacpi_encode_mem32(struct acpi_resource *resource,
{ {
resource->type = ACPI_RESOURCE_TYPE_MEMORY32; resource->type = ACPI_RESOURCE_TYPE_MEMORY32;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.memory32.read_write_attribute = resource->data.memory32.write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ? (p->flags & IORESOURCE_MEM_WRITEABLE) ?
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
resource->data.memory32.minimum = p->start; resource->data.memory32.minimum = p->start;
...@@ -762,7 +762,7 @@ static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource, ...@@ -762,7 +762,7 @@ static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource,
{ {
resource->type = ACPI_RESOURCE_TYPE_FIXED_MEMORY32; resource->type = ACPI_RESOURCE_TYPE_FIXED_MEMORY32;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.fixed_memory32.read_write_attribute = resource->data.fixed_memory32.write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ? (p->flags & IORESOURCE_MEM_WRITEABLE) ?
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
resource->data.fixed_memory32.address = p->start; resource->data.fixed_memory32.address = p->start;
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */ /* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20050930 #define ACPI_CA_VERSION 0x20051021
/* /*
* OS name, used for the _OS object. The _OS object is essentially obsolete, * OS name, used for the _OS object. The _OS object is essentially obsolete,
......
...@@ -60,6 +60,7 @@ extern struct acpi_external_list *acpi_gbl_external_list; ...@@ -60,6 +60,7 @@ extern struct acpi_external_list *acpi_gbl_external_list;
extern const char *acpi_gbl_io_decode[2]; extern const char *acpi_gbl_io_decode[2];
extern const char *acpi_gbl_word_decode[4]; extern const char *acpi_gbl_word_decode[4];
extern const char *acpi_gbl_consume_decode[2]; extern const char *acpi_gbl_consume_decode[2];
extern const char *acpi_gbl_config_decode[4];
extern const char *acpi_gbl_min_decode[2]; extern const char *acpi_gbl_min_decode[2];
extern const char *acpi_gbl_max_decode[2]; extern const char *acpi_gbl_max_decode[2];
extern const char *acpi_gbl_DECdecode[2]; extern const char *acpi_gbl_DECdecode[2];
...@@ -171,11 +172,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); ...@@ -171,11 +172,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
/* /*
* dmresrc * dmresrc
*/ */
void acpi_dm_dump_integer8(u8 value, char *name);
void acpi_dm_dump_integer16(u16 value, char *name);
void acpi_dm_dump_integer32(u32 value, char *name);
void acpi_dm_dump_integer64(u64 value, char *name);
void void
acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, acpi_dm_resource_template(struct acpi_op_walk_info *info,
u8 * byte_data, u32 byte_count); u8 * byte_data, u32 byte_count);
u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
void acpi_dm_indent(u32 level); void acpi_dm_indent(u32 level);
...@@ -223,6 +232,8 @@ void ...@@ -223,6 +232,8 @@ void
acpi_dm_vendor_large_descriptor(union aml_resource *resource, acpi_dm_vendor_large_descriptor(union aml_resource *resource,
u32 length, u32 level); u32 length, u32 level);
void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
/* /*
* dmresrcs * dmresrcs
*/ */
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
#ifdef ACPI_MISALIGNED_TRANSFERS #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
/* The hardware supports unaligned transfers, just do the little-endian move */ /* The hardware supports unaligned transfers, just do the little-endian move */
...@@ -563,11 +563,11 @@ ...@@ -563,11 +563,11 @@
return (_s); }) return (_s); })
#define return_UINT8(s) ACPI_DO_WHILE0 ({ \ #define return_UINT8(s) ACPI_DO_WHILE0 ({ \
register u8 _s = (u8) (s); \ register u8 _s = (u8) (s); \
acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
return (_s); }) return (_s); })
#define return_UINT32(s) ACPI_DO_WHILE0 ({ \ #define return_UINT32(s) ACPI_DO_WHILE0 ({ \
register u32 _s = (u32) (s); \ register u32 _s = (u32) (s); \
acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
return (_s); }) return (_s); })
#else /* Use original less-safe macros */ #else /* Use original less-safe macros */
......
...@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle); ...@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle);
void acpi_os_delete_lock(acpi_handle handle); void acpi_os_delete_lock(acpi_handle handle);
unsigned long acpi_os_acquire_lock(acpi_handle handle); acpi_native_uint acpi_os_acquire_lock(acpi_handle handle);
void acpi_os_release_lock(acpi_handle handle, unsigned long flags); void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags);
/* /*
* Memory allocation and mapping * Memory allocation and mapping
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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