Commit 7a47fa52 authored by Andy Grover's avatar Andy Grover Committed by Andy Grover

ACPI interpreter update.

add support for GPE fields to be in any address space, not just IO.
comment and debug print cleanups
parent cbba4f5e
/*******************************************************************************
*
* Module Name: dbdisply - debug display commands
* $Revision: 66 $
* $Revision: 67 $
*
******************************************************************************/
......@@ -298,6 +298,7 @@ acpi_db_decode_internal_object (
if (!obj_desc) {
acpi_os_printf (" Uninitialized\n");
return;
}
......@@ -420,10 +421,10 @@ acpi_db_display_internal_object (
break;
case AML_LOCAL_OP:
acpi_os_printf ("[Local%d]", obj_desc->reference.offset);
acpi_os_printf ("[Local%d] ", obj_desc->reference.offset);
if (walk_state) {
obj_desc = walk_state->local_variables[obj_desc->reference.offset].object;
acpi_os_printf (" %p", obj_desc);
acpi_os_printf ("%p", obj_desc);
acpi_db_decode_internal_object (obj_desc);
}
break;
......@@ -432,7 +433,7 @@ acpi_db_display_internal_object (
acpi_os_printf ("[Arg%d] ", obj_desc->reference.offset);
if (walk_state) {
obj_desc = walk_state->arguments[obj_desc->reference.offset].object;
acpi_os_printf (" %p", obj_desc);
acpi_os_printf ("%p", obj_desc);
acpi_db_decode_internal_object (obj_desc);
}
break;
......@@ -467,7 +468,6 @@ acpi_db_display_internal_object (
break;
}
acpi_os_printf ("\n");
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode)
* $Revision: 59 $
* $Revision: 60 $
*
******************************************************************************/
......@@ -308,27 +308,14 @@ ae_local_load_table (
}
/*******************************************************************************
*
* FUNCTION: Acpi_db_load_acpi_table
*
* PARAMETERS: Filname - File where table is located
*
* RETURN: Status
*
* DESCRIPTION: Load an ACPI table from a file
*
******************************************************************************/
#ifdef ACPI_APPLICATION
acpi_status
acpi_db_load_acpi_table (
acpi_db_get_acpi_table (
NATIVE_CHAR *filename)
{
#ifdef ACPI_APPLICATION
FILE *fp;
acpi_status status;
u32 table_length;
acpi_status status;
/* Open the file */
......@@ -350,6 +337,34 @@ acpi_db_load_acpi_table (
return (status);
}
return (AE_OK);
}
#endif
/*******************************************************************************
*
* FUNCTION: Acpi_db_load_acpi_table
*
* PARAMETERS: Filname - File where table is located
*
* RETURN: Status
*
* DESCRIPTION: Load an ACPI table from a file
*
******************************************************************************/
acpi_status
acpi_db_load_acpi_table (
NATIVE_CHAR *filename) {
#ifdef ACPI_APPLICATION
acpi_status status;
status = acpi_db_get_acpi_table (filename);
if (ACPI_FAILURE (status)) {
return (status);
}
/* Attempt to recognize and install the table */
status = ae_local_load_table (acpi_gbl_db_table_ptr);
......
/*******************************************************************************
*
* Module Name: dbutils - AML debugger utilities
* $Revision: 51 $
* $Revision: 52 $
*
******************************************************************************/
......@@ -151,7 +151,7 @@ acpi_db_dump_object (
case ACPI_TYPE_BUFFER:
acpi_os_printf ("[Buffer] = ");
acpi_os_printf ("[Buffer] Length %.2X = ", obj_desc->buffer.length);
acpi_ut_dump_buffer ((u8 *) obj_desc->buffer.pointer, obj_desc->buffer.length, DB_DWORD_DISPLAY, _COMPONENT);
break;
......
/******************************************************************************
*
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
* $Revision: 79 $
* $Revision: 81 $
*
*****************************************************************************/
......@@ -77,7 +77,7 @@ acpi_ds_parse_method (
return_ACPI_STATUS (AE_NULL_ENTRY);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** Named_obj=%p\n",
(char *) &((acpi_namespace_node *) obj_handle)->name, obj_handle));
/* Extract the method object from the method Node */
......@@ -111,7 +111,7 @@ acpi_ds_parse_method (
/* Init new op with the method name and pointer back to the Node */
acpi_ps_set_name (op, node->name);
acpi_ps_set_name (op, node->name.integer);
op->node = node;
/*
......@@ -152,7 +152,7 @@ acpi_ds_parse_method (
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
(char *) &((acpi_namespace_node *) obj_handle)->name, obj_handle, op));
acpi_ps_delete_parse_tree (op);
......@@ -414,7 +414,6 @@ acpi_ds_restart_control_method (
walk_state->method_call_op, return_desc, walk_state->return_used,
walk_state->results, walk_state));
return_ACPI_STATUS (AE_OK);
}
......
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
* $Revision: 58 $
* $Revision: 59 $
*
******************************************************************************/
......@@ -72,7 +72,7 @@ acpi_ds_method_data_init (
for (i = 0; i < MTH_NUM_ARGS; i++) {
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
NAMEOF_ARG_NTE);
walk_state->arguments[i].name |= (i << 24);
walk_state->arguments[i].name.integer |= (i << 24);
walk_state->arguments[i].descriptor = ACPI_DESC_TYPE_NAMED;
walk_state->arguments[i].type = ACPI_TYPE_ANY;
walk_state->arguments[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
......@@ -84,7 +84,7 @@ acpi_ds_method_data_init (
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
NAMEOF_LOCAL_NTE);
walk_state->local_variables[i].name |= (i << 24);
walk_state->local_variables[i].name.integer |= (i << 24);
walk_state->local_variables[i].descriptor = ACPI_DESC_TYPE_NAMED;
walk_state->local_variables[i].type = ACPI_TYPE_ANY;
walk_state->local_variables[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
* $Revision: 73 $
* $Revision: 74 $
*
*****************************************************************************/
......@@ -54,7 +54,9 @@
acpi_status
acpi_ds_execute_arguments (
acpi_namespace_node *node,
acpi_operand_object *extra_desc)
acpi_namespace_node *scope_node,
u32 aml_length,
u8 *aml_start)
{
acpi_status status;
acpi_parse_object *op;
......@@ -66,17 +68,16 @@ acpi_ds_execute_arguments (
/*
* Allocate a new parser op to be the root of the parsed
* Buffer_field tree
* Allocate a new parser op to be the root of the parsed tree
*/
op = acpi_ps_alloc_op (AML_SCOPE_OP);
op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP);
if (!op) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Save the Node for use in Acpi_ps_parse_aml */
op->node = acpi_ns_get_parent_node (node);
op->node = scope_node;
/* Create and initialize a new parser state */
......@@ -85,8 +86,8 @@ acpi_ds_execute_arguments (
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 1);
status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start,
aml_length, NULL, NULL, 1);
if (ACPI_FAILURE (status)) {
acpi_ds_delete_walk_state (walk_state);
return_ACPI_STATUS (status);
......@@ -94,7 +95,7 @@ acpi_ds_execute_arguments (
walk_state->parse_flags = 0;
/* Pass1: Parse the entire Buffer_field declaration */
/* Pass1: Parse the entire declaration */
status = acpi_ps_parse_aml (walk_state);
if (ACPI_FAILURE (status)) {
......@@ -102,7 +103,7 @@ acpi_ds_execute_arguments (
return_ACPI_STATUS (status);
}
/* Get and init the actual Field_unit Op created above */
/* Get and init the Op created above */
arg = op->value.arg;
op->node = node;
......@@ -111,12 +112,12 @@ acpi_ds_execute_arguments (
/* Evaluate the address and length arguments for the Buffer Field */
op = acpi_ps_alloc_op (AML_SCOPE_OP);
op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP);
if (!op) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
op->node = acpi_ns_get_parent_node (node);
op->node = scope_node;
/* Create and initialize a new parser state */
......@@ -125,8 +126,8 @@ acpi_ds_execute_arguments (
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 3);
status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start,
aml_length, NULL, NULL, 3);
if (ACPI_FAILURE (status)) {
acpi_ds_delete_walk_state (walk_state);
return_ACPI_STATUS (status);
......@@ -178,7 +179,102 @@ acpi_ds_get_buffer_field_arguments (
/* Execute the AML code for the Term_arg arguments */
status = acpi_ds_execute_arguments (node, extra_desc);
status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node),
extra_desc->extra.aml_length, extra_desc->extra.aml_start);
return_ACPI_STATUS (status);
}
/*****************************************************************************
*
* FUNCTION: Acpi_ds_get_buffer_arguments
*
* PARAMETERS: Obj_desc - A valid Bufferobject
*
* RETURN: Status.
*
* DESCRIPTION: Get Buffer length and initializer byte list. This implements
* the late evaluation of these attributes.
*
****************************************************************************/
acpi_status
acpi_ds_get_buffer_arguments (
acpi_operand_object *obj_desc)
{
acpi_namespace_node *node;
acpi_status status;
ACPI_FUNCTION_TRACE_PTR ("Ds_get_buffer_arguments", obj_desc);
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
return_ACPI_STATUS (AE_OK);
}
/* Get the Buffer node */
node = obj_desc->buffer.node;
if (!node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"No pointer back to NS node in buffer %p\n", obj_desc));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n"));
/* Execute the AML code for the Term_arg arguments */
status = acpi_ds_execute_arguments (node, node,
obj_desc->buffer.aml_length, obj_desc->buffer.aml_start);
return_ACPI_STATUS (status);
}
/*****************************************************************************
*
* FUNCTION: Acpi_ds_get_package_arguments
*
* PARAMETERS: Obj_desc - A valid Packageobject
*
* RETURN: Status.
*
* DESCRIPTION: Get Package length and initializer byte list. This implements
* the late evaluation of these attributes.
*
****************************************************************************/
acpi_status
acpi_ds_get_package_arguments (
acpi_operand_object *obj_desc)
{
acpi_namespace_node *node;
acpi_status status;
ACPI_FUNCTION_TRACE_PTR ("Ds_get_package_arguments", obj_desc);
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
return_ACPI_STATUS (AE_OK);
}
/* Get the Package node */
node = obj_desc->package.node;
if (!node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"No pointer back to NS node in package %p\n", obj_desc));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n"));
/* Execute the AML code for the Term_arg arguments */
status = acpi_ds_execute_arguments (node, node,
obj_desc->package.aml_length, obj_desc->package.aml_start);
return_ACPI_STATUS (status);
}
......@@ -202,7 +298,7 @@ acpi_ds_get_region_arguments (
{
acpi_namespace_node *node;
acpi_status status;
acpi_operand_object *region_obj2;
acpi_operand_object *extra_desc;
ACPI_FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc);
......@@ -212,22 +308,23 @@ acpi_ds_get_region_arguments (
return_ACPI_STATUS (AE_OK);
}
region_obj2 = acpi_ns_get_secondary_object (obj_desc);
if (!region_obj2) {
extra_desc = acpi_ns_get_secondary_object (obj_desc);
if (!extra_desc) {
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Get the AML pointer (method object) and region node */
/* Get the Region node */
node = obj_desc->region.node;
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
(char *) &node->name, region_obj2->extra.aml_start));
(char *) &node->name, extra_desc->extra.aml_start));
status = acpi_ds_execute_arguments (node, region_obj2);
status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node),
extra_desc->extra.aml_length, extra_desc->extra.aml_start);
return_ACPI_STATUS (status);
}
......@@ -306,7 +403,7 @@ acpi_ds_eval_buffer_field_operands (
next_op = op->value.arg;
/* Acpi_evaluate/create the address and length operands */
/* Evaluate/create the address and length operands */
status = acpi_ds_create_operands (walk_state, next_op);
if (ACPI_FAILURE (status)) {
......@@ -556,7 +653,7 @@ acpi_ds_eval_region_operands (
next_op = next_op->next;
/* Acpi_evaluate/create the address and length operands */
/* Evaluate/create the address and length operands */
status = acpi_ds_create_operands (walk_state, next_op);
if (ACPI_FAILURE (status)) {
......@@ -610,6 +707,95 @@ acpi_ds_eval_region_operands (
}
/*****************************************************************************
*
* FUNCTION: Acpi_ds_eval_data_object_operands
*
* PARAMETERS: Op - A valid Data_object Op object
*
* RETURN: Status
*
* DESCRIPTION: Get the operands and complete the following data objec types:
* Buffer
* Package
*
****************************************************************************/
acpi_status
acpi_ds_eval_data_object_operands (
acpi_walk_state *walk_state,
acpi_parse_object *op,
acpi_operand_object *obj_desc)
{
acpi_status status;
acpi_operand_object *arg_desc;
u32 length;
ACPI_FUNCTION_TRACE ("Ds_eval_data_object_operands");
/* The first operand (for all of these data objects) is the length */
status = acpi_ds_create_operand (walk_state, op->value.arg, 1);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
status = acpi_ex_resolve_operands (walk_state->opcode,
&(walk_state->operands [walk_state->num_operands -1]),
walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Extract length operand */
arg_desc = walk_state->operands [walk_state->num_operands - 1];
length = (u32) arg_desc->integer.value;
/* Cleanup for length operand */
acpi_ds_obj_stack_pop (1, walk_state);
acpi_ut_remove_reference (arg_desc);
/*
* Create the actual data object
*/
switch (op->opcode) {
case AML_BUFFER_OP:
status = acpi_ds_build_internal_buffer_obj (walk_state, op, length, &obj_desc);
break;
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
status = acpi_ds_build_internal_package_obj (walk_state, op, length, &obj_desc);
break;
default:
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
}
if (ACPI_SUCCESS (status)) {
/*
* Return the object in the Walk_state, unless the parent is a package --
* in this case, the return object will be stored in the parse tree
* for the package.
*/
if ((!op->parent) ||
((op->parent->opcode != AML_PACKAGE_OP) &&
(op->parent->opcode != AML_VAR_PACKAGE_OP) &&
(op->parent->opcode != AML_NAME_OP))) {
walk_state->result_obj = obj_desc;
}
}
return_ACPI_STATUS (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ds_exec_begin_control_op
......
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
* $Revision: 88 $
* $Revision: 89 $
*
******************************************************************************/
......@@ -133,7 +133,11 @@ acpi_ds_is_result_used (
case AML_CLASS_NAMED_OBJECT:
if ((op->parent->opcode == AML_REGION_OP) ||
(op->parent->opcode == AML_DATA_REGION_OP)) {
(op->parent->opcode == AML_DATA_REGION_OP) ||
(op->parent->opcode == AML_PACKAGE_OP) ||
(op->parent->opcode == AML_VAR_PACKAGE_OP) ||
(op->parent->opcode == AML_BUFFER_OP) ||
(op->parent->opcode == AML_INT_EVAL_SUBTREE_OP)) {
/*
* These opcodes allow Term_arg(s) as operands and therefore
* the operands can be method calls. The result is used.
......@@ -144,11 +148,12 @@ acpi_ds_is_result_used (
goto result_not_used;
default:
/*
* In all other cases. the parent will actually use the return
* object, so keep it.
*/
default:
goto result_used;
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
* $Revision: 89 $
* $Revision: 90 $
*
*****************************************************************************/
......@@ -498,6 +498,50 @@ acpi_ds_exec_end_op (
break;
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Executing Create_object (Buffer/Package) Op=%p\n", op));
switch (op->parent->opcode) {
case AML_NAME_OP:
/*
* Put the Node on the object stack (Contains the ACPI Name of
* this object)
*/
walk_state->operands[0] = (void *) op->parent->node;
walk_state->num_operands = 1;
status = acpi_ds_create_node (walk_state, op->parent->node, op->parent);
if (ACPI_FAILURE (status)) {
break;
}
/* Fall through */
case AML_INT_EVAL_SUBTREE_OP:
status = acpi_ds_eval_data_object_operands (walk_state, op, acpi_ns_get_attached_object (op->parent->node));
break;
default:
status = acpi_ds_eval_data_object_operands (walk_state, op, NULL);
break;
}
/*
* If a result object was returned from above, push it on the
* current result stack
*/
if (ACPI_SUCCESS (status) &&
walk_state->result_obj) {
status = acpi_ds_result_push (walk_state->result_obj, walk_state);
}
break;
case AML_TYPE_NAMED_FIELD:
case AML_TYPE_NAMED_COMPLEX:
case AML_TYPE_NAMED_SIMPLE:
......
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 61 $
* $Revision: 62 $
*
*****************************************************************************/
......@@ -167,7 +167,7 @@ acpi_ds_load1_begin_op (
/* Initialize */
((acpi_parse2_object *)op)->name = node->name;
((acpi_parse2_object *)op)->name = node->name.integer;
/*
* Put the Node in the "op" object that the parser uses, so we
......@@ -381,7 +381,7 @@ acpi_ds_load2_begin_op (
/* Initialize the new op */
((acpi_parse2_object *)op)->name = node->name;
((acpi_parse2_object *)op)->name = node->name.integer;
*out_op = op;
}
......
/******************************************************************************
*
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch
* $Revision: 71 $
* $Revision: 78 $
*
*****************************************************************************/
......@@ -326,11 +326,14 @@ acpi_ev_gpe_initialize (void)
* FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need
* to be the same size."
*/
acpi_gbl_gpe_block_info[0].register_count = (u16) ACPI_DIV_2 (acpi_gbl_FADT->gpe0_blk_len);
acpi_gbl_gpe_block_info[1].register_count = (u16) ACPI_DIV_2 (acpi_gbl_FADT->gpe1_blk_len);
acpi_gbl_gpe_block_info[0].address_space_id = acpi_gbl_FADT->Xgpe0_blk.address_space_id;
acpi_gbl_gpe_block_info[1].address_space_id = acpi_gbl_FADT->Xgpe1_blk.address_space_id;
acpi_gbl_gpe_block_info[0].block_address = (u16) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0_blk.address);
acpi_gbl_gpe_block_info[1].block_address = (u16) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address);
acpi_gbl_gpe_block_info[0].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe0_blk.register_bit_width);
acpi_gbl_gpe_block_info[1].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe1_blk.register_bit_width);
acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->Xgpe0_blk;
acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->Xgpe1_blk;
acpi_gbl_gpe_block_info[0].block_base_number = 0;
acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base;
......@@ -421,9 +424,20 @@ acpi_ev_gpe_initialize (void)
/* Init the Register info for this entire GPE register (8 GPEs) */
gpe_register_info->base_gpe_number = (u8) (acpi_gbl_gpe_block_info[gpe_block].block_base_number + (ACPI_MUL_8 (i)));
gpe_register_info->status_addr = (u16) (acpi_gbl_gpe_block_info[gpe_block].block_address + i);
gpe_register_info->enable_addr = (u16) (acpi_gbl_gpe_block_info[gpe_block].block_address + i +
acpi_gbl_gpe_block_info[gpe_block].register_count);
ACPI_STORE_ADDRESS (gpe_register_info->status_address.address,
(ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address) + i));
ACPI_STORE_ADDRESS (gpe_register_info->enable_address.address,
(ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address) + i +
acpi_gbl_gpe_block_info[gpe_block].register_count));
gpe_register_info->status_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id;
gpe_register_info->enable_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id;
gpe_register_info->status_address.register_bit_width = 8;
gpe_register_info->enable_address.register_bit_width = 8;
gpe_register_info->status_address.register_bit_offset = 8;
gpe_register_info->enable_address.register_bit_offset = 8;
/* Init the Index mapping info for each GPE number within this register */
......@@ -440,18 +454,24 @@ acpi_ev_gpe_initialize (void)
* are cleared by writing a '1', while enable registers are cleared
* by writing a '0'.
*/
acpi_os_write_port (gpe_register_info->enable_addr, 0x00, 8);
acpi_os_write_port (gpe_register_info->status_addr, 0xFF, 8);
acpi_hw_low_level_write (8, 0x00, &gpe_register_info->enable_address, 0);
acpi_hw_low_level_write (8, 0xFF, &gpe_register_info->status_address, 0);
gpe_register++;
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%8.8X%8.8X (Blk0) %X@%8.8X%8.8X (Blk1)\n",
acpi_gbl_gpe_block_info[0].register_count,
ACPI_HIDWORD (acpi_gbl_FADT->Xgpe0_blk.address), ACPI_LODWORD (acpi_gbl_FADT->Xgpe0_blk.address),
acpi_gbl_gpe_block_info[1].register_count,
ACPI_HIDWORD (acpi_gbl_FADT->Xgpe1_blk.address), ACPI_LODWORD (acpi_gbl_FADT->Xgpe1_blk.address)));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n",
gpe_block, acpi_gbl_gpe_block_info[0].register_count,
ACPI_HIDWORD (acpi_gbl_gpe_block_info[gpe_block].block_address->address),
ACPI_LODWORD (acpi_gbl_gpe_block_info[gpe_block].block_address->address)));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d Range GPE #%2.2X to GPE #%2.2X\n",
gpe_block,
acpi_gbl_gpe_block_info[gpe_block].block_base_number,
acpi_gbl_gpe_block_info[gpe_block].block_base_number +
((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1)));
}
return_ACPI_STATUS (AE_OK);
......@@ -645,17 +665,18 @@ acpi_ev_gpe_detect (void)
for (i = 0; i < acpi_gbl_gpe_register_count; i++) {
gpe_register_info = &acpi_gbl_gpe_register_info[i];
acpi_os_read_port (gpe_register_info->status_addr,
&gpe_register_info->status, 8);
gpe_register_info->status = (u8) acpi_hw_low_level_read (8,
&gpe_register_info->status_address, 0);
acpi_os_read_port (gpe_register_info->enable_addr,
&gpe_register_info->enable, 8);
gpe_register_info->enable = (u8) acpi_hw_low_level_read (8,
&gpe_register_info->enable_address, 0);
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"GPE block at %X - Enable %08X Status %08X\n",
gpe_register_info->enable_addr,
gpe_register_info->status,
gpe_register_info->enable));
"GPE block at %8.8X%8.8X - Enable %08X Status %08X\n",
ACPI_HIDWORD (gpe_register_info->enable_address.address),
ACPI_LODWORD (gpe_register_info->enable_address.address),
gpe_register_info->enable,
gpe_register_info->status));
/* First check if there is anything active at all in this register */
......@@ -815,19 +836,19 @@ acpi_ev_gpe_dispatch (
gpe_info->handler (gpe_info->context);
}
else if (gpe_info->method_handle) {
/*
* Disable GPE, so it doesn't keep firing before the method has a
* chance to run.
*/
acpi_hw_disable_gpe (gpe_number);
/*
* Execute the method associated with the GPE.
*/
if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
acpi_ev_asynch_execute_gpe_method,
ACPI_TO_POINTER (gpe_number)))) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%X], disabling event\n", gpe_number));
/*
* Disable the GPE on error. The GPE will remain disabled until the ACPI
* Core Subsystem is restarted, or the handler is reinstalled.
*/
acpi_hw_disable_gpe (gpe_number);
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%X], event is disabled\n", gpe_number));
}
}
else {
......
/******************************************************************************
*
* Module Name: evmisc - ACPI device notification handler dispatch
* and ACPI Global Lock support
* $Revision: 47 $
* Module Name: evmisc - Miscellaneous event manager support functions
* $Revision: 48 $
*
*****************************************************************************/
......@@ -34,6 +33,40 @@
ACPI_MODULE_NAME ("evmisc")
/*******************************************************************************
*
* FUNCTION: Acpi_ev_is_notify_object
*
* PARAMETERS: Node - Node to check
*
* RETURN: TRUE if notifies allowed on this object
*
* DESCRIPTION: Check type of node for a object that supports notifies.
*
* TBD: This could be replaced by a flag bit in the node.
*
******************************************************************************/
u8
acpi_ev_is_notify_object (
acpi_namespace_node *node)
{
switch (node->type) {
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER:
case ACPI_TYPE_THERMAL:
/*
* These are the ONLY objects that can receive ACPI notifications
*/
return (TRUE);
default:
return (FALSE);
}
}
/*******************************************************************************
*
* FUNCTION: Acpi_ev_get_gpe_register_index
......
/******************************************************************************
*
* Module Name: evxface - External interfaces for ACPI events
* $Revision: 125 $
* $Revision: 126 $
*
*****************************************************************************/
......@@ -191,7 +191,7 @@ acpi_install_notify_handler (
{
acpi_operand_object *obj_desc;
acpi_operand_object *notify_obj;
acpi_namespace_node *device_node;
acpi_namespace_node *node;
acpi_status status;
......@@ -200,7 +200,8 @@ acpi_install_notify_handler (
/* Parameter validation */
if ((!handler) ||
if ((!device) ||
(!handler) ||
(handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
......@@ -212,8 +213,8 @@ acpi_install_notify_handler (
/* Convert and validate the device handle */
device_node = acpi_ns_map_handle_to_node (device);
if (!device_node) {
node = acpi_ns_map_handle_to_node (device);
if (!node) {
status = AE_BAD_PARAMETER;
goto unlock_and_exit;
}
......@@ -236,12 +237,12 @@ acpi_install_notify_handler (
}
if (handler_type == ACPI_SYSTEM_NOTIFY) {
acpi_gbl_sys_notify.node = device_node;
acpi_gbl_sys_notify.node = node;
acpi_gbl_sys_notify.handler = handler;
acpi_gbl_sys_notify.context = context;
}
else /* ACPI_DEVICE_NOTIFY */ {
acpi_gbl_drv_notify.node = device_node;
acpi_gbl_drv_notify.node = node;
acpi_gbl_drv_notify.handler = handler;
acpi_gbl_drv_notify.context = context;
}
......@@ -255,28 +256,24 @@ acpi_install_notify_handler (
* Note that only certain object types can receive notifications.
*/
else {
/*
* These are the ONLY objects that can receive ACPI notifications
*/
if ((device_node->type != ACPI_TYPE_DEVICE) &&
(device_node->type != ACPI_TYPE_PROCESSOR) &&
(device_node->type != ACPI_TYPE_POWER) &&
(device_node->type != ACPI_TYPE_THERMAL)) {
status = AE_BAD_PARAMETER;
/* Notifies allowed on this object? */
if (!acpi_ev_is_notify_object (node)) {
status = AE_TYPE;
goto unlock_and_exit;
}
/* Check for an existing internal object */
obj_desc = acpi_ns_get_attached_object (device_node);
obj_desc = acpi_ns_get_attached_object (node);
if (obj_desc) {
/* Object exists - make sure there's no handler */
if (((handler_type == ACPI_SYSTEM_NOTIFY) &&
obj_desc->device.sys_handler) ||
obj_desc->common_notify.sys_handler) ||
((handler_type == ACPI_DEVICE_NOTIFY) &&
obj_desc->device.drv_handler)) {
obj_desc->common_notify.drv_handler)) {
status = AE_ALREADY_EXISTS;
goto unlock_and_exit;
}
......@@ -284,7 +281,7 @@ acpi_install_notify_handler (
else {
/* Create a new object */
obj_desc = acpi_ut_create_internal_object (device_node->type);
obj_desc = acpi_ut_create_internal_object (node->type);
if (!obj_desc) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
......@@ -292,7 +289,7 @@ acpi_install_notify_handler (
/* Attach new object to the Node */
status = acpi_ns_attach_object (device, obj_desc, device_node->type);
status = acpi_ns_attach_object (device, obj_desc, node->type);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
......@@ -306,16 +303,15 @@ acpi_install_notify_handler (
goto unlock_and_exit;
}
notify_obj->notify_handler.node = device_node;
notify_obj->notify_handler.node = node;
notify_obj->notify_handler.handler = handler;
notify_obj->notify_handler.context = context;
if (handler_type == ACPI_SYSTEM_NOTIFY) {
obj_desc->device.sys_handler = notify_obj;
obj_desc->common_notify.sys_handler = notify_obj;
}
else /* ACPI_DEVICE_NOTIFY */ {
obj_desc->device.drv_handler = notify_obj;
obj_desc->common_notify.drv_handler = notify_obj;
}
}
......@@ -349,7 +345,7 @@ acpi_remove_notify_handler (
{
acpi_operand_object *notify_obj;
acpi_operand_object *obj_desc;
acpi_namespace_node *device_node;
acpi_namespace_node *node;
acpi_status status;
......@@ -358,7 +354,8 @@ acpi_remove_notify_handler (
/* Parameter validation */
if ((!handler) ||
if ((!device) ||
(!handler) ||
(handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
......@@ -370,8 +367,8 @@ acpi_remove_notify_handler (
/* Convert and validate the device handle */
device_node = acpi_ns_map_handle_to_node (device);
if (!device_node) {
node = acpi_ns_map_handle_to_node (device);
if (!node) {
status = AE_BAD_PARAMETER;
goto unlock_and_exit;
}
......@@ -406,20 +403,16 @@ acpi_remove_notify_handler (
* All Other Objects
*/
else {
/*
* These are the ONLY objects that can receive ACPI notifications
*/
if ((device_node->type != ACPI_TYPE_DEVICE) &&
(device_node->type != ACPI_TYPE_PROCESSOR) &&
(device_node->type != ACPI_TYPE_POWER) &&
(device_node->type != ACPI_TYPE_THERMAL)) {
status = AE_BAD_PARAMETER;
/* Notifies allowed on this object? */
if (!acpi_ev_is_notify_object (node)) {
status = AE_TYPE;
goto unlock_and_exit;
}
/* Check for an existing internal object */
obj_desc = acpi_ns_get_attached_object (device_node);
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
status = AE_NOT_EXIST;
goto unlock_and_exit;
......@@ -428,10 +421,10 @@ acpi_remove_notify_handler (
/* Object exists - make sure there's an existing handler */
if (handler_type == ACPI_SYSTEM_NOTIFY) {
notify_obj = obj_desc->device.sys_handler;
notify_obj = obj_desc->common_notify.sys_handler;
}
else {
notify_obj = obj_desc->device.drv_handler;
notify_obj = obj_desc->common_notify.drv_handler;
}
if ((!notify_obj) ||
......@@ -443,10 +436,10 @@ acpi_remove_notify_handler (
/* Remove the handler */
if (handler_type == ACPI_SYSTEM_NOTIFY) {
obj_desc->device.sys_handler = NULL;
obj_desc->common_notify.sys_handler = NULL;
}
else {
obj_desc->device.drv_handler = NULL;
obj_desc->common_notify.drv_handler = NULL;
}
acpi_ut_remove_reference (notify_obj);
......
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
* $Revision: 59 $
* $Revision: 60 $
*
*****************************************************************************/
......@@ -329,7 +329,7 @@ acpi_ex_load_op (
* Read the entire field and thus the entire table. Buffer is
* allocated during the read.
*/
status = acpi_ex_read_data_from_field (obj_desc, &buffer_desc);
status = acpi_ex_read_data_from_field (walk_state, obj_desc, &buffer_desc);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
......
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
* $Revision: 30 $
* $Revision: 32 $
*
*****************************************************************************/
......@@ -215,8 +215,7 @@ acpi_ex_convert_to_buffer (
if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) {
/*
* We are running a method that exists in a 32-bit ACPI table.
* Truncate the value to 32 bits by zeroing out the upper
* 32-bit field
* Use only 32 bits of the Integer for conversion.
*/
integer_size = sizeof (u32);
}
......@@ -259,6 +258,9 @@ acpi_ex_convert_to_buffer (
return_ACPI_STATUS (AE_TYPE);
}
/* Mark buffer initialized */
(*result_desc)->common.flags |= AOPOBJ_DATA_VALID;
return_ACPI_STATUS (AE_OK);
}
......@@ -399,8 +401,7 @@ acpi_ex_convert_to_string (
if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) {
/*
* We are running a method that exists in a 32-bit ACPI table.
* Truncate the value to 32 bits by zeroing out the upper
* 32-bit field
* Use only 32 bits of the Integer
*/
integer_size = sizeof (u32);
}
......
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
* $Revision: 145 $
* $Revision: 147 $
*
*****************************************************************************/
......@@ -149,7 +149,7 @@ acpi_ex_dump_operand (
ACPI_FUNCTION_NAME ("Ex_dump_operand")
if (!((ACPI_LV_INFO & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
if (!((ACPI_LV_EXEC & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
return (AE_OK);
}
......@@ -159,25 +159,25 @@ acpi_ex_dump_operand (
* since most (if not all)
* code that dumps the stack expects something to be there!
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null stack entry ptr\n"));
acpi_os_printf ("Null stack entry ptr\n");
return (AE_OK);
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p NS Node: ", obj_desc));
ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_INFO);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", obj_desc));
ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC);
return (AE_OK);
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_INTERNAL) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p is not a local object\n", obj_desc));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", obj_desc));
ACPI_DUMP_BUFFER (obj_desc, sizeof (acpi_operand_object));
return (AE_OK);
}
/* Obj_desc is a valid object */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p ", obj_desc));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
switch (obj_desc->common.type) {
case INTERNAL_TYPE_REFERENCE:
......@@ -427,7 +427,7 @@ acpi_ex_dump_operand (
if (!obj_desc->buffer_field.buffer_obj)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*NULL* \n"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
}
else if (ACPI_TYPE_BUFFER !=
......@@ -541,7 +541,7 @@ acpi_ex_dump_operands (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
ident, num_levels));
......@@ -562,7 +562,7 @@ acpi_ex_dump_operands (
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"************* Stack dump from %s(%d), %s\n",
module_name, line_number, note));
return;
......@@ -734,7 +734,6 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("Flags", obj_desc->package.flags);
acpi_ex_out_integer ("Count", obj_desc->package.count);
acpi_ex_out_pointer ("Elements", obj_desc->package.elements);
acpi_ex_out_pointer ("Next_element", obj_desc->package.next_element);
/* Dump the package contents */
......
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
* $Revision: 105 $
* $Revision: 108 $
*
*****************************************************************************/
......@@ -41,7 +41,8 @@
*
* FUNCTION: Acpi_ex_read_data_from_field
*
* PARAMETERS: Obj_desc - The named field
* PARAMETERS: Walk_state - Current execution state
* Obj_desc - The named field
* Ret_buffer_desc - Where the return data object is stored
*
* RETURN: Status
......@@ -53,12 +54,14 @@
acpi_status
acpi_ex_read_data_from_field (
acpi_walk_state *walk_state,
acpi_operand_object *obj_desc,
acpi_operand_object **ret_buffer_desc)
{
acpi_status status;
acpi_operand_object *buffer_desc;
u32 length;
u32 integer_size;
void *buffer;
u8 locked;
......@@ -97,7 +100,18 @@ acpi_ex_read_data_from_field (
*/
length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length);
if (length > sizeof (acpi_integer)) {
/* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
integer_size = sizeof (acpi_integer);
if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) {
/*
* We are running a method that exists in a 32-bit ACPI table.
* Integer size is 4.
*/
integer_size = sizeof (u32);
}
if (length > integer_size) {
/* Field is too large for an Integer, create a Buffer instead */
buffer_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
......@@ -113,6 +127,7 @@ acpi_ex_read_data_from_field (
return_ACPI_STATUS (AE_NO_MEMORY);
}
buffer_desc->common.flags = AOPOBJ_DATA_VALID;
buffer_desc->buffer.length = length;
buffer = buffer_desc->buffer.pointer;
}
......@@ -124,14 +139,15 @@ acpi_ex_read_data_from_field (
return_ACPI_STATUS (AE_NO_MEMORY);
}
length = sizeof (buffer_desc->integer.value);
length = integer_size;
buffer_desc->integer.value = 0;
buffer = &buffer_desc->integer.value;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Obj=%p Type=%X Buf=%p Len=%X\n",
obj_desc, obj_desc->common.type, buffer, length));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n",
obj_desc->common_field.bit_length,
obj_desc->common_field.start_field_bit_offset,
......@@ -257,10 +273,10 @@ acpi_ex_write_data_to_field (
length = required_length;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Obj=%p Type=%X Buf=%p Len=%X\n",
obj_desc, obj_desc->common.type, buffer, length));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Field_read: Bit_len=%X Bit_off=%X Byte_off=%X\n",
obj_desc->common_field.bit_length,
obj_desc->common_field.start_field_bit_offset,
......
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
* $Revision: 82 $
* $Revision: 84 $
*
*****************************************************************************/
......@@ -148,7 +148,7 @@ acpi_ex_access_region (
ACPI_PHYSICAL_ADDRESS address;
ACPI_FUNCTION_TRACE ("Acpi_ex_access_region");
ACPI_FUNCTION_TRACE ("Ex_access_region");
/*
......@@ -672,7 +672,7 @@ acpi_ex_extract_from_field (
*/
byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length);
if (byte_field_length > buffer_length) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Field size %X (bytes) too large for buffer (%X)\n",
byte_field_length, buffer_length));
......@@ -684,7 +684,7 @@ acpi_ex_extract_from_field (
datum_count = ACPI_ROUND_UP_TO (byte_field_length,
obj_desc->common_field.access_byte_width);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Byte_len=%x, Datum_len=%x, Byte_gran=%x\n",
byte_field_length, datum_count,obj_desc->common_field.access_byte_width));
......@@ -852,7 +852,7 @@ acpi_ex_insert_into_field (
*/
byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length);
if (buffer_length < byte_field_length) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer length %X too small for field %X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Buffer length %X too small for field %X\n",
buffer_length, byte_field_length));
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
......@@ -862,7 +862,7 @@ acpi_ex_insert_into_field (
datum_count = ACPI_ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Byte_len=%x, Datum_len=%x, Byte_gran=%x\n",
byte_field_length, datum_count, obj_desc->common_field.access_byte_width));
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 134 $
* $Revision: 135 $
*
*****************************************************************************/
......@@ -791,10 +791,21 @@ acpi_ex_opcode_1A_0T_1R (
*/
switch (operand[0]->reference.target_type) {
case ACPI_TYPE_BUFFER_FIELD:
/* Ensure that the Buffer arguments are evaluated */
temp_desc = operand[0]->reference.object;
#if 0
status = acpi_ds_get_buffer_arguments (temp_desc);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/*
* The target is a buffer, we must create a new object that
* contains one element of the buffer, the element pointed
* to by the index.
* Create a new object that contains one element of the
* buffer -- the element pointed to by the index.
*
* NOTE: index into a buffer is NOT a pointer to a
* sub-buffer of the main buffer, it is only a pointer to a
......@@ -811,7 +822,6 @@ acpi_ex_opcode_1A_0T_1R (
* indexed location, we don't need to add an additional
* reference to the buffer itself.
*/
temp_desc = operand[0]->reference.object;
return_desc->integer.value =
temp_desc->buffer.pointer[operand[0]->reference.offset];
break;
......@@ -819,10 +829,17 @@ acpi_ex_opcode_1A_0T_1R (
case ACPI_TYPE_PACKAGE:
#if 0
/* Ensure that the Package arguments are evaluated */
status = acpi_ds_get_package_arguments (operand[0]->reference.object);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/*
* The target is a package, we want to return the referenced
* element of the package. We must add another reference to
* this object, however.
* Return the referenced element of the package. We must add
* another reference to the referenced object, however.
*/
return_desc = *(operand[0]->reference.where);
if (!return_desc) {
......
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 104 $
* $Revision: 105 $
*
*****************************************************************************/
......@@ -84,25 +84,28 @@ acpi_ex_opcode_2A_0T_0R (
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R",
acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the opcode */
switch (walk_state->opcode) {
case AML_NOTIFY_OP: /* Notify (Notify_object, Notify_value) */
/* The first operand is a namespace node */
node = (acpi_namespace_node *) operand[0];
/* The node must refer to a device or thermal zone or processor */
/* Notifies allowed on this object? */
if (!acpi_ev_is_notify_object (node)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type [%s]\n",
acpi_ut_get_type_name (node->type)));
switch (node->type) {
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_PROCESSOR:
status = AE_AML_OPERAND_TYPE;
break;
}
/*
* Dispatch the notify to the appropriate handler
......@@ -115,18 +118,11 @@ acpi_ex_opcode_2A_0T_0R (
(u32) operand[1]->integer.value);
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type %X\n",
node->type));
status = AE_AML_OPERAND_TYPE;
break;
}
break;
default:
ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 114 $
* $Revision: 115 $
*
*****************************************************************************/
......@@ -204,54 +204,70 @@ acpi_ex_prep_common_field_object (
* two pieces of information - the width of each field access and the
* necessary Byte_alignment (address granularity) of the access.
*
* For Any_acc, the Access_bit_width is the largest width that is both necessary
* and possible in an attempt to access the whole field in one
* I/O operation. However, for Any_acc, the Byte_alignment is always one byte.
* For Any_acc, the Access_bit_width is the largest width that is both
* necessary and possible in an attempt to access the whole field in one
* I/O operation. However, for Any_acc, the Byte_alignment is always one
* byte.
*
* For all Buffer Fields, the Byte_alignment is always one byte.
*
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is the
* same (equivalent) as the Byte_alignment.
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
* the same (equivalent) as the Byte_alignment.
*/
access_bit_width = acpi_ex_decode_field_access (obj_desc, field_flags, &byte_alignment);
access_bit_width = acpi_ex_decode_field_access (obj_desc, field_flags,
&byte_alignment);
if (!access_bit_width) {
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
/* Setup width (access granularity) fields */
obj_desc->common_field.access_byte_width = (u8) ACPI_DIV_8 (access_bit_width); /* 1, 2, 4, 8 */
obj_desc->common_field.access_byte_width = (u8)
ACPI_DIV_8 (access_bit_width); /* 1, 2, 4, 8 */
/*
* Base_byte_offset is the address of the start of the field within the region. It is
* the byte address of the first *datum* (field-width data unit) of the field.
* (i.e., the first datum that contains at least the first *bit* of the field.)
* Note: Byte_alignment is always either equal to the Access_bit_width or 8 (Byte access),
* and it defines the addressing granularity of the parent region or buffer.
* Base_byte_offset is the address of the start of the field within the
* region. It is the byte address of the first *datum* (field-width data
* unit) of the field. (i.e., the first datum that contains at least the
* first *bit* of the field.)
*
* Note: Byte_alignment is always either equal to the Access_bit_width or 8
* (Byte access), and it defines the addressing granularity of the parent
* region or buffer.
*/
nearest_byte_address = ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position);
obj_desc->common_field.base_byte_offset = ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment);
nearest_byte_address =
ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position);
obj_desc->common_field.base_byte_offset =
ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment);
/*
* Start_field_bit_offset is the offset of the first bit of the field within a field datum.
* Start_field_bit_offset is the offset of the first bit of the field within
* a field datum.
*/
obj_desc->common_field.start_field_bit_offset = (u8) (field_bit_position -
ACPI_MUL_8 (obj_desc->common_field.base_byte_offset));
obj_desc->common_field.start_field_bit_offset = (u8)
(field_bit_position - ACPI_MUL_8 (obj_desc->common_field.base_byte_offset));
/*
* Valid bits -- the number of bits that compose a partial datum,
* 1) At the end of the field within the region (arbitrary starting bit offset)
* 2) At the end of a buffer used to contain the field (starting offset always zero)
* 1) At the end of the field within the region (arbitrary starting bit
* offset)
* 2) At the end of a buffer used to contain the field (starting offset
* always zero)
*/
obj_desc->common_field.end_field_valid_bits = (u8) ((obj_desc->common_field.start_field_bit_offset + field_bit_length) %
obj_desc->common_field.end_field_valid_bits = (u8)
((obj_desc->common_field.start_field_bit_offset + field_bit_length) %
access_bit_width);
obj_desc->common_field.end_buffer_valid_bits = (u8) (field_bit_length % access_bit_width); /* Start_buffer_bit_offset always = 0 */
/* Start_buffer_bit_offset always = 0 */
obj_desc->common_field.end_buffer_valid_bits = (u8)
(field_bit_length % access_bit_width);
/*
* Datum_valid_bits is the number of valid field bits in the first field datum.
* Datum_valid_bits is the number of valid field bits in the first
* field datum.
*/
obj_desc->common_field.datum_valid_bits = (u8) (access_bit_width -
obj_desc->common_field.start_field_bit_offset);
obj_desc->common_field.datum_valid_bits = (u8)
(access_bit_width - obj_desc->common_field.start_field_bit_offset);
/*
* Does the entire field fit within a single field access element? (datum)
......@@ -341,7 +357,7 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->field.region_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Region_field: Bitoff=%X Off=%X Gran=%X Region %p\n",
obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset,
obj_desc->field.access_byte_width, obj_desc->field.region_obj));
......@@ -359,9 +375,12 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->bank_field.region_obj);
acpi_ut_add_reference (obj_desc->bank_field.bank_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n",
obj_desc->bank_field.start_field_bit_offset, obj_desc->bank_field.base_byte_offset,
obj_desc->field.access_byte_width, obj_desc->bank_field.region_obj,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n",
obj_desc->bank_field.start_field_bit_offset,
obj_desc->bank_field.base_byte_offset,
obj_desc->field.access_byte_width,
obj_desc->bank_field.region_obj,
obj_desc->bank_field.bank_obj));
break;
......@@ -370,8 +389,8 @@ acpi_ex_prep_field_value (
obj_desc->index_field.index_obj = acpi_ns_get_attached_object (info->register_node);
obj_desc->index_field.data_obj = acpi_ns_get_attached_object (info->data_register_node);
obj_desc->index_field.value = (u32) (info->field_bit_position /
ACPI_MUL_8 (obj_desc->field.access_byte_width));
obj_desc->index_field.value = (u32)
(info->field_bit_position / ACPI_MUL_8 (obj_desc->field.access_byte_width));
if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Index Object\n"));
......@@ -383,9 +402,12 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->index_field.data_obj);
acpi_ut_add_reference (obj_desc->index_field.index_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
obj_desc->index_field.start_field_bit_offset, obj_desc->index_field.base_byte_offset,
obj_desc->field.access_byte_width, obj_desc->index_field.index_obj,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
obj_desc->index_field.start_field_bit_offset,
obj_desc->index_field.base_byte_offset,
obj_desc->field.access_byte_width,
obj_desc->index_field.index_obj,
obj_desc->index_field.data_obj));
break;
}
......@@ -397,7 +419,7 @@ acpi_ex_prep_field_value (
status = acpi_ns_attach_object (info->field_node, obj_desc,
acpi_ns_get_type (info->field_node));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set Named_obj %p (%4.4s) val = %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set Named_obj %p (%4.4s) val = %p\n",
info->field_node, (char *) &(info->field_node->name), obj_desc));
/* Remove local reference to the object */
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default Op_region (address space) handlers
* $Revision: 72 $
* $Revision: 74 $
*
*****************************************************************************/
......@@ -69,7 +69,6 @@ acpi_ex_system_memory_space_handler (
acpi_mem_space_context *mem_info = region_context;
u32 length;
u32 window_size;
u32 remaining;
ACPI_FUNCTION_TRACE ("Ex_system_memory_space_handler");
......@@ -123,13 +122,10 @@ acpi_ex_system_memory_space_handler (
* Don't attempt to map memory beyond the end of the region, and
* constrain the maximum mapping size to something reasonable.
*/
remaining = (u32) ((mem_info->address + (ACPI_PHYSICAL_ADDRESS) mem_info->length) - address);
if (remaining > SYSMEM_REGION_WINDOW_SIZE) {
window_size = (u32) ((mem_info->address + mem_info->length) - address);
if (window_size > SYSMEM_REGION_WINDOW_SIZE) {
window_size = SYSMEM_REGION_WINDOW_SIZE;
}
else {
window_size = remaining;
}
/* Create a new mapping starting at the address given */
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
* $Revision: 50 $
* $Revision: 52 $
*
*****************************************************************************/
......@@ -122,10 +122,13 @@ acpi_ex_resolve_node_to_value (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
status = acpi_ds_get_package_arguments (source_desc);
if (ACPI_SUCCESS (status)) {
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference (obj_desc);
}
break;
......@@ -137,10 +140,13 @@ acpi_ex_resolve_node_to_value (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
status = acpi_ds_get_buffer_arguments (source_desc);
if (ACPI_SUCCESS (status)) {
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference (obj_desc);
}
break;
......@@ -182,7 +188,7 @@ acpi_ex_resolve_node_to_value (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n",
node, source_desc, entry_type));
status = acpi_ex_read_data_from_field (source_desc, &obj_desc);
status = acpi_ex_read_data_from_field (walk_state, source_desc, &obj_desc);
break;
/*
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
* $Revision: 106 $
* $Revision: 109 $
*
*****************************************************************************/
......@@ -94,7 +94,7 @@ acpi_ex_resolve_to_value (
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Resolved object %p\n", *stack_ptr));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr));
return_ACPI_STATUS (AE_OK);
}
......@@ -177,7 +177,7 @@ acpi_ex_resolve_object_to_value (
acpi_ut_remove_reference (stack_desc);
*stack_ptr = obj_desc;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[Arg/Local %d] Value_obj is %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] Value_obj is %p\n",
stack_desc->reference.offset, obj_desc));
break;
......@@ -290,6 +290,19 @@ acpi_ex_resolve_object_to_value (
break; /* case INTERNAL_TYPE_REFERENCE */
case ACPI_TYPE_BUFFER:
status = acpi_ds_get_buffer_arguments (stack_desc);
break;
case ACPI_TYPE_PACKAGE:
status = acpi_ds_get_package_arguments (stack_desc);
break;
/*
* These cases may never happen here, but just in case..
*/
......@@ -301,7 +314,7 @@ acpi_ex_resolve_object_to_value (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n",
stack_desc, stack_desc->common.type));
status = acpi_ex_read_data_from_field (stack_desc, &obj_desc);
status = acpi_ex_read_data_from_field (walk_state, stack_desc, &obj_desc);
*stack_ptr = (void *) obj_desc;
break;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
* $Revision: 47 $
* $Revision: 48 $
*
*****************************************************************************/
......@@ -69,7 +69,7 @@ acpi_ex_check_object_type (
}
if (type_needed != this_type) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Needed [%s], found [%s] %p\n",
acpi_ut_get_type_name (type_needed),
acpi_ut_get_type_name (this_type), object));
......@@ -135,8 +135,8 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (AE_AML_INTERNAL);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X Operand_types=%X \n",
opcode, arg_types));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] Operand_types=%X \n",
opcode, op_info->name, arg_types));
/*
* Normal exit is with (Arg_types == 0) at end of argument list.
......@@ -203,7 +203,7 @@ acpi_ex_resolve_operands (
case AML_LOCAL_OP:
case AML_REVISION_OP:
ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Reference Opcode: %s\n", op_info->name)));
break;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
* $Revision: 162 $
* $Revision: 163 $
*
*****************************************************************************/
......@@ -150,7 +150,7 @@ acpi_ex_store (
* Storing to the Debug object causes the value stored to be
* displayed and otherwise has no effect -- see ACPI Specification
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Write to Debug Object: ****:\n\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Write to Debug Object: ****:\n\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ",
acpi_ut_get_type_name (source_desc->common.type)));
......@@ -191,7 +191,7 @@ acpi_ex_store (
break;
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n"));
break;
......@@ -404,7 +404,7 @@ acpi_ex_store_object_to_node (
target_type = acpi_ns_get_type (node);
target_desc = acpi_ns_get_attached_object (node);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Storing %p(%s) into node %p(%s)\n",
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
source_desc, acpi_ut_get_type_name (source_desc->common.type),
node, acpi_ut_get_type_name (target_type)));
......@@ -456,7 +456,7 @@ acpi_ex_store_object_to_node (
*/
status = acpi_ns_attach_object (node, new_desc, target_type);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Store %s into %s via Convert/Attach\n",
acpi_ut_get_type_name (source_desc->common.type),
acpi_ut_get_type_name (new_desc->common.type)));
......@@ -466,7 +466,7 @@ acpi_ex_store_object_to_node (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Storing %s (%p) directly into node (%p), no implicit conversion\n",
acpi_ut_get_type_name (source_desc->common.type), source_desc, node));
......
......@@ -3,7 +3,7 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
* $Revision: 46 $
* $Revision: 47 $
*
*****************************************************************************/
......@@ -145,7 +145,7 @@ acpi_ex_resolve_object (
* FUNCTION: Acpi_ex_store_object_to_object
*
* PARAMETERS: Source_desc - Object to store
* Dest_desc - Object to recieve a copy of the source
* Dest_desc - Object to receive a copy of the source
* New_desc - New object if Dest_desc is obsoleted
* Walk_state - Current walk state
*
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
* $Revision: 41 $
* $Revision: 42 $
*
*****************************************************************************/
......@@ -104,6 +104,10 @@ acpi_ex_store_buffer_to_buffer (
length, target_desc->buffer.length));
}
/* Copy flags */
target_desc->buffer.flags = source_desc->buffer.flags;
return (AE_OK);
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: hwgpe - Low level GPE enable/disable/clear functions
* $Revision: 39 $
* $Revision: 40 $
*
*****************************************************************************/
......@@ -89,10 +89,10 @@ acpi_hw_enable_gpe (
* Read the current value of the register, set the appropriate bit
* to enable the GPE, and write out the new register.
*/
in_byte = 0;
acpi_os_read_port (acpi_gbl_gpe_register_info[register_index].enable_addr, &in_byte, 8);
acpi_os_write_port (acpi_gbl_gpe_register_info[register_index].enable_addr,
(in_byte | bit_mask), 8);
in_byte = acpi_hw_low_level_read (8,
&acpi_gbl_gpe_register_info[register_index].enable_address, 0);
acpi_hw_low_level_write (8, (in_byte | bit_mask),
&acpi_gbl_gpe_register_info[register_index].enable_address, 0);
}
......@@ -171,10 +171,10 @@ acpi_hw_disable_gpe (
* Read the current value of the register, clear the appropriate bit,
* and write out the new register value to disable the GPE.
*/
in_byte = 0;
acpi_os_read_port (acpi_gbl_gpe_register_info[register_index].enable_addr, &in_byte, 8);
acpi_os_write_port (acpi_gbl_gpe_register_info[register_index].enable_addr,
(in_byte & ~bit_mask), 8);
in_byte = acpi_hw_low_level_read (8,
&acpi_gbl_gpe_register_info[register_index].enable_address, 0);
acpi_hw_low_level_write (8, (in_byte & ~bit_mask),
&acpi_gbl_gpe_register_info[register_index].enable_address, 0);
acpi_hw_disable_gpe_for_wakeup(gpe_number);
}
......@@ -254,7 +254,8 @@ acpi_hw_clear_gpe (
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
acpi_os_write_port (acpi_gbl_gpe_register_info[register_index].status_addr, bit_mask, 8);
acpi_hw_low_level_write (8, bit_mask,
&acpi_gbl_gpe_register_info[register_index].status_address, 0);
}
......@@ -301,8 +302,7 @@ acpi_hw_get_gpe_status (
/* GPE Enabled? */
in_byte = 0;
acpi_os_read_port (gpe_register_info->enable_addr, &in_byte, 8);
in_byte = acpi_hw_low_level_read (8, &gpe_register_info->enable_address, 0);
if (bit_mask & in_byte) {
(*event_status) |= ACPI_EVENT_FLAG_ENABLED;
}
......@@ -315,8 +315,7 @@ acpi_hw_get_gpe_status (
/* GPE active (set)? */
in_byte = 0;
acpi_os_read_port (gpe_register_info->status_addr, &in_byte, 8);
in_byte = acpi_hw_low_level_read (8, &gpe_register_info->status_address, 0);
if (bit_mask & in_byte) {
(*event_status) |= ACPI_EVENT_FLAG_SET;
}
......@@ -357,14 +356,14 @@ acpi_hw_disable_non_wakeup_gpes (
* Read the enabled status of all GPEs. We
* will be using it to restore all the GPEs later.
*/
acpi_os_read_port (gpe_register_info->enable_addr,
&gpe_register_info->enable, 8);
gpe_register_info->enable = (u8) acpi_hw_low_level_read (8,
&gpe_register_info->enable_address, 0);
/*
* Disable all GPEs except wakeup GPEs.
*/
acpi_os_write_port(gpe_register_info->enable_addr,
gpe_register_info->wake_enable, 8);
acpi_hw_low_level_write (8, gpe_register_info->wake_enable,
&gpe_register_info->enable_address, 0);
}
}
......@@ -399,7 +398,7 @@ acpi_hw_enable_non_wakeup_gpes (
* We previously stored the enabled status of all GPEs.
* Blast them back in.
*/
acpi_os_write_port(gpe_register_info->enable_addr,
gpe_register_info->enable, 8);
acpi_hw_low_level_write (8, gpe_register_info->enable, &
gpe_register_info->enable_address, 0);
}
}
......@@ -3,7 +3,7 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
* $Revision: 120 $
* $Revision: 121 $
*
******************************************************************************/
......@@ -73,18 +73,16 @@ acpi_hw_clear_acpi_status (void)
/* Clear the fixed events */
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address)) {
acpi_os_write_port ((ACPI_IO_ADDRESS)
ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address),
ACPI_BITMASK_ALL_FIXED_STATUS, 16);
acpi_hw_low_level_write (16, ACPI_BITMASK_ALL_FIXED_STATUS,
&acpi_gbl_FADT->Xpm1b_evt_blk, 0);
}
/* Clear the GPE Bits */
for (gpe_block = 0; gpe_block < ACPI_MAX_GPE_BLOCKS; gpe_block++) {
for (i = 0; i < acpi_gbl_gpe_block_info[gpe_block].register_count; i++) {
acpi_os_write_port ((ACPI_IO_ADDRESS)
(acpi_gbl_gpe_block_info[gpe_block].block_address + i),
0xFF, 8);
acpi_hw_low_level_write (8, 0xFF,
acpi_gbl_gpe_block_info[gpe_block].block_address, i);
}
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* $Revision: 35 $
* $Revision: 37 $
*
*****************************************************************************/
......@@ -237,6 +237,7 @@ acpi_enter_sleep_state (
PM1Bcontrol |= sleep_enable_reg_info->access_bit_mask;
/* Write #2: SLP_TYP + SLP_EN */
ACPI_FLUSH_CPU_CACHE();
acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1Acontrol);
acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1B_CONTROL, PM1Bcontrol);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwtimer.c - ACPI Power Management Timer Interface
* $Revision: 19 $
* $Revision: 20 $
*
*****************************************************************************/
......@@ -88,8 +88,7 @@ acpi_get_timer (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
acpi_os_read_port ((ACPI_IO_ADDRESS)
ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address), ticks, 32);
*ticks = acpi_hw_low_level_read (32, &acpi_gbl_FADT->Xpm_tmr_blk, 0);
return_ACPI_STATUS (AE_OK);
}
......
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
* $Revision: 94 $
* $Revision: 96 $
*
*****************************************************************************/
......@@ -54,7 +54,7 @@
/* Version string */
#define ACPI_CA_VERSION 0x20020308
#define ACPI_CA_VERSION 0x20020403
/* Version of ACPI supported */
......
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
* $Revision: 57 $
* $Revision: 58 $
*
*****************************************************************************/
......@@ -271,6 +271,9 @@ acpi_status
acpi_db_load_acpi_table (
NATIVE_CHAR *filename);
acpi_status
acpi_db_get_acpi_table (
NATIVE_CHAR *filename);
/*
* dbhistry - debugger HISTORY command
......
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
* $Revision: 51 $
* $Revision: 52 $
*
*****************************************************************************/
......@@ -65,6 +65,14 @@ acpi_status
acpi_ds_get_region_arguments (
acpi_operand_object *rgn_desc);
acpi_status
acpi_ds_get_buffer_arguments (
acpi_operand_object *obj_desc);
acpi_status
acpi_ds_get_package_arguments (
acpi_operand_object *obj_desc);
/* dsctrl - Parser/Interpreter interface, control stack routines */
......@@ -266,10 +274,18 @@ acpi_ds_initialize_objects (
acpi_table_desc *table_desc,
acpi_namespace_node *start_node);
acpi_status
acpi_ds_build_internal_buffer_obj (
acpi_walk_state *walk_state,
acpi_parse_object *op,
u32 buffer_length,
acpi_operand_object **obj_desc_ptr);
acpi_status
acpi_ds_build_internal_package_obj (
acpi_walk_state *walk_state,
acpi_parse_object *op,
u32 package_length,
acpi_operand_object **obj_desc);
acpi_status
......@@ -304,6 +320,12 @@ acpi_ds_eval_region_operands (
acpi_walk_state *walk_state,
acpi_parse_object *op);
acpi_status
acpi_ds_eval_data_object_operands (
acpi_walk_state *walk_state,
acpi_parse_object *op,
acpi_operand_object *obj_desc);
acpi_status
acpi_ds_initialize_region (
acpi_handle obj_handle);
......
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
* $Revision: 75 $
* $Revision: 76 $
*
*****************************************************************************/
......@@ -57,6 +57,10 @@ acpi_ev_fixed_event_dispatch (
* Evmisc
*/
u8
acpi_ev_is_notify_object (
acpi_namespace_node *node);
acpi_status
acpi_ev_acquire_global_lock(
u32 timeout);
......
/******************************************************************************
*
* Name: acexcep.h - Exception codes returned by the ACPI subsystem
* $Revision: 57 $
* $Revision: 59 $
*
*****************************************************************************/
......@@ -74,8 +74,9 @@
#define AE_ALREADY_ACQUIRED (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
#define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
#define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
#define AE_CODE_ENV_MAX 0x001A
#define AE_CODE_ENV_MAX 0x001B
/*
* Programmer exceptions
......@@ -86,8 +87,11 @@
#define AE_BAD_DATA (acpi_status) (0x0004 | AE_CODE_PROGRAMMER)
#define AE_BAD_ADDRESS (acpi_status) (0x0005 | AE_CODE_PROGRAMMER)
#define AE_ALIGNMENT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER)
#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
#define AE_CODE_PGM_MAX 0x0006
#define AE_CODE_PGM_MAX 0x0009
/*
......@@ -188,7 +192,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_env[] =
"AE_NOT_ACQUIRED",
"AE_ALREADY_ACQUIRED",
"AE_NO_HARDWARE_RESPONSE",
"AE_NO_GLOBAL_LOCK"
"AE_NO_GLOBAL_LOCK",
"AE_LOGICAL_ADDRESS"
};
NATIVE_CHAR const *acpi_gbl_exception_names_pgm[] =
......@@ -198,7 +203,10 @@ NATIVE_CHAR const *acpi_gbl_exception_names_pgm[] =
"AE_BAD_PATHNAME",
"AE_BAD_DATA",
"AE_BAD_ADDRESS",
"AE_ALIGNMENT"
"AE_ALIGNMENT",
"AE_BAD_HEX_CONSTANT",
"AE_BAD_OCTAL_CONSTANT",
"AE_BAD_DECIMAL_CONSTANT"
};
NATIVE_CHAR const *acpi_gbl_exception_names_tbl[] =
......
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
* $Revision: 120 $
* $Revision: 121 $
*
*****************************************************************************/
......@@ -71,6 +71,7 @@ extern u32 acpi_gbl_nesting_level;
* of each in the system. Each global points to the actual table.
*
*/
ACPI_EXTERN u32 acpi_gbl_table_flags;
ACPI_EXTERN RSDP_DESCRIPTOR *acpi_gbl_RSDP;
ACPI_EXTERN xsdt_descriptor *acpi_gbl_XSDT;
ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT;
......
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
* $Revision: 132 $
* $Revision: 133 $
*
*****************************************************************************/
......@@ -147,6 +147,7 @@ acpi_ex_set_buffer_datum (
acpi_status
acpi_ex_read_data_from_field (
acpi_walk_state *walk_state,
acpi_operand_object *obj_desc,
acpi_operand_object **ret_buffer_desc);
......
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 159 $
* $Revision: 162 $
*
*****************************************************************************/
......@@ -182,12 +182,18 @@ typedef enum
* be the first byte in this structure.
*/
typedef union acpi_name_union
{
u32 integer;
char ascii[4];
} ACPI_NAME_UNION;
typedef struct acpi_node
{
u8 descriptor; /* Used to differentiate object descriptor types */
u8 type; /* Type associated with this name */
u16 owner_id;
u32 name; /* ACPI Name, always 4 chars per ACPI spec */
ACPI_NAME_UNION name; /* ACPI Name, always 4 chars per ACPI spec */
union acpi_operand_obj *object; /* Pointer to attached ACPI object (optional) */
......@@ -314,8 +320,9 @@ typedef struct
typedef struct
{
u8 address_space_id;
acpi_generic_address *block_address;
u16 register_count;
u16 block_address;
u8 block_base_number;
} ACPI_GPE_BLOCK_INFO;
......@@ -324,8 +331,8 @@ typedef struct
typedef struct
{
u16 status_addr; /* Address of status reg */
u16 enable_addr; /* Address of enable reg */
acpi_generic_address status_address; /* Address of status reg */
acpi_generic_address enable_address; /* Address of enable reg */
u8 status; /* Current value of status reg */
u8 enable; /* Current value of enable reg */
u8 wake_enable; /* Mask of bits to keep enabled when sleeping */
......@@ -413,7 +420,7 @@ struct acpi_obj_mutex;
u8 flags; \
u16 value; \
u16 state; \
u16 acpi_eval; \
u16 reserved; \
void *next; \
typedef struct acpi_common_state
......
This diff is collapsed.
......@@ -83,10 +83,20 @@ acpi_status
acpi_os_terminate (
void);
/*
* ACPI Table interfaces
*/
acpi_status
acpi_os_get_root_pointer (
u32 flags,
ACPI_PHYSICAL_ADDRESS *rsdp_physical_address);
ACPI_POINTER *address);
acpi_status
acpi_os_table_override (
acpi_table_header *existing_table,
acpi_table_header **new_table);
/*
......
......@@ -96,7 +96,7 @@ acpi_free (
acpi_status
acpi_find_root_pointer (
u32 flags,
ACPI_PHYSICAL_ADDRESS *rsdp_physical_address);
ACPI_POINTER *rsdp_address);
acpi_status
acpi_load_tables (
......
/******************************************************************************
*
* Name: acstruct.h - Internal structs
* $Revision: 16 $
* $Revision: 17 $
*
*****************************************************************************/
......@@ -104,8 +104,12 @@ typedef struct acpi_init_walk_info
u16 method_count;
u16 op_region_count;
u16 field_count;
u16 buffer_count;
u16 package_count;
u16 op_region_init;
u16 field_init;
u16 buffer_init;
u16 package_init;
u16 object_count;
acpi_table_desc *table_desc;
......
/******************************************************************************
*
* Name: actables.h - ACPI table management
* $Revision: 35 $
* $Revision: 36 $
*
*****************************************************************************/
......@@ -71,22 +71,16 @@ acpi_tb_get_table_ptr (
acpi_status
acpi_tb_get_table (
ACPI_PHYSICAL_ADDRESS physical_address,
acpi_table_header *buffer_ptr,
ACPI_POINTER *address,
acpi_table_desc *table_info);
acpi_status
acpi_tb_verify_rsdp (
ACPI_PHYSICAL_ADDRESS RSDP_physical_address);
acpi_status
acpi_tb_get_table_facs (
acpi_table_header *buffer_ptr,
acpi_table_desc *table_info);
ACPI_POINTER *address);
ACPI_PHYSICAL_ADDRESS
void
acpi_tb_get_rsdt_address (
void);
ACPI_POINTER *out_address);
acpi_status
acpi_tb_validate_rsdt (
......@@ -94,7 +88,7 @@ acpi_tb_validate_rsdt (
acpi_status
acpi_tb_get_table_pointer (
ACPI_PHYSICAL_ADDRESS physical_address,
ACPI_POINTER *address,
u32 flags,
u32 *size,
acpi_table_header **table_ptr);
......
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
* $Revision: 224 $
* $Revision: 227 $
*
*****************************************************************************/
......@@ -57,12 +57,13 @@ typedef unsigned char BOOLEAN;
typedef unsigned short UINT16;
typedef int INT32;
typedef unsigned int UINT32;
typedef COMPILER_DEPENDENT_INT64 INT64;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef UINT64 NATIVE_UINT;
typedef UINT64 NATIVE_INT;
typedef NATIVE_UINT ACPI_TBLPTR;
typedef UINT64 ACPI_TBLPTR;
typedef UINT64 ACPI_IO_ADDRESS;
typedef UINT64 ACPI_PHYSICAL_ADDRESS;
typedef UINT64 ACPI_SIZE;
......@@ -119,12 +120,13 @@ typedef unsigned char BOOLEAN;
typedef unsigned short UINT16;
typedef int INT32;
typedef unsigned int UINT32;
typedef COMPILER_DEPENDENT_INT64 INT64;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef UINT32 NATIVE_UINT;
typedef INT32 NATIVE_INT;
typedef NATIVE_UINT ACPI_TBLPTR;
typedef UINT64 ACPI_TBLPTR;
typedef UINT32 ACPI_IO_ADDRESS;
typedef UINT64 ACPI_PHYSICAL_ADDRESS;
typedef UINT32 ACPI_SIZE;
......@@ -148,7 +150,6 @@ typedef char NATIVE_CHAR;
/*
* Data type ranges
*/
#define ACPI_UINT8_MAX (UINT8) 0xFF
#define ACPI_UINT16_MAX (UINT16) 0xFFFF
#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF
......@@ -170,6 +171,31 @@ typedef UINT64 u64;
/*! [End] no source code translation !*/
/*
* Pointer overlays to avoid lots of typecasting for
* code that accepts both physical and logical pointers.
*/
typedef union acpi_pointers
{
ACPI_PHYSICAL_ADDRESS physical;
void *logical;
ACPI_TBLPTR value;
} ACPI_POINTERS;
typedef struct acpi_pointer
{
u32 pointer_type;
ACPI_POINTERS pointer;
} ACPI_POINTER;
/* Pointer_types for above */
#define ACPI_LOGICAL_POINTER 0x01
#define ACPI_PHYSICAL_POINTER 0x02
/*
* Useful defines
*/
......
......@@ -3,7 +3,7 @@
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
* $Revision: 66 $
* $Revision: 67 $
*
*****************************************************************************/
......@@ -185,6 +185,7 @@
#define AML_INT_STATICSTRING_OP (u16) 0x0034
#define AML_INT_METHODCALL_OP (u16) 0x0035
#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
#define ARG_NONE 0x0
......@@ -335,15 +336,16 @@
/* Misc */
#define AML_TYPE_CREATE_FIELD 0x11
#define AML_TYPE_CONTROL 0x12
#define AML_TYPE_NAMED_NO_OBJ 0x13
#define AML_TYPE_NAMED_FIELD 0x14
#define AML_TYPE_NAMED_SIMPLE 0x15
#define AML_TYPE_NAMED_COMPLEX 0x16
#define AML_TYPE_RETURN 0x17
#define AML_TYPE_UNDEFINED 0x18
#define AML_TYPE_BOGUS 0x19
#define AML_TYPE_CREATE_OBJECT 0x12
#define AML_TYPE_CONTROL 0x13
#define AML_TYPE_NAMED_NO_OBJ 0x14
#define AML_TYPE_NAMED_FIELD 0x15
#define AML_TYPE_NAMED_SIMPLE 0x16
#define AML_TYPE_NAMED_COMPLEX 0x17
#define AML_TYPE_RETURN 0x18
#define AML_TYPE_UNDEFINED 0x19
#define AML_TYPE_BOGUS 0x1A
/*
......
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
* $Revision: 152 $
* $Revision: 153 $
*
******************************************************************************/
......@@ -522,8 +522,9 @@ acpi_ns_lookup (
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Setting global scope to %p\n", this_node));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Setting current scope to [%4.4s] (%p)\n",
this_node->name.ascii, this_node));
}
}
......
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
* $Revision: 70 $
* $Revision: 72 $
*
******************************************************************************/
......@@ -62,7 +62,7 @@ acpi_ns_create_node (
ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_allocated++);
node->name = name;
node->name.integer = name;
node->reference_count = 1;
ACPI_SET_DESCRIPTOR_TYPE (node, ACPI_DESC_TYPE_NAMED);
......@@ -206,7 +206,7 @@ acpi_ns_install_node (
* We will fill in the actual type when the
* real definition is found later.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[%4.4s] is a forward reference\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] is a forward reference\n",
(char *) &node->name));
}
......@@ -302,7 +302,7 @@ acpi_ns_delete_children (
ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p, Remaining %X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
child_node, acpi_gbl_current_node_count));
/*
......
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
* $Revision: 127 $
* $Revision: 129 $
*
*****************************************************************************/
......@@ -53,7 +53,7 @@ acpi_ns_print_pathname (
u32 num_segments,
char *pathname)
{
ACPI_FUNCTION_NAME ("Acpi_ns_print_pathname");
ACPI_FUNCTION_NAME ("Ns_print_pathname");
if (!(acpi_dbg_level & ACPI_LV_NAMES) || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
......@@ -228,7 +228,7 @@ acpi_ns_dump_one_object (
type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
}
if (!acpi_ut_valid_acpi_name (this_node->name)) {
if (!acpi_ut_valid_acpi_name (this_node->name.integer)) {
ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", this_node->name));
}
......@@ -255,35 +255,52 @@ acpi_ns_dump_one_object (
switch (type) {
case ACPI_TYPE_PROCESSOR:
acpi_os_printf (" ID %d Addr %.4X Len %.4X\n",
obj_desc->processor.proc_id,
obj_desc->processor.address,
obj_desc->processor.length);
break;
case ACPI_TYPE_DEVICE:
acpi_os_printf (" Notification object: %p", obj_desc);
break;
case ACPI_TYPE_METHOD:
acpi_os_printf (" Args %d Len %.4X Aml %p \n",
obj_desc->method.param_count,
obj_desc->method.aml_length,
obj_desc->method.aml_start);
break;
case ACPI_TYPE_INTEGER:
acpi_os_printf (" = %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
case ACPI_TYPE_PACKAGE:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Elements %.2X\n",
obj_desc->package.count);
}
else {
acpi_os_printf (" [Length not yet evaluated]\n");
}
break;
case ACPI_TYPE_BUFFER:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Len %.2X",
obj_desc->buffer.length);
......@@ -296,18 +313,29 @@ acpi_ns_dump_one_object (
}
}
acpi_os_printf ("\n");
}
else {
acpi_os_printf (" [Length not yet evaluated]\n");
}
break;
case ACPI_TYPE_STRING:
acpi_os_printf (" Len %.2X", obj_desc->string.length);
if (obj_desc->string.length > 0) {
acpi_os_printf (" = \"%.32s\"...", obj_desc->string.pointer);
acpi_os_printf (" = \"%.32s\"", obj_desc->string.pointer);
if (obj_desc->string.length > 32) {
acpi_os_printf ("...");
}
}
acpi_os_printf ("\n");
break;
case ACPI_TYPE_REGION:
acpi_os_printf (" [%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
......@@ -316,16 +344,20 @@ acpi_ns_dump_one_object (
obj_desc->region.length);
}
else {
acpi_os_printf (" [Address/Length not evaluated]\n");
acpi_os_printf (" [Address/Length not yet evaluated]\n");
}
break;
case INTERNAL_TYPE_REFERENCE:
acpi_os_printf (" [%s]\n",
acpi_ps_get_opcode_name (obj_desc->reference.opcode));
break;
case ACPI_TYPE_BUFFER_FIELD:
if (obj_desc->buffer_field.buffer_obj &&
obj_desc->buffer_field.buffer_obj->buffer.node) {
acpi_os_printf (" Buf [%4.4s]",
......@@ -333,24 +365,32 @@ acpi_ns_dump_one_object (
}
break;
case INTERNAL_TYPE_REGION_FIELD:
acpi_os_printf (" Rgn [%4.4s]",
(char *) &obj_desc->common_field.region_obj->region.node->name);
break;
case INTERNAL_TYPE_BANK_FIELD:
acpi_os_printf (" Rgn [%4.4s] Bnk [%4.4s]",
(char *) &obj_desc->common_field.region_obj->region.node->name,
(char *) &obj_desc->bank_field.bank_obj->common_field.node->name);
break;
case INTERNAL_TYPE_INDEX_FIELD:
acpi_os_printf (" Idx [%4.4s] Dat [%4.4s]",
(char *) &obj_desc->index_field.index_obj->common_field.node->name,
(char *) &obj_desc->index_field.data_obj->common_field.node->name);
break;
default:
acpi_os_printf (" Object %p\n", obj_desc);
break;
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
* $Revision: 109 $
* $Revision: 112 $
*
******************************************************************************/
......@@ -113,7 +113,7 @@ acpi_ns_evaluate_relative (
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object [%s] not found [%s]\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object [%s] not found [%s]\n",
pathname, acpi_format_exception (status)));
goto cleanup;
}
......@@ -122,12 +122,12 @@ acpi_ns_evaluate_relative (
* Now that we have a handle to the object, we can attempt
* to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n",
pathname, node, acpi_ns_get_attached_object (node)));
status = acpi_ns_evaluate_by_handle (node, params, return_object);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n",
pathname));
cleanup:
......@@ -192,7 +192,7 @@ acpi_ns_evaluate_by_name (
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object at [%s] was not found, status=%.4X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object at [%s] was not found, status=%.4X\n",
pathname, status));
goto cleanup;
}
......@@ -201,12 +201,12 @@ acpi_ns_evaluate_by_name (
* Now that we have a handle to the object, we can attempt
* to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n",
pathname, node, acpi_ns_get_attached_object (node)));
status = acpi_ns_evaluate_by_handle (node, params, return_object);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n",
pathname));
......@@ -390,16 +390,11 @@ acpi_ns_execute_control_method (
return_ACPI_STATUS (AE_NULL_OBJECT);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n",
obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));
ACPI_DUMP_PATHNAME (method_node, "Ns_execute_control_method: Executing",
ACPI_LV_NAMES, _COMPONENT);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n",
obj_desc->method.aml_start + 1));
ACPI_LV_INFO, _COMPONENT);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %x\n",
obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));
/*
* Unlock the namespace before execution. This allows namespace access
......@@ -497,7 +492,7 @@ acpi_ns_get_object_value (
if (ACPI_SUCCESS (status)) {
status = AE_CTRL_RETURN_VALUE;
*return_obj_desc = obj_desc;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Returning obj %p\n", *return_obj_desc));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning obj %p\n", *return_obj_desc));
}
}
......
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
* $Revision: 41 $
* $Revision: 43 $
*
*****************************************************************************/
......@@ -59,15 +59,11 @@ acpi_ns_initialize_objects (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region and Field initialization:"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region/Field/Buffer/Package initialization:"));
/* Set all init info to zero */
info.field_count = 0;
info.field_init = 0;
info.op_region_count = 0;
info.op_region_init = 0;
info.object_count = 0;
ACPI_MEMSET (&info, 0, sizeof (acpi_init_walk_info));
/* Walk entire namespace from the supplied root */
......@@ -79,9 +75,11 @@ acpi_ns_initialize_objects (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n",
info.op_region_init, info.op_region_count, info.field_init,
info.field_count, info.object_count));
"\n Initialized %d/%d Regions %d/%d Fields %d/%d Buffers %d/%d Packages (%d nodes)\n",
info.op_region_init, info.op_region_count,
info.field_init, info.field_count,
info.buffer_init, info.buffer_count,
info.package_init, info.package_count, info.object_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"%d Control Methods found\n", info.method_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
......@@ -118,12 +116,15 @@ acpi_ns_initialize_devices (
ACPI_FUNCTION_TRACE ("Ns_initialize_devices");
/* Init counters */
info.device_count = 0;
info.num_STA = 0;
info.num_INI = 0;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing all Device _STA and_INI methods:"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing device _INI methods:"));
/* Walk namespace for all objects of type Device */
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL);
......@@ -132,9 +133,8 @@ acpi_ns_initialize_devices (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"\n%d Devices found: %d _STA, %d _INI\n",
"\n%d Devices found containing: %d _STA, %d _INI methods\n",
info.device_count, info.num_STA, info.num_INI));
return_ACPI_STATUS (status);
......@@ -180,7 +180,6 @@ acpi_ns_init_one_object (
info->object_count++;
/* And even then, we are only interested in a few object types */
type = acpi_ns_get_type (obj_handle);
......@@ -189,11 +188,37 @@ acpi_ns_init_one_object (
return (AE_OK);
}
if ((type != ACPI_TYPE_REGION) &&
(type != ACPI_TYPE_BUFFER_FIELD)) {
/* Increment counters for object types we are looking for */
switch (type) {
case ACPI_TYPE_REGION:
info->op_region_count++;
break;
case ACPI_TYPE_BUFFER_FIELD:
info->field_count++;
break;
case ACPI_TYPE_BUFFER:
info->buffer_count++;
break;
case ACPI_TYPE_PACKAGE:
info->package_count++;
break;
default:
/* No init required, just exit now */
return (AE_OK);
}
/*
* If the object is already initialized, nothing else to do
*/
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
return (AE_OK);
}
/*
* Must lock the interpreter before executing AML code
......@@ -203,61 +228,53 @@ acpi_ns_init_one_object (
return (status);
}
/*
* Each of these types can contain executable AML code within
* the declaration.
*/
switch (type) {
case ACPI_TYPE_REGION:
info->op_region_count++;
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
break;
}
info->op_region_init++;
status = acpi_ds_get_region_arguments (obj_desc);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"%s while getting region arguments [%4.4s]\n",
acpi_format_exception (status), (char *) &node->name));
}
break;
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
case ACPI_TYPE_BUFFER_FIELD:
info->field_init++;
status = acpi_ds_get_buffer_field_arguments (obj_desc);
break;
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_BUFFER:
info->field_count++;
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
info->buffer_init++;
status = acpi_ds_get_buffer_arguments (obj_desc);
break;
case ACPI_TYPE_PACKAGE:
info->package_init++;
status = acpi_ds_get_package_arguments (obj_desc);
break;
}
info->field_init++;
status = acpi_ds_get_buffer_field_arguments (obj_desc);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"%s while getting buffer field arguments [%4.4s]\n",
acpi_format_exception (status), (char *) &node->name));
"Could not execute arguments for [%4.4s] (%s), %s\n",
(char *) &node->name, acpi_ut_get_type_name (type), acpi_format_exception (status)));
}
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
break;
default:
break;
}
/*
* We ignore errors from above, and always return OK, since
* we don't want to abort the walk on a single error.
* we don't want to abort the walk on any single error.
*/
acpi_ex_exit_interpreter ();
return (AE_OK);
......@@ -335,7 +352,6 @@ acpi_ns_init_one_device (
return_ACPI_STATUS(AE_CTRL_DEPTH);
}
/*
* The device is present. Run _INI.
*/
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsobject - Utilities for objects attached to namespace
* table entries
* $Revision: 78 $
* $Revision: 80 $
*
******************************************************************************/
......@@ -221,7 +221,7 @@ acpi_ns_detach_object (
node->type = ACPI_TYPE_ANY;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Node %p [%4.4s] Object %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Node %p [%4.4s] Object %p\n",
node, (char *) &node->name, obj_desc));
/* Remove one reference on the object (and all subobjects) */
......@@ -280,7 +280,7 @@ acpi_operand_object *
acpi_ns_get_secondary_object (
acpi_operand_object *obj_desc)
{
ACPI_FUNCTION_TRACE_PTR ("Acpi_ns_get_secondary_object", obj_desc);
ACPI_FUNCTION_TRACE_PTR ("Ns_get_secondary_object", obj_desc);
if ((!obj_desc) ||
......
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
* $Revision: 83 $
* $Revision: 84 $
*
******************************************************************************/
......@@ -95,7 +95,7 @@ acpi_ns_search_node (
while (next_node) {
/* Check for match against the name */
if (next_node->name == target_name) {
if (next_node->name.integer == target_name) {
/*
* Found matching entry. Capture the type if appropriate, before
* returning the entry.
......@@ -146,8 +146,8 @@ acpi_ns_search_node (
/* Searched entire table, not found */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n",
(char *) &target_name, type, next_node));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s Type [%s] not found at %p\n",
(char *) &target_name, acpi_ut_get_type_name (type), next_node));
return_ACPI_STATUS (AE_NOT_FOUND);
}
......@@ -206,8 +206,8 @@ acpi_ns_search_parent_tree (
}
if (acpi_ns_local (type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type %X is local(no search)\n",
(char *) &target_name, type));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type [%s] must be local to this scope (no parent search)\n",
(char *) &target_name, acpi_ut_get_type_name (type)));
}
return_ACPI_STATUS (AE_NOT_FOUND);
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
* $Revision: 104 $
* $Revision: 105 $
*
*****************************************************************************/
......@@ -254,7 +254,6 @@ acpi_ns_build_internal_name (
result = &internal_name[3];
}
}
else {
/*
* Not fully qualified.
......@@ -281,7 +280,6 @@ acpi_ns_build_internal_name (
}
}
/* Build the name (minus path separators) */
for (; num_segments; num_segments--) {
......@@ -319,11 +317,11 @@ acpi_ns_build_internal_name (
if (info->fully_qualified) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (abs) \"\\%s\"\n",
internal_name, &internal_name[0]));
internal_name, internal_name));
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (rel) \"%s\"\n",
internal_name, &internal_name[2]));
internal_name, internal_name));
}
return_ACPI_STATUS (AE_OK);
......@@ -823,8 +821,8 @@ acpi_ns_find_parent_name (
child_node, (char *) &child_node->name,
parent_node, (char *) &parent_node->name));
if (parent_node->name) {
return_VALUE (parent_node->name);
if (parent_node->name.integer) {
return_VALUE (parent_node->name.integer);
}
}
......@@ -863,7 +861,7 @@ acpi_ns_exist_downstream_sibling (
return (FALSE);
}
if (node->name) {
if (node->name.integer) {
return (TRUE);
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsxfname - Public interfaces to the ACPI subsystem
* ACPI Namespace oriented interfaces
* $Revision: 89 $
* $Revision: 90 $
*
*****************************************************************************/
......@@ -244,7 +244,7 @@ acpi_get_object_info (
}
info->type = node->type;
info->name = node->name;
info->name = node->name.integer;
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
......
/******************************************************************************
*
* Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 64 $
* $Revision: 66 $
*
*****************************************************************************/
......@@ -219,7 +219,7 @@
#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_BREAK_OP ARG_NONE
#define ARGI_BREAK_POINT_OP ARG_NONE
#define ARGI_BUFFER_OP ARGI_INVALID_OPCODE
#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
......@@ -284,7 +284,7 @@
#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
#define ARGI_ONE_OP ARG_NONE
#define ARGI_ONES_OP ARG_NONE
#define ARGI_PACKAGE_OP ARGI_INVALID_OPCODE
#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE
#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
......@@ -315,7 +315,7 @@
#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
#define ARGI_VAR_PACKAGE_OP ARGI_INVALID_OPCODE
#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
#define ARGI_WORD_OP ARGI_INVALID_OPCODE
......@@ -422,6 +422,7 @@
AML_CREATE_DWORD_FIELD_OP
AML_CREATE_QWORD_FIELD_OP
AML_REGION_OP
AML_BUFFER_OP
Field opcodes
......@@ -461,8 +462,8 @@ static const acpi_opcode_info acpi_gbl_aml_op_info[] =
/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS),
/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS),
/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER),
/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER),
/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
......@@ -573,7 +574,7 @@ static const acpi_opcode_info acpi_gbl_aml_op_info[] =
/* ACPI 2.0 opcodes */
/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 6F */ ACPI_OP ("Package /*Var*/", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS | AML_DEFER),
/* 6F */ ACPI_OP ("Package /*Var*/", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER),
/* 70 */ ACPI_OP ("ConcatenateResTemplate", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
......@@ -587,6 +588,7 @@ static const acpi_opcode_info acpi_gbl_aml_op_info[] =
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE)
/*! [End] no source code translation !*/
};
......@@ -606,7 +608,7 @@ static const u8 acpi_gbl_short_op_index[256] =
/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, _UNK,
/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
......
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
* $Revision: 119 $
* $Revision: 121 $
*
*****************************************************************************/
......@@ -220,7 +220,7 @@ acpi_ps_complete_this_op (
/*
* These opcodes contain Term_arg operands. The current
* op must be replace by a placeholder return op
* op must be replaced by a placeholder return op
*/
replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP);
if (!replacement_op) {
......@@ -232,15 +232,35 @@ acpi_ps_complete_this_op (
/*
* These opcodes contain Term_arg operands. The current
* op must be replace by a placeholder return op
* op must be replaced by a placeholder return op
*/
if ((op->parent->opcode == AML_REGION_OP) ||
(op->parent->opcode == AML_DATA_REGION_OP)) {
(op->parent->opcode == AML_DATA_REGION_OP) ||
(op->parent->opcode == AML_BUFFER_OP) ||
(op->parent->opcode == AML_PACKAGE_OP) ||
(op->parent->opcode == AML_VAR_PACKAGE_OP)) {
replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP);
if (!replacement_op) {
return_VALUE (FALSE);
}
}
if ((op->parent->opcode == AML_NAME_OP) &&
(walk_state->descending_callback != acpi_ds_exec_begin_op)) {
if ((op->opcode == AML_BUFFER_OP) ||
(op->opcode == AML_PACKAGE_OP) ||
(op->opcode == AML_VAR_PACKAGE_OP)) {
replacement_op = acpi_ps_alloc_op (op->opcode);
if (!replacement_op) {
return_VALUE (FALSE);
}
((acpi_parse2_object *) replacement_op)->data =
((acpi_parse2_object *) op)->data;
((acpi_parse2_object *) replacement_op)->length =
((acpi_parse2_object *) op)->length;
}
}
break;
default:
......@@ -259,6 +279,7 @@ acpi_ps_complete_this_op (
if (replacement_op) {
replacement_op->parent = op->parent;
replacement_op->value.arg = NULL;
replacement_op->node = op->node;
op->parent->value.arg = replacement_op;
replacement_op->next = op->next;
}
......@@ -277,6 +298,7 @@ acpi_ps_complete_this_op (
if (replacement_op) {
replacement_op->parent = op->parent;
replacement_op->value.arg = NULL;
replacement_op->node = op->node;
prev->next = replacement_op;
replacement_op->next = op->next;
next = NULL;
......@@ -312,9 +334,10 @@ acpi_ps_complete_this_op (
*
* PARAMETERS: Parser_state - Current parser state object
*
* RETURN:
* RETURN: Status
*
* DESCRIPTION:
* DESCRIPTION: Update the parser state based upon the return exception from
* the parser callback.
*
******************************************************************************/
......@@ -441,7 +464,7 @@ acpi_ps_parse_loop (
acpi_parse_object *arg = NULL;
acpi_parse_object pre_op;
acpi_parse_state *parser_state;
u8 *aml_op_start;
u8 *aml_op_start = NULL;
ACPI_FUNCTION_TRACE_PTR ("Ps_parse_loop", walk_state);
......@@ -465,7 +488,6 @@ acpi_ps_parse_loop (
(walk_state->control_state) &&
(walk_state->control_state->common.state ==
ACPI_CONTROL_PREDICATE_EXECUTING)) {
/*
* A predicate was just completed, get the value of the
* predicate and branch based on that value
......@@ -491,7 +513,6 @@ acpi_ps_parse_loop (
acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op));
}
else if (walk_state->prev_op) {
/* We were in the middle of an op */
......@@ -535,8 +556,8 @@ acpi_ps_parse_loop (
/* The opcode is unrecognized. Just skip unknown opcodes */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Found unknown opcode %X at AML offset %X, ignoring\n",
walk_state->opcode, walk_state->aml_offset));
"Found unknown opcode %X at AML address %p offset %X, ignoring\n",
walk_state->opcode, parser_state->aml, walk_state->aml_offset));
ACPI_DUMP_BUFFER (parser_state->aml, 128);
......@@ -552,10 +573,8 @@ acpi_ps_parse_loop (
parser_state->aml += acpi_ps_get_opcode_size (walk_state->opcode);
walk_state->arg_types = walk_state->op_info->parse_args;
break;
}
/* Create Op structure and append to parent's argument list */
if (walk_state->op_info->flags & AML_NAMED) {
......@@ -570,7 +589,6 @@ acpi_ps_parse_loop (
INCREMENT_ARG_LIST (walk_state->arg_types);
}
/* We know that this arg is a name, move to next arg */
INCREMENT_ARG_LIST (walk_state->arg_types);
......@@ -624,7 +642,6 @@ acpi_ps_parse_loop (
((acpi_parse2_object * ) op)->length = 0;
}
}
else {
/* Not a named opcode, just allocate Op and append to parent */
......@@ -680,7 +697,7 @@ acpi_ps_parse_loop (
walk_state->arg_count = 0;
if (walk_state->arg_types) /* Are there any arguments that must be processed? */ {
/* get arguments */
/* Get arguments */
switch (op->opcode) {
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
......@@ -689,7 +706,7 @@ acpi_ps_parse_loop (
case AML_QWORD_OP: /* AML_QWORDATA_ARG */
case AML_STRING_OP: /* AML_ASCIICHARLIST_ARG */
/* fill in constant or string argument directly */
/* Fill in constant or string argument directly */
acpi_ps_get_next_simple_arg (parser_state,
GET_CURRENT_ARG_TYPE (walk_state->arg_types), op);
......@@ -719,9 +736,11 @@ acpi_ps_parse_loop (
INCREMENT_ARG_LIST (walk_state->arg_types);
}
switch (op->opcode) {
case AML_METHOD_OP:
/* For a method, save the length and address of the body */
if (op->opcode == AML_METHOD_OP) {
/*
* Skip parsing of control method or opregion body,
* because we don't have enough info in the first pass
......@@ -730,7 +749,6 @@ acpi_ps_parse_loop (
((acpi_parse2_object * ) op)->data = parser_state->aml;
((acpi_parse2_object * ) op)->length = (u32) (parser_state->pkg_end -
parser_state->aml);
/*
* Skip body of method. For Op_regions, we must continue
* parsing because the opregion is not a standalone
......@@ -738,17 +756,42 @@ acpi_ps_parse_loop (
*/
parser_state->aml = parser_state->pkg_end;
walk_state->arg_count = 0;
break;
case AML_BUFFER_OP:
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
if ((op->parent) &&
(op->parent->opcode == AML_NAME_OP) &&
(walk_state->descending_callback != acpi_ds_exec_begin_op)) {
/*
* Skip parsing of
* because we don't have enough info in the first pass
* to parse them correctly.
*/
((acpi_parse2_object * ) op)->data = aml_op_start;
((acpi_parse2_object * ) op)->length = (u32) (parser_state->pkg_end -
aml_op_start);
/*
* Skip body
*/
parser_state->aml = parser_state->pkg_end;
walk_state->arg_count = 0;
}
else if (op->opcode == AML_WHILE_OP) {
break;
case AML_WHILE_OP:
if (walk_state->control_state) {
walk_state->control_state->control.package_end = parser_state->pkg_end;
}
break;
}
break;
}
}
/* Check for arguments that need to be processed */
if (walk_state->arg_count) {
......@@ -759,7 +802,6 @@ acpi_ps_parse_loop (
continue;
}
/* All arguments have been processed -- Op is complete, prepare for next */
walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
......
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
* $Revision: 49 $
* $Revision: 50 $
*
*****************************************************************************/
......@@ -97,30 +97,25 @@ acpi_ps_alloc_op (
size = sizeof (acpi_parse2_object);
flags = ACPI_PARSEOP_DEFERRED;
}
else if (op_info->flags & AML_NAMED) {
size = sizeof (acpi_parse2_object);
flags = ACPI_PARSEOP_NAMED;
}
else if (opcode == AML_INT_BYTELIST_OP) {
size = sizeof (acpi_parse2_object);
flags = ACPI_PARSEOP_BYTELIST;
}
else {
size = sizeof (acpi_parse_object);
flags = ACPI_PARSEOP_GENERIC;
}
if (size == sizeof (acpi_parse_object)) {
/*
* The generic op is by far the most common (16 to 1)
*/
op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE);
}
else {
op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT);
}
......@@ -157,13 +152,12 @@ acpi_ps_free_op (
if (op->opcode == AML_INT_RETURN_VALUE_OP) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Free retval op: %p\n", op));
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", op));
}
if (op->flags == ACPI_PARSEOP_GENERIC) {
acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op);
}
else {
acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE_EXT, op);
}
......
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
* $Revision: 59 $
* $Revision: 61 $
*
*****************************************************************************/
......@@ -102,7 +102,7 @@ acpi_psx_execute (
* 1) Perform the first pass parse of the method to enter any
* named objects that it creates into the namespace
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Parse **** Entry=%p obj=%p\n",
method_node, obj_desc));
......@@ -144,7 +144,7 @@ acpi_psx_execute (
/*
* 2) Execute the method. Performs second pass parse simultaneously
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Execution **** Entry=%p obj=%p\n",
method_node, obj_desc));
......@@ -157,7 +157,7 @@ acpi_psx_execute (
/* Init new op with the method name and pointer back to the NS node */
acpi_ps_set_name (op, method_node->name);
acpi_ps_set_name (op, method_node->name.integer);
op->node = method_node;
/* Create and initialize a new walk state */
......@@ -194,7 +194,7 @@ acpi_psx_execute (
* a control exception code
*/
if (*return_obj_desc) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned Obj_desc=%p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned Obj_desc=%p\n",
*return_obj_desc));
ACPI_DUMP_STACK_ENTRY (*return_obj_desc);
......
This diff is collapsed.
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
* $Revision: 55 $
* $Revision: 57 $
*
*****************************************************************************/
......@@ -177,12 +177,20 @@ acpi_tb_recognize_table (
* We only "recognize" a limited number of ACPI tables -- namely, the
* ones that are used by the subsystem (DSDT, FADT, etc.)
*
* An AE_NOT_FOUND means that the table was not recognized.
* An AE_TABLE_NOT_SUPPORTED means that the table was not recognized.
* This can be any one of many valid ACPI tables, it just isn't one of
* the tables that is consumed by the core subsystem
*/
status = acpi_tb_match_signature (table_header->signature, table_info);
if (ACPI_SUCCESS (status)) {
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
status = acpi_tb_validate_table_header (table_header);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Return the table type and length via the info struct */
table_info->length = table_header->length;
......@@ -200,7 +208,6 @@ acpi_tb_recognize_table (
status = AE_OK;
}
}
}
return_ACPI_STATUS (status);
}
......@@ -372,10 +379,6 @@ acpi_tb_delete_acpi_table (
return;
}
/* Free the table */
acpi_tb_free_acpi_tables_of_type (&acpi_gbl_acpi_tables[type]);
/* Clear the appropriate "typed" global table pointer */
switch (type) {
......@@ -405,6 +408,10 @@ acpi_tb_delete_acpi_table (
break;
}
/* Free the table */
acpi_tb_free_acpi_tables_of_type (&acpi_gbl_acpi_tables[type]);
(void) acpi_ut_release_mutex (ACPI_MTX_TABLES);
return_VOID;
}
......
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
* $Revision: 49 $
* $Revision: 51 $
*
*****************************************************************************/
......@@ -71,7 +71,6 @@ acpi_tb_handle_to_object (
} while (list_head != &acpi_gbl_acpi_tables[i]);
}
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table_id=%X does not exist\n", table_id));
return (AE_BAD_PARAMETER);
}
......@@ -115,7 +114,6 @@ acpi_tb_validate_table_header (
return (AE_BAD_ADDRESS);
}
/* Ensure that the signature is 4 ASCII characters */
ACPI_MOVE_UNALIGNED32_TO_32 (&signature, &table_header->signature);
......@@ -124,12 +122,11 @@ acpi_tb_validate_table_header (
"Table signature at %p [%p] has invalid characters\n",
table_header, &signature));
ACPI_REPORT_WARNING (("Invalid table signature %4.4s found\n", (char *) &signature));
ACPI_REPORT_WARNING (("Invalid table signature found: [%4.4s]\n", (char *) &signature));
ACPI_DUMP_BUFFER (table_header, sizeof (acpi_table_header));
return (AE_BAD_SIGNATURE);
}
/* Validate the table length */
if (table_header->length < sizeof (acpi_table_header)) {
......@@ -208,10 +205,10 @@ acpi_tb_map_acpi_table (
}
}
/* Map the physical memory for the correct length */
status = acpi_os_map_memory (physical_address, table_size, (void **) &table);
status = acpi_os_map_memory (physical_address, table_size,
(void **) &table);
if (ACPI_FAILURE (status)) {
return (status);
}
......@@ -222,7 +219,6 @@ acpi_tb_map_acpi_table (
*size = table_size;
*logical_address = table;
return (status);
}
......@@ -263,8 +259,6 @@ acpi_tb_verify_table_checksum (
status = AE_BAD_CHECKSUM;
}
return_ACPI_STATUS (status);
}
......@@ -301,7 +295,6 @@ acpi_tb_checksum (
sum = (u8) (sum + *rover);
}
}
return (sum);
}
......
This diff is collapsed.
This diff is collapsed.
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
* $Revision: 94 $
* $Revision: 95 $
*
*****************************************************************************/
......@@ -654,6 +654,9 @@ acpi_ut_copy_simple_object (
case ACPI_TYPE_BUFFER:
dest_desc->buffer.node = NULL;
dest_desc->common.flags = source_desc->common.flags;
/* Fall through to common string/buffer case */
case ACPI_TYPE_STRING:
......@@ -744,6 +747,7 @@ acpi_ut_copy_ielement_to_ielement (
}
target_object->package.count = source_object->package.count;
target_object->common.flags = source_object->common.flags;
/*
* Pass the new package object back to the package walk routine
......@@ -792,6 +796,7 @@ acpi_ut_copy_ipackage_to_ipackage (
dest_obj->common.type = source_obj->common.type;
dest_obj->common.flags = source_obj->common.flags;
dest_obj->package.count = source_obj->package.count;
......@@ -806,10 +811,6 @@ acpi_ut_copy_ipackage_to_ipackage (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Init */
dest_obj->package.next_element = dest_obj->package.elements;
/*
* Copy the package element-by-element by walking the package "tree".
* This handles nested packages of arbitrary depth.
......
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