Commit 4b83d8cb authored by Andy Grover's avatar Andy Grover

ACPI: interpreter update to 20030418

- Fix for big-endian arcitectures
parent 8f44c5c2
......@@ -249,9 +249,9 @@ acpi_ds_get_field_names (
* In field_flags, preserve the flag bits other than the ACCESS_TYPE bits
*/
info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
((u8) (arg->common.value.integer32 >> 8)));
((u8) ((u32) arg->common.value.integer >> 8)));
info->attribute = (u8) (arg->common.value.integer32);
info->attribute = (u8) (arg->common.value.integer);
break;
......@@ -356,7 +356,7 @@ acpi_ds_create_field (
/* Second arg is the field flags */
arg = arg->common.next;
info.field_flags = arg->common.value.integer8;
info.field_flags = (u8) arg->common.value.integer;
info.attribute = 0;
/* Each remaining arg is a Named Field */
......@@ -509,12 +509,12 @@ acpi_ds_create_bank_field (
/* Third arg is the bank_value */
arg = arg->common.next;
info.bank_value = arg->common.value.integer32;
info.bank_value = (u32) arg->common.value.integer;
/* Fourth arg is the field flags */
arg = arg->common.next;
info.field_flags = arg->common.value.integer8;
info.field_flags = (u8) arg->common.value.integer;
/* Each remaining arg is a Named Field */
......@@ -580,7 +580,7 @@ acpi_ds_create_index_field (
/* Next arg is the field flags */
arg = arg->common.next;
info.field_flags = arg->common.value.integer8;
info.field_flags = (u8) arg->common.value.integer;
/* Each remaining arg is a Named Field */
......
......@@ -87,7 +87,7 @@ acpi_ds_method_data_init (
/* Init the method arguments */
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
ACPI_MOVE_32_TO_32 (&walk_state->arguments[i].name,
NAMEOF_ARG_NTE);
walk_state->arguments[i].name.integer |= (i << 24);
walk_state->arguments[i].descriptor = ACPI_DESC_TYPE_NAMED;
......@@ -98,7 +98,7 @@ acpi_ds_method_data_init (
/* Init the method locals */
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
ACPI_MOVE_32_TO_32 (&walk_state->local_variables[i].name,
NAMEOF_LOCAL_NTE);
walk_state->local_variables[i].name.integer |= (i << 24);
......
......@@ -187,7 +187,7 @@ acpi_ds_build_internal_buffer_obj (
return (AE_TYPE);
}
byte_list_length = byte_list->common.value.integer32;
byte_list_length = (u32) byte_list->common.value.integer;
}
/*
......
......@@ -647,7 +647,7 @@ acpi_ds_exec_end_op (
acpi_ds_delete_result_if_not_used (op, walk_state->result_obj, walk_state);
}
#if _UNDER_DEVELOPMENT
#ifdef _UNDER_DEVELOPMENT
if (walk_state->parser_state.aml == walk_state->parser_state.aml_end) {
acpi_db_method_end (walk_state);
......
......@@ -76,7 +76,7 @@ acpi_ev_get_gpe_event_info (
acpi_native_uint i;
ACPI_FUNCTION_NAME ("ev_get_gpe_event_info");
ACPI_FUNCTION_ENTRY ();
/* A NULL gpe_block means use the FADT-defined GPE block(s) */
......
......@@ -71,7 +71,7 @@ acpi_ev_valid_gpe_event (
struct acpi_gpe_block_info *gpe_block;
ACPI_FUNCTION_NAME ("ev_valid_gpe_event");
ACPI_FUNCTION_ENTRY ();
/* No need for spin lock since we are not changing any list elements */
......@@ -81,7 +81,7 @@ acpi_ev_valid_gpe_event (
gpe_block = gpe_xrupt_block->gpe_block_list_head;
while (gpe_block) {
if ((&gpe_block->event_info[0] <= gpe_event_info) &&
(&gpe_block->event_info[gpe_block->register_count * 8] > gpe_event_info)) {
(&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) {
return (TRUE);
}
......@@ -186,12 +186,12 @@ acpi_ev_save_method_info (
acpi_status status;
ACPI_FUNCTION_NAME ("ev_save_method_info");
ACPI_FUNCTION_TRACE ("ev_save_method_info");
/* Extract the name from the object and convert to a string */
ACPI_MOVE_UNALIGNED32_TO_32 (name,
ACPI_MOVE_32_TO_32 (name,
&((struct acpi_namespace_node *) obj_handle)->name.integer);
name[ACPI_NAME_SIZE] = 0;
......@@ -213,7 +213,7 @@ acpi_ev_save_method_info (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unknown GPE method type: %s (name not of form _Lnn or _Enn)\n",
name));
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* Convert the last two characters of the name to the GPE Number */
......@@ -225,7 +225,7 @@ acpi_ev_save_method_info (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not extract GPE number from name: %s (name is not of form _Lnn or _Enn)\n",
name));
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* Ensure that we have a valid GPE number for this GPE block */
......@@ -237,7 +237,7 @@ acpi_ev_save_method_info (
* However, it may be valid for a different GPE block, since GPE0 and GPE1
* methods both appear under \_GPE.
*/
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/*
......@@ -254,13 +254,13 @@ acpi_ev_save_method_info (
*/
status = acpi_hw_enable_gpe (gpe_event_info);
if (ACPI_FAILURE (status)) {
return (status);
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Registered GPE method %s as GPE number 0x%.2X\n",
name, gpe_number));
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
......@@ -279,7 +279,7 @@ acpi_ev_save_method_info (
*
******************************************************************************/
struct acpi_gpe_xrupt_info *
static struct acpi_gpe_xrupt_info *
acpi_ev_get_gpe_xrupt_block (
u32 interrupt_level)
{
......@@ -288,12 +288,15 @@ acpi_ev_get_gpe_xrupt_block (
acpi_status status;
ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block");
/* No need for spin lock since we are not changing any list elements here */
next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
while (next_gpe_xrupt) {
if (next_gpe_xrupt->interrupt_level == interrupt_level) {
return (next_gpe_xrupt);
return_PTR (next_gpe_xrupt);
}
next_gpe_xrupt = next_gpe_xrupt->next;
......@@ -303,7 +306,7 @@ acpi_ev_get_gpe_xrupt_block (
gpe_xrupt = ACPI_MEM_CALLOCATE (sizeof (struct acpi_gpe_xrupt_info));
if (!gpe_xrupt) {
return (NULL);
return_PTR (NULL);
}
gpe_xrupt->interrupt_level = interrupt_level;
......@@ -330,9 +333,15 @@ acpi_ev_get_gpe_xrupt_block (
if (interrupt_level != acpi_gbl_FADT->sci_int) {
status = acpi_os_install_interrupt_handler (interrupt_level,
acpi_ev_gpe_xrupt_handler, gpe_xrupt);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not install GPE interrupt handler at level 0x%X\n",
interrupt_level));
return_PTR (NULL);
}
}
return (gpe_xrupt);
return_PTR (gpe_xrupt);
}
......@@ -349,7 +358,7 @@ acpi_ev_get_gpe_xrupt_block (
*
******************************************************************************/
acpi_status
static acpi_status
acpi_ev_delete_gpe_xrupt (
struct acpi_gpe_xrupt_info *gpe_xrupt)
{
......@@ -406,7 +415,7 @@ acpi_ev_delete_gpe_xrupt (
*
******************************************************************************/
acpi_status
static acpi_status
acpi_ev_install_gpe_block (
struct acpi_gpe_block_info *gpe_block,
u32 interrupt_level)
......@@ -535,7 +544,7 @@ acpi_ev_delete_gpe_block (
*
******************************************************************************/
acpi_status
static acpi_status
acpi_ev_create_gpe_info_blocks (
struct acpi_gpe_block_info *gpe_block)
{
......
......@@ -315,9 +315,10 @@ acpi_ev_address_space_dispatch (
handler = handler_desc->addr_handler.handler;
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Addrhandler %p (%p), Address %8.8X%8.8X\n",
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
&region_obj->region.addr_handler->addr_handler, handler,
ACPI_HIDWORD (address), ACPI_LODWORD (address)));
ACPI_HIDWORD (address), ACPI_LODWORD (address),
acpi_ut_get_region_name (region_obj->region.space_id)));
if (!(handler_desc->addr_handler.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
/*
......
......@@ -159,16 +159,14 @@ acpi_install_address_space_handler (
}
}
/*
* If the caller hasn't specified a setup routine, use the default
*/
/* If the caller hasn't specified a setup routine, use the default */
if (!setup) {
setup = acpi_ev_default_region_setup;
}
/*
* Check for an existing internal object
*/
/* Check for an existing internal object */
obj_desc = acpi_ns_get_attached_object (node);
if (obj_desc) {
/*
......@@ -181,7 +179,7 @@ acpi_install_address_space_handler (
handler_obj = obj_desc->device.addr_handler;
while (handler_obj) {
/*
* We have an Address handler, see if user requested this
* Found an Address handler, see if user requested this
* address space.
*/
if(handler_obj->addr_handler.space_id == space_id) {
......@@ -189,9 +187,8 @@ acpi_install_address_space_handler (
goto unlock_and_exit;
}
/*
* Move through the linked list of handlers
*/
/* Walk the linked list of handlers */
handler_obj = handler_obj->addr_handler.next;
}
}
......@@ -232,10 +229,10 @@ acpi_install_address_space_handler (
acpi_ut_get_region_name (space_id), space_id, node->name.ascii, node, obj_desc));
/*
* Now we can install the handler
* Install the handler
*
* At this point we know that there is no existing handler.
* So, we just allocate the object for the handler and link it
* At this point there is no existing handler.
* Just allocate the object for the handler and link it
* into the list.
*/
handler_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
......@@ -254,15 +251,15 @@ acpi_install_address_space_handler (
handler_obj->addr_handler.setup = setup;
/*
* Now walk the namespace finding all of the regions this
* Walk the namespace finding all of the regions this
* handler will manage.
*
* We start at the device and search the branch toward
* Start at the device and search the branch toward
* the leaf nodes until either the leaf is encountered or
* a device is detected that has an address handler of the
* same type.
*
* In either case we back up and search down the remainder
* In either case, back up and search down the remainder
* of the branch
*/
status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device,
......@@ -270,9 +267,8 @@ acpi_install_address_space_handler (
acpi_ev_addr_handler_helper,
handler_obj, NULL);
/*
* Place this handler 1st on the list
*/
/* Place this handler 1st on the list */
handler_obj->common.reference_count =
(u16) (handler_obj->common.reference_count +
obj_desc->common.reference_count - 1);
......@@ -289,12 +285,13 @@ acpi_install_address_space_handler (
*
* FUNCTION: acpi_remove_address_space_handler
*
* PARAMETERS: space_id - The address space ID
* PARAMETERS: Device - Handle for the device
* space_id - The address space ID
* Handler - Address of the handler
*
* RETURN: Status
*
* DESCRIPTION: Install a handler for accesses on an Operation Region
* DESCRIPTION: Remove a previously installed handler.
*
******************************************************************************/
......@@ -342,19 +339,16 @@ acpi_remove_address_space_handler (
goto unlock_and_exit;
}
/*
* find the address handler the user requested
*/
/* Find the address handler the user requested */
handler_obj = obj_desc->device.addr_handler;
last_obj_ptr = &obj_desc->device.addr_handler;
while (handler_obj) {
/*
* We have a handler, see if user requested this one
*/
/* We have a handler, see if user requested this one */
if (handler_obj->addr_handler.space_id == space_id) {
/*
* Got it, first dereference this in the Regions
*/
/* Matched space_id, first dereference this in the Regions */
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Removing address handler %p(%p) for region %s on Device %p(%p)\n",
handler_obj, handler, acpi_ut_get_region_name (space_id),
......@@ -375,46 +369,37 @@ acpi_remove_address_space_handler (
acpi_ev_detach_region (region_obj, TRUE);
/*
* Walk the list, since we took the first region and it
* was removed from the list by the dissassociate call
* we just get the first item on the list again
* Walk the list: Just grab the head because the
* detach_region removed the previous head.
*/
region_obj = handler_obj->addr_handler.region_list;
}
/*
* Remove this Handler object from the list
*/
/* Remove this Handler object from the list */
*last_obj_ptr = handler_obj->addr_handler.next;
/*
* Now we can delete the handler object
*/
acpi_ut_remove_reference (handler_obj);
acpi_ut_remove_reference (handler_obj);
/* Now we can delete the handler object */
acpi_ut_remove_reference (handler_obj);
goto unlock_and_exit;
}
/*
* Move through the linked list of handlers
*/
/* Walk the linked list of handlers */
last_obj_ptr = &handler_obj->addr_handler.next;
handler_obj = handler_obj->addr_handler.next;
}
/* The handler does not exist */
/*
* The handler does not exist
*/
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Unable to remove address handler %p for %s(%X), dev_node %p, obj %p\n",
handler, acpi_ut_get_region_name (space_id), space_id, node, obj_desc));
status = AE_NOT_EXIST;
unlock_and_exit:
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
......
......@@ -568,9 +568,10 @@ acpi_ex_write_with_update_rule (
*
* PARAMETERS: Datum - Where the Datum is returned
* Buffer - Raw field buffer
* buffer_length - Entire length (used for big-endian only)
* byte_granularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
* Offset - Datum offset into the buffer
* buffer_offset - Datum offset into the buffer
*
* RETURN: none
*
......@@ -580,35 +581,44 @@ acpi_ex_write_with_update_rule (
******************************************************************************/
void
acpi_ex_get_buffer_datum(
acpi_ex_get_buffer_datum (
acpi_integer *datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 offset)
u32 buffer_offset)
{
u32 index;
ACPI_FUNCTION_ENTRY ();
/* Get proper index into buffer (handles big/little endian) */
index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
/* Move the requested number of bytes */
switch (byte_granularity) {
case ACPI_FIELD_BYTE_GRANULARITY:
*datum = ((u8 *) buffer) [offset];
*datum = ((u8 *) buffer) [index];
break;
case ACPI_FIELD_WORD_GRANULARITY:
ACPI_MOVE_UNALIGNED16_TO_32 (datum, &(((u16 *) buffer) [offset]));
ACPI_MOVE_16_TO_64 (datum, &(((u16 *) buffer) [index]));
break;
case ACPI_FIELD_DWORD_GRANULARITY:
ACPI_MOVE_UNALIGNED32_TO_32 (datum, &(((u32 *) buffer) [offset]));
ACPI_MOVE_32_TO_64 (datum, &(((u32 *) buffer) [index]));
break;
case ACPI_FIELD_QWORD_GRANULARITY:
ACPI_MOVE_UNALIGNED64_TO_64 (datum, &(((u64 *) buffer) [offset]));
ACPI_MOVE_64_TO_64 (datum, &(((u64 *) buffer) [index]));
break;
default:
......@@ -624,9 +634,10 @@ acpi_ex_get_buffer_datum(
*
* PARAMETERS: merged_datum - Value to store
* Buffer - Receiving buffer
* buffer_length - Entire length (used for big-endian only)
* byte_granularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
* Offset - Datum offset into the buffer
* buffer_offset - Datum offset into the buffer
*
* RETURN: none
*
......@@ -639,32 +650,40 @@ void
acpi_ex_set_buffer_datum (
acpi_integer merged_datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 offset)
u32 buffer_offset)
{
u32 index;
ACPI_FUNCTION_ENTRY ();
/* Get proper index into buffer (handles big/little endian) */
index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
/* Move the requested number of bytes */
switch (byte_granularity) {
case ACPI_FIELD_BYTE_GRANULARITY:
((u8 *) buffer) [offset] = (u8) merged_datum;
((u8 *) buffer) [index] = (u8) merged_datum;
break;
case ACPI_FIELD_WORD_GRANULARITY:
ACPI_MOVE_UNALIGNED16_TO_16 (&(((u16 *) buffer)[offset]), &merged_datum);
ACPI_MOVE_64_TO_16 (&(((u16 *) buffer)[index]), &merged_datum);
break;
case ACPI_FIELD_DWORD_GRANULARITY:
ACPI_MOVE_UNALIGNED32_TO_32 (&(((u32 *) buffer)[offset]), &merged_datum);
ACPI_MOVE_64_TO_32 (&(((u32 *) buffer)[index]), &merged_datum);
break;
case ACPI_FIELD_QWORD_GRANULARITY:
ACPI_MOVE_UNALIGNED64_TO_64 (&(((u64 *) buffer)[offset]), &merged_datum);
ACPI_MOVE_64_TO_64 (&(((u64 *) buffer)[index]), &merged_datum);
break;
default:
......@@ -762,8 +781,8 @@ acpi_ex_extract_from_field (
/* Store the datum to the caller buffer */
acpi_ex_set_buffer_datum (merged_datum, buffer, obj_desc->common_field.access_byte_width,
datum_offset);
acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
obj_desc->common_field.access_byte_width, datum_offset);
return_ACPI_STATUS (AE_OK);
}
......@@ -835,7 +854,7 @@ acpi_ex_extract_from_field (
* Store the merged field datum in the caller's buffer, according to
* the granularity of the field (size of each datum).
*/
acpi_ex_set_buffer_datum (merged_datum, buffer,
acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
obj_desc->common_field.access_byte_width, datum_offset);
/*
......@@ -916,7 +935,7 @@ acpi_ex_insert_into_field (
/* Get a single datum from the caller's buffer */
acpi_ex_get_buffer_datum (&previous_raw_datum, buffer,
acpi_ex_get_buffer_datum (&previous_raw_datum, buffer, buffer_length,
obj_desc->common_field.access_byte_width, datum_offset);
/*
......@@ -979,7 +998,7 @@ acpi_ex_insert_into_field (
* Get the next raw buffer datum. It may contain bits of the previous
* field datum
*/
acpi_ex_get_buffer_datum (&this_raw_datum, buffer,
acpi_ex_get_buffer_datum (&this_raw_datum, buffer, buffer_length,
obj_desc->common_field.access_byte_width, datum_offset);
/* Create the field datum based on the field alignment */
......
......@@ -83,7 +83,7 @@ acpi_ex_system_memory_space_handler (
struct acpi_mem_space_context *mem_info = region_context;
u32 length;
acpi_size window_size;
#ifndef _HW_ALIGNMENT_SUPPORT
#ifndef ACPI_MISALIGNED_TRANSFERS
u32 remainder;
#endif
......@@ -116,7 +116,7 @@ acpi_ex_system_memory_space_handler (
}
#ifndef _HW_ALIGNMENT_SUPPORT
#ifndef ACPI_MISALIGNED_TRANSFERS
/*
* Hardware does not support non-aligned data transfers, we must verify
* the request.
......@@ -283,6 +283,7 @@ acpi_ex_system_io_space_handler (
void *region_context)
{
acpi_status status = AE_OK;
u32 value32;
ACPI_FUNCTION_TRACE ("ex_system_io_space_handler");
......@@ -297,13 +298,13 @@ acpi_ex_system_io_space_handler (
switch (function) {
case ACPI_READ:
*value = 0;
status = acpi_os_read_port ((acpi_io_address) address, value, bit_width);
status = acpi_os_read_port ((acpi_io_address) address, &value32, bit_width);
*value = value32;
break;
case ACPI_WRITE:
status = acpi_os_write_port ((acpi_io_address) address, *value, bit_width);
status = acpi_os_write_port ((acpi_io_address) address, (u32) *value, bit_width);
break;
default:
......
......@@ -141,7 +141,7 @@ acpi_hw_set_mode (
/* BIOS should have disabled ALL fixed and GP events */
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd,
(acpi_integer) acpi_gbl_FADT->acpi_enable, 8);
(u32) acpi_gbl_FADT->acpi_enable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
break;
......@@ -152,7 +152,7 @@ acpi_hw_set_mode (
* enable bits to default
*/
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd,
(acpi_integer) acpi_gbl_FADT->acpi_disable, 8);
(u32) acpi_gbl_FADT->acpi_disable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Attempting to enable Legacy (non-ACPI) mode\n"));
break;
......
......@@ -424,7 +424,7 @@ acpi_hw_clear_gpe_block (
*
******************************************************************************/
acpi_status
static acpi_status
acpi_hw_disable_non_wakeup_gpe_block (
struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block)
......@@ -515,7 +515,7 @@ acpi_hw_disable_non_wakeup_gpes (
*
******************************************************************************/
acpi_status
static acpi_status
acpi_hw_enable_non_wakeup_gpe_block (
struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block)
......
......@@ -654,7 +654,7 @@ acpi_hw_register_write (
/* SMI_CMD is currently always in IO space */
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (acpi_integer) value, 8);
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, value, 8);
break;
......@@ -812,7 +812,7 @@ acpi_hw_low_level_write (
mem_address = (reg->address
+ (acpi_physical_address) offset);
status = acpi_os_write_memory (mem_address, (acpi_integer) value, width);
status = acpi_os_write_memory (mem_address, value, width);
break;
......@@ -821,7 +821,7 @@ acpi_hw_low_level_write (
io_address = (acpi_io_address) (reg->address
+ (acpi_physical_address) offset);
status = acpi_os_write_port (io_address, (acpi_integer) value, width);
status = acpi_os_write_port (io_address, value, width);
break;
......
......@@ -226,7 +226,7 @@ acpi_enter_sleep_state (
/* Clear wake status */
status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_LOCK);
status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
......@@ -238,7 +238,7 @@ acpi_enter_sleep_state (
/* Disable BM arbitration */
status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_LOCK);
status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
......@@ -327,11 +327,6 @@ acpi_enter_sleep_state (
} while (!in_value);
status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
return_ACPI_STATUS (AE_OK);
}
......@@ -366,7 +361,7 @@ acpi_enter_sleep_state_s4bios (
ACPI_FLUSH_CPU_CACHE();
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (acpi_integer) acpi_gbl_FADT->S4bios_req, 8);
status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (u32) acpi_gbl_FADT->S4bios_req, 8);
do {
acpi_os_stall(1000);
......
......@@ -527,7 +527,7 @@ acpi_ns_lookup (
/* Extract one ACPI name from the front of the pathname */
ACPI_MOVE_UNALIGNED32_TO_32 (&simple_name, path);
ACPI_MOVE_32_TO_32 (&simple_name, path);
/* Try to find the single (4 character) ACPI name */
......
......@@ -98,7 +98,7 @@ acpi_ns_build_external_path (
/* Put the name into the buffer */
ACPI_MOVE_UNALIGNED32_TO_32 ((name_buffer + index), &parent_node->name);
ACPI_MOVE_32_TO_32 ((name_buffer + index), &parent_node->name);
parent_node = acpi_ns_get_parent_node (parent_node);
/* Prefix name with the path separator */
......
......@@ -76,16 +76,22 @@ acpi_ns_report_error (
acpi_status lookup_status)
{
acpi_status status;
char *name;
char *name = NULL;
acpi_os_printf ("%8s-%04d: *** Error: Looking up ",
module_name, line_number);
if (lookup_status == AE_BAD_CHARACTER) {
/* There is a non-ascii character in the name */
acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n", *(ACPI_CAST_PTR (u32, internal_name)));
}
else {
/* Convert path to external format */
status = acpi_ns_externalize_name (ACPI_UINT32_MAX, internal_name, NULL, &name);
acpi_os_printf ("%8s-%04d: *** Error: Looking up ",
module_name, line_number);
/* Print target name */
if (ACPI_SUCCESS (status)) {
......@@ -95,12 +101,13 @@ acpi_ns_report_error (
acpi_os_printf ("[COULD NOT EXTERNALIZE NAME]");
}
acpi_os_printf (" in namespace, %s\n",
acpi_format_exception (lookup_status));
if (name) {
ACPI_MEM_FREE (name);
}
}
acpi_os_printf (" in namespace, %s\n",
acpi_format_exception (lookup_status));
}
......@@ -609,7 +616,7 @@ acpi_ns_externalize_name (
/* <count> 4-byte names */
names_index = prefix_length + 2;
num_segments = (u32) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
num_segments = (acpi_native_uint) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
break;
case AML_DUAL_NAME_PREFIX:
......
......@@ -524,8 +524,8 @@ acpi_ns_get_device_callback (
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
* starting (and ending) at the object specified by start_handle.
* The user_function is called whenever an object that matches
* the type parameter is found. If the user function returns
* The user_function is called whenever an object of type
* Device is found. If the user function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
*
......
......@@ -303,7 +303,7 @@ acpi_os_stall(u32 us)
acpi_status
acpi_os_read_port(
acpi_io_address port,
void *value,
u32 *value,
u32 width)
{
u32 dummy;
......@@ -332,7 +332,7 @@ acpi_os_read_port(
acpi_status
acpi_os_write_port(
acpi_io_address port,
acpi_integer value,
u32 value,
u32 width)
{
switch (width)
......@@ -356,7 +356,7 @@ acpi_os_write_port(
acpi_status
acpi_os_read_memory(
acpi_physical_address phys_addr,
void *value,
u32 *value,
u32 width)
{
u32 dummy;
......@@ -402,7 +402,7 @@ acpi_os_read_memory(
acpi_status
acpi_os_write_memory(
acpi_physical_address phys_addr,
acpi_integer value,
u32 value,
u32 width)
{
void *virt_addr;
......
......@@ -412,7 +412,7 @@ acpi_ps_get_next_simple_arg (
/* Get 2 bytes from the AML stream */
ACPI_MOVE_UNALIGNED16_TO_32 (&arg->common.value.integer, parser_state->aml);
ACPI_MOVE_16_TO_32 (&arg->common.value.integer, parser_state->aml);
parser_state->aml += 2;
break;
......@@ -423,7 +423,7 @@ acpi_ps_get_next_simple_arg (
/* Get 4 bytes from the AML stream */
ACPI_MOVE_UNALIGNED32_TO_32 (&arg->common.value.integer, parser_state->aml);
ACPI_MOVE_32_TO_32 (&arg->common.value.integer, parser_state->aml);
parser_state->aml += 4;
break;
......@@ -434,7 +434,7 @@ acpi_ps_get_next_simple_arg (
/* Get 8 bytes from the AML stream */
ACPI_MOVE_UNALIGNED64_TO_64 (&arg->common.value.integer, parser_state->aml);
ACPI_MOVE_64_TO_64 (&arg->common.value.integer, parser_state->aml);
parser_state->aml += 8;
break;
......@@ -533,7 +533,7 @@ acpi_ps_get_next_field (
/* Get the 4-character name */
ACPI_MOVE_UNALIGNED32_TO_32 (&name, parser_state->aml);
ACPI_MOVE_32_TO_32 (&name, parser_state->aml);
acpi_ps_set_name (field, name);
parser_state->aml += ACPI_NAME_SIZE;
......@@ -557,9 +557,9 @@ acpi_ps_get_next_field (
* Get access_type and access_attrib and merge into the field Op
* access_type is first operand, access_attribute is second
*/
field->common.value.integer32 = (ACPI_GET8 (parser_state->aml) << 8);
field->common.value.integer = (ACPI_GET8 (parser_state->aml) << 8);
parser_state->aml++;
field->common.value.integer32 |= ACPI_GET8 (parser_state->aml);
field->common.value.integer |= ACPI_GET8 (parser_state->aml);
parser_state->aml++;
break;
......
......@@ -92,7 +92,7 @@ acpi_rs_address16_resource (
* Point past the Descriptor to get the number of bytes consumed
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
*bytes_consumed = temp16 + 3;
output_struct->id = ACPI_RSTYPE_ADDRESS16;
......@@ -162,36 +162,31 @@ acpi_rs_address16_resource (
* Get Granularity (Bytes 6-7)
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.granularity,
buffer);
ACPI_MOVE_16_TO_32 (&output_struct->data.address16.granularity, buffer);
/*
* Get min_address_range (Bytes 8-9)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.min_address_range,
buffer);
ACPI_MOVE_16_TO_32 (&output_struct->data.address16.min_address_range, buffer);
/*
* Get max_address_range (Bytes 10-11)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.max_address_range,
buffer);
ACPI_MOVE_16_TO_32 (&output_struct->data.address16.max_address_range, buffer);
/*
* Get address_translation_offset (Bytes 12-13)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_translation_offset,
buffer);
ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_translation_offset, buffer);
/*
* Get address_length (Bytes 14-15)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_length,
buffer);
ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_length, buffer);
/*
* Resource Source Index (if present)
......@@ -360,36 +355,31 @@ acpi_rs_address16_stream (
/*
* Set the address space granularity
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
&linked_list->data.address16.granularity);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.granularity);
buffer += 2;
/*
* Set the address range minimum
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
&linked_list->data.address16.min_address_range);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.min_address_range);
buffer += 2;
/*
* Set the address range maximum
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
&linked_list->data.address16.max_address_range);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.max_address_range);
buffer += 2;
/*
* Set the address translation offset
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
&linked_list->data.address16.address_translation_offset);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_translation_offset);
buffer += 2;
/*
* Set the address length
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
&linked_list->data.address16.address_length);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_length);
buffer += 2;
/*
......@@ -413,7 +403,7 @@ acpi_rs_address16_stream (
* Buffer needs to be set to the length of the sting + one for the
* terminating null
*/
buffer += (ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1);
buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1);
}
/*
......@@ -427,7 +417,7 @@ acpi_rs_address16_stream (
* minus the header size (3 bytes)
*/
actual_bytes -= 3;
ACPI_MOVE_UNALIGNED16_TO_16 (length_field, &actual_bytes);
ACPI_MOVE_SIZE_TO_16 (length_field, &actual_bytes);
return_ACPI_STATUS (AE_OK);
}
......@@ -479,7 +469,7 @@ acpi_rs_address32_resource (
* Point past the Descriptor to get the number of bytes consumed
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
*bytes_consumed = temp16 + 3;
output_struct->id = ACPI_RSTYPE_ADDRESS32;
......@@ -553,36 +543,31 @@ acpi_rs_address32_resource (
* Get Granularity (Bytes 6-9)
*/
buffer += 1;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.granularity,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.address32.granularity, buffer);
/*
* Get min_address_range (Bytes 10-13)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.min_address_range,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.address32.min_address_range, buffer);
/*
* Get max_address_range (Bytes 14-17)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.max_address_range,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.address32.max_address_range, buffer);
/*
* Get address_translation_offset (Bytes 18-21)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_translation_offset,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_translation_offset, buffer);
/*
* Get address_length (Bytes 22-25)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_length,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_length, buffer);
/*
* Resource Source Index (if present)
......@@ -749,36 +734,31 @@ acpi_rs_address32_stream (
/*
* Set the address space granularity
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
&linked_list->data.address32.granularity);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.granularity);
buffer += 4;
/*
* Set the address range minimum
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
&linked_list->data.address32.min_address_range);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.min_address_range);
buffer += 4;
/*
* Set the address range maximum
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
&linked_list->data.address32.max_address_range);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.max_address_range);
buffer += 4;
/*
* Set the address translation offset
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
&linked_list->data.address32.address_translation_offset);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_translation_offset);
buffer += 4;
/*
* Set the address length
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
&linked_list->data.address32.address_length);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_length);
buffer += 4;
/*
......@@ -802,7 +782,7 @@ acpi_rs_address32_stream (
* Buffer needs to be set to the length of the sting + one for the
* terminating null
*/
buffer += (ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1);
buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1);
}
/*
......@@ -866,7 +846,7 @@ acpi_rs_address64_resource (
* Point past the Descriptor to get the number of bytes consumed
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
*bytes_consumed = temp16 + 3;
output_struct->id = ACPI_RSTYPE_ADDRESS64;
......@@ -941,36 +921,31 @@ acpi_rs_address64_resource (
* Get Granularity (Bytes 6-13)
*/
buffer += 1;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.granularity,
buffer);
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.granularity, buffer);
/*
* Get min_address_range (Bytes 14-21)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.min_address_range,
buffer);
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.min_address_range, buffer);
/*
* Get max_address_range (Bytes 22-29)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.max_address_range,
buffer);
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.max_address_range, buffer);
/*
* Get address_translation_offset (Bytes 30-37)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_translation_offset,
buffer);
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_translation_offset, buffer);
/*
* Get address_length (Bytes 38-45)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_length,
buffer);
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_length, buffer);
/*
* Resource Source Index (if present)
......@@ -1141,36 +1116,31 @@ acpi_rs_address64_stream (
/*
* Set the address space granularity
*/
ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
&linked_list->data.address64.granularity);
ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.granularity);
buffer += 8;
/*
* Set the address range minimum
*/
ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
&linked_list->data.address64.min_address_range);
ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.min_address_range);
buffer += 8;
/*
* Set the address range maximum
*/
ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
&linked_list->data.address64.max_address_range);
ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.max_address_range);
buffer += 8;
/*
* Set the address translation offset
*/
ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
&linked_list->data.address64.address_translation_offset);
ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_translation_offset);
buffer += 8;
/*
* Set the address length
*/
ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
&linked_list->data.address64.address_length);
ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_length);
buffer += 8;
/*
......@@ -1193,7 +1163,7 @@ acpi_rs_address64_stream (
* Buffer needs to be set to the length of the sting + one for the
* terminating null
*/
buffer += (ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1);
buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1);
}
/*
......
......@@ -349,7 +349,7 @@ acpi_rs_get_list_length (
buffer = byte_stream_buffer;
++buffer;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
bytes_consumed = temp16 + 3;
/*
......@@ -390,7 +390,7 @@ acpi_rs_get_list_length (
buffer = byte_stream_buffer;
++buffer;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
bytes_consumed = temp16 + 3;
......@@ -428,7 +428,7 @@ acpi_rs_get_list_length (
buffer = byte_stream_buffer;
++buffer;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
bytes_consumed = temp16 + 3;
......@@ -466,7 +466,7 @@ acpi_rs_get_list_length (
buffer = byte_stream_buffer;
++buffer;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
bytes_consumed = temp16 + 3;
......@@ -504,7 +504,7 @@ acpi_rs_get_list_length (
buffer = byte_stream_buffer;
++buffer;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
bytes_consumed = temp16 + 3;
......@@ -573,7 +573,7 @@ acpi_rs_get_list_length (
/*
* Look at the number of bits set
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
for (index = 0; index < 16; index++) {
if (temp16 & 0x1) {
......
......@@ -106,7 +106,7 @@ acpi_rs_io_resource (
* Check min_base Address
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
output_struct->data.io.min_base_address = temp16;
......@@ -114,7 +114,7 @@ acpi_rs_io_resource (
* Check max_base Address
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
output_struct->data.io.max_base_address = temp16;
......@@ -196,7 +196,7 @@ acpi_rs_fixed_io_resource (
* Check Range Base Address
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
output_struct->data.fixed_io.base_address = temp16;
......@@ -270,7 +270,7 @@ acpi_rs_io_stream (
*/
temp16 = (u16) linked_list->data.io.min_base_address;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -278,7 +278,7 @@ acpi_rs_io_stream (
*/
temp16 = (u16) linked_list->data.io.max_base_address;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -347,7 +347,7 @@ acpi_rs_fixed_io_stream (
*/
temp16 = (u16) linked_list->data.fixed_io.base_address;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......
......@@ -101,7 +101,7 @@ acpi_rs_irq_resource (
* Point to the 16-bits of Bytes 1 and 2
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
output_struct->data.irq.number_of_interrupts = 0;
......@@ -242,7 +242,7 @@ acpi_rs_irq_stream (
temp16 |= 0x1 << temp8;
}
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -317,7 +317,7 @@ acpi_rs_extended_irq_resource (
* Point past the Descriptor to get the number of bytes consumed
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
*bytes_consumed = temp16 + 3;
output_struct->id = ACPI_RSTYPE_EXT_IRQ;
......@@ -374,7 +374,7 @@ acpi_rs_extended_irq_resource (
* Cycle through every IRQ in the table
*/
for (index = 0; index < temp8; index++) {
ACPI_MOVE_UNALIGNED32_TO_32 (
ACPI_MOVE_32_TO_32 (
&output_struct->data.extended_irq.interrupts[index], buffer);
/* Point to the next IRQ */
......@@ -533,7 +533,7 @@ acpi_rs_extended_irq_stream (
for (index = 0; index < linked_list->data.extended_irq.number_of_interrupts;
index++) {
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
ACPI_MOVE_32_TO_32 (buffer,
&linked_list->data.extended_irq.interrupts[index]);
buffer += 4;
}
......@@ -557,7 +557,7 @@ acpi_rs_extended_irq_stream (
* Buffer needs to be set to the length of the sting + one for the
* terminating null
*/
buffer += (ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1);
buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1);
}
/*
......
......@@ -92,7 +92,7 @@ acpi_rs_memory24_resource (
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_MEM24;
......@@ -107,28 +107,28 @@ acpi_rs_memory24_resource (
/*
* Get min_base_address (Bytes 4-5)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
output_struct->data.memory24.min_base_address = temp16;
/*
* Get max_base_address (Bytes 6-7)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
output_struct->data.memory24.max_base_address = temp16;
/*
* Get Alignment (Bytes 8-9)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
output_struct->data.memory24.alignment = temp16;
/*
* Get range_length (Bytes 10-11)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
output_struct->data.memory24.range_length = temp16;
/*
......@@ -184,7 +184,7 @@ acpi_rs_memory24_stream (
* The length field is static
*/
temp16 = 0x09;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -197,25 +197,25 @@ acpi_rs_memory24_stream (
/*
* Set the Range minimum base address
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.min_base_address);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.min_base_address);
buffer += 2;
/*
* Set the Range maximum base address
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.max_base_address);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.max_base_address);
buffer += 2;
/*
* Set the base alignment
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.alignment);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.alignment);
buffer += 2;
/*
* Set the range length
*/
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.range_length);
ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.range_length);
buffer += 2;
/*
......@@ -269,7 +269,7 @@ acpi_rs_memory32_range_resource (
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
......@@ -296,27 +296,25 @@ acpi_rs_memory32_range_resource (
/*
* Get min_base_address (Bytes 4-7)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.min_base_address,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.min_base_address, buffer);
buffer += 4;
/*
* Get max_base_address (Bytes 8-11)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.max_base_address,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.max_base_address, buffer);
buffer += 4;
/*
* Get Alignment (Bytes 12-15)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.alignment, buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.alignment, buffer);
buffer += 4;
/*
* Get range_length (Bytes 16-19)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.range_length, buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.range_length, buffer);
/*
* Set the Length parameter
......@@ -373,7 +371,7 @@ acpi_rs_fixed_memory32_resource (
* Point past the Descriptor to get the number of bytes consumed
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
buffer += 2;
*bytes_consumed = (acpi_size) temp16 + 3;
......@@ -390,15 +388,13 @@ acpi_rs_fixed_memory32_resource (
/*
* Get range_base_address (Bytes 4-7)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_base_address,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_base_address, buffer);
buffer += 4;
/*
* Get range_length (Bytes 8-11)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_length,
buffer);
ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_length, buffer);
/*
* Set the Length parameter
......@@ -454,7 +450,7 @@ acpi_rs_memory32_range_stream (
*/
temp16 = 0x11;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -467,25 +463,25 @@ acpi_rs_memory32_range_stream (
/*
* Set the Range minimum base address
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.min_base_address);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.min_base_address);
buffer += 4;
/*
* Set the Range maximum base address
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.max_base_address);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.max_base_address);
buffer += 4;
/*
* Set the base alignment
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.alignment);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.alignment);
buffer += 4;
/*
* Set the range length
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.range_length);
ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.range_length);
buffer += 4;
/*
......@@ -537,7 +533,7 @@ acpi_rs_fixed_memory32_stream (
*/
temp16 = 0x09;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
/*
......@@ -550,14 +546,14 @@ acpi_rs_fixed_memory32_stream (
/*
* Set the Range base address
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
ACPI_MOVE_32_TO_32 (buffer,
&linked_list->data.fixed_memory32.range_base_address);
buffer += 4;
/*
* Set the range length
*/
ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
ACPI_MOVE_32_TO_32 (buffer,
&linked_list->data.fixed_memory32.range_length);
buffer += 4;
......
......@@ -211,7 +211,7 @@ acpi_rs_vendor_resource (
/* Dereference */
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
ACPI_MOVE_16_TO_16 (&temp16, buffer);
/* Calculate bytes consumed */
......@@ -307,7 +307,7 @@ acpi_rs_vendor_stream (
temp16 = (u16) linked_list->data.vendor_specific.length;
ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
ACPI_MOVE_16_TO_16 (buffer, &temp16);
buffer += 2;
}
else {
......
......@@ -339,20 +339,20 @@ acpi_set_current_resources (
}
#define COPY_FIELD(out, in, field) out->field = in->field
#define COPY_ADDRESS(out, in) \
COPY_FIELD(out, in, resource_type); \
COPY_FIELD(out, in, producer_consumer); \
COPY_FIELD(out, in, decode); \
COPY_FIELD(out, in, min_address_fixed); \
COPY_FIELD(out, in, max_address_fixed); \
COPY_FIELD(out, in, attribute); \
COPY_FIELD(out, in, granularity); \
COPY_FIELD(out, in, min_address_range); \
COPY_FIELD(out, in, max_address_range); \
COPY_FIELD(out, in, address_translation_offset); \
COPY_FIELD(out, in, address_length); \
COPY_FIELD(out, in, resource_source);
#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
#define ACPI_COPY_ADDRESS(out, in) \
ACPI_COPY_FIELD(out, in, resource_type); \
ACPI_COPY_FIELD(out, in, producer_consumer); \
ACPI_COPY_FIELD(out, in, decode); \
ACPI_COPY_FIELD(out, in, min_address_fixed); \
ACPI_COPY_FIELD(out, in, max_address_fixed); \
ACPI_COPY_FIELD(out, in, attribute); \
ACPI_COPY_FIELD(out, in, granularity); \
ACPI_COPY_FIELD(out, in, min_address_range); \
ACPI_COPY_FIELD(out, in, max_address_range); \
ACPI_COPY_FIELD(out, in, address_translation_offset); \
ACPI_COPY_FIELD(out, in, address_length); \
ACPI_COPY_FIELD(out, in, resource_source);
/******************************************************************************
*
......@@ -385,17 +385,17 @@ acpi_resource_to_address64 (
switch (resource->id) {
case ACPI_RSTYPE_ADDRESS16:
address16 = (struct acpi_resource_address16 *) &resource->data;
COPY_ADDRESS(out, address16);
ACPI_COPY_ADDRESS(out, address16);
break;
case ACPI_RSTYPE_ADDRESS32:
address32 = (struct acpi_resource_address32 *) &resource->data;
COPY_ADDRESS(out, address32);
ACPI_COPY_ADDRESS(out, address32);
break;
case ACPI_RSTYPE_ADDRESS64:
address64 = (struct acpi_resource_address64 *) &resource->data;
COPY_ADDRESS(out, address64);
ACPI_COPY_ADDRESS(out, address64);
break;
default:
......
......@@ -133,7 +133,7 @@ acpi_tb_validate_table_header (
/* Ensure that the signature is 4 ASCII characters */
ACPI_MOVE_UNALIGNED32_TO_32 (&signature, table_header->signature);
ACPI_MOVE_32_TO_32 (&signature, table_header->signature);
if (!acpi_ut_valid_acpi_name (signature)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Table signature at %p [%p] has invalid characters\n",
......
......@@ -559,8 +559,7 @@ acpi_ut_dump_buffer (
case DB_WORD_DISPLAY:
ACPI_MOVE_UNALIGNED16_TO_32 (&temp32,
&buffer[i + j]);
ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]);
acpi_os_printf ("%04X ", temp32);
j += 2;
break;
......@@ -568,8 +567,7 @@ acpi_ut_dump_buffer (
case DB_DWORD_DISPLAY:
ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
&buffer[i + j]);
ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
acpi_os_printf ("%08X ", temp32);
j += 4;
break;
......@@ -577,12 +575,10 @@ acpi_ut_dump_buffer (
case DB_QWORD_DISPLAY:
ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
&buffer[i + j]);
ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
acpi_os_printf ("%08X", temp32);
ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
&buffer[i + j + 4]);
ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]);
acpi_os_printf ("%08X ", temp32);
j += 8;
break;
......
......@@ -592,7 +592,7 @@ acpi_ut_mutex_terminate (
(void) acpi_ut_delete_mutex (i);
}
(void) acpi_os_delete_lock (acpi_gbl_gpe_lock);
acpi_os_delete_lock (acpi_gbl_gpe_lock);
return_VOID;
}
......
......@@ -47,7 +47,7 @@
/******************************************************************************
*
* Compile-time options
* Configuration options
*
*****************************************************************************/
......@@ -62,21 +62,9 @@
*
*/
/******************************************************************************
*
* Subsystem Constants
*
*****************************************************************************/
/* Version string */
#define ACPI_CA_VERSION 0x20030328
/* Version of ACPI supported */
#define ACPI_CA_SUPPORT_LEVEL 2
#define ACPI_CA_VERSION 0x20030418
/* Maximum objects in the various object caches */
......@@ -86,6 +74,23 @@
#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */
#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */
/*
* Should the subystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
#define ACPI_CHECKSUM_ABORT FALSE
/******************************************************************************
*
* Subsystem Constants
*
*****************************************************************************/
/* Version of ACPI supported */
#define ACPI_CA_SUPPORT_LEVEL 2
/* String size constants */
#define ACPI_MAX_STRING_LENGTH 512
......@@ -104,20 +109,6 @@
#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
/******************************************************************************
*
* Configuration of subsystem behavior
*
*****************************************************************************/
/*
* Should the subystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
#define ACPI_CHECKSUM_ABORT FALSE
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
......@@ -196,7 +187,6 @@
*
*****************************************************************************/
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
......
......@@ -164,15 +164,17 @@ void
acpi_ex_get_buffer_datum(
acpi_integer *datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 offset);
u32 buffer_offset);
void
acpi_ex_set_buffer_datum (
acpi_integer merged_datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 offset);
u32 buffer_offset);
acpi_status
acpi_ex_read_data_from_field (
......
......@@ -196,7 +196,7 @@ struct acpi_namespace_node
union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
struct acpi_namespace_node *child; /* first child */
struct acpi_namespace_node *child; /* First child */
struct acpi_namespace_node *peer; /* Next peer*/
u16 reference_count; /* Current count of references and children */
u8 flags;
......@@ -476,10 +476,10 @@ struct acpi_scope_state
struct acpi_pscope_state
{
ACPI_STATE_COMMON
union acpi_parse_object *op; /* current op being parsed */
u8 *arg_end; /* current argument end */
u8 *pkg_end; /* current package end */
u32 arg_list; /* next argument to parse */
union acpi_parse_object *op; /* Current op being parsed */
u8 *arg_end; /* Current argument end */
u8 *pkg_end; /* Current package end */
u32 arg_list; /* Next argument to parse */
u32 arg_count; /* Number of fixed arguments */
};
......@@ -585,11 +585,8 @@ struct acpi_opcode_info
union acpi_parse_value
{
acpi_integer integer; /* integer constant (Up to 64 bits) */
acpi_integer integer; /* Integer constant (Up to 64 bits) */
struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */
u32 integer32; /* integer constant, 32 bits only */
u16 integer16; /* integer constant, 16 bits only */
u8 integer8; /* integer constant, 8 bits only */
u32 size; /* bytelist or field size */
char *string; /* NULL terminated string */
u8 *buffer; /* buffer or string */
......@@ -602,15 +599,15 @@ union acpi_parse_value
u8 data_type; /* To differentiate various internal objs */\
u8 flags; /* Type of Op */\
u16 aml_opcode; /* AML opcode */\
u32 aml_offset; /* offset of declaration in AML */\
union acpi_parse_object *parent; /* parent op */\
union acpi_parse_object *next; /* next op */\
u32 aml_offset; /* Offset of declaration in AML */\
union acpi_parse_object *parent; /* Parent op */\
union acpi_parse_object *next; /* Next op */\
ACPI_DISASM_ONLY_MEMBERS (\
u8 disasm_flags; /* Used during AML disassembly */\
u8 disasm_opcode; /* Subtype used for disassembly */\
char aml_op_name[16]) /* op name (debug only) */\
char aml_op_name[16]) /* Op name (debug only) */\
/* NON-DEBUG members below: */\
struct acpi_namespace_node *node; /* for use by interpreter */\
struct acpi_namespace_node *node; /* For use by interpreter */\
union acpi_parse_value value; /* Value or args associated with the opcode */\
......@@ -691,14 +688,14 @@ union acpi_parse_object
struct acpi_parse_state
{
u32 aml_size;
u8 *aml_start; /* first AML byte */
u8 *aml; /* next AML byte */
u8 *aml_start; /* First AML byte */
u8 *aml; /* Next AML byte */
u8 *aml_end; /* (last + 1) AML byte */
u8 *pkg_start; /* current package begin */
u8 *pkg_end; /* current package end */
union acpi_parse_object *start_op; /* root of parse tree */
u8 *pkg_start; /* Current package begin */
u8 *pkg_end; /* Current package end */
union acpi_parse_object *start_op; /* Root of parse tree */
struct acpi_namespace_node *start_node;
union acpi_generic_state *scope; /* current scope */
union acpi_generic_state *scope; /* Current scope */
union acpi_parse_object *start_scope;
};
......
This diff is collapsed.
......@@ -229,13 +229,13 @@ acpi_os_stall (
acpi_status
acpi_os_read_port (
acpi_io_address address,
void *value,
u32 *value,
u32 width);
acpi_status
acpi_os_write_port (
acpi_io_address address,
acpi_integer value,
u32 value,
u32 width);
......@@ -246,13 +246,13 @@ acpi_os_write_port (
acpi_status
acpi_os_read_memory (
acpi_physical_address address,
void *value,
u32 *value,
u32 width);
acpi_status
acpi_os_write_memory (
acpi_physical_address address,
acpi_integer value,
u32 value,
u32 width);
......
......@@ -181,7 +181,15 @@ struct smart_battery_description_table
u32 critical_level;
};
struct hpet_description_table
{
struct acpi_table_header header;
u32 hardware_id;
u32 base_address[3];
u8 hpet_number;
u16 clock_tick;
u8 attributes;
};
#pragma pack()
......
......@@ -154,7 +154,7 @@ typedef char *acpi_physical_address;
typedef u16 acpi_size;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
#define _HW_ALIGNMENT_SUPPORT
#define ACPI_MISALIGNED_TRANSFERS
#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
#define ACPI_MAX_PTR ACPI_UINT16_MAX
#define ACPI_SIZE_MAX ACPI_UINT16_MAX
......@@ -192,7 +192,7 @@ typedef u64 acpi_physical_address;
typedef u32 acpi_size;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
#define _HW_ALIGNMENT_SUPPORT
#define ACPI_MISALIGNED_TRANSFERS
#define ACPI_MAX_PTR ACPI_UINT32_MAX
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
......@@ -1194,7 +1194,7 @@ struct acpi_resource
#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
#ifdef _HW_ALIGNMENT_SUPPORT
#ifdef ACPI_MISALIGNED_TRANSFERS
#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)
#else
#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)
......
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