Commit 8b9d280c authored by Andy Grover's avatar Andy Grover

Merge groveronline.com:/root/bk/linux-2.5

into groveronline.com:/root/bk/linux-acpi
parents 5fe41502 3cd23581
...@@ -72,6 +72,11 @@ CONFIG_ACPI_PROCESSOR ...@@ -72,6 +72,11 @@ CONFIG_ACPI_PROCESSOR
ACPI C2 and C3 processor states to save power, on systems that ACPI C2 and C3 processor states to save power, on systems that
support it. support it.
CONFIG_ACPI_PROCESSOR_PERF
This driver adds support for CPU frequency scaling, if this is supported
by the hardware and the BIOS. If you are compiling for a mobile system,
say Y.
CONFIG_ACPI_THERMAL CONFIG_ACPI_THERMAL
This driver adds support for ACPI thermal zones. Most mobile and This driver adds support for ACPI thermal zones. Most mobile and
some desktop systems support ACPI thermal zones. It is HIGHLY some desktop systems support ACPI thermal zones. It is HIGHLY
......
...@@ -21,6 +21,12 @@ if [ "$CONFIG_X86" = "y" ]; then ...@@ -21,6 +21,12 @@ if [ "$CONFIG_X86" = "y" ]; then
tristate ' Button' CONFIG_ACPI_BUTTON tristate ' Button' CONFIG_ACPI_BUTTON
tristate ' Fan' CONFIG_ACPI_FAN tristate ' Fan' CONFIG_ACPI_FAN
tristate ' Processor' CONFIG_ACPI_PROCESSOR tristate ' Processor' CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_ACPI_PROCESSOR" != "n" ]; then
bool ' Processor Performance States' CONFIG_ACPI_PROCESSOR_PERF
if [ "$CONFIG_CPU_FREQ" != "y" ]; then
define_bool CONFIG_CPU_FREQ $CONFIG_ACPI_PROCESSOR_PERF
fi
fi
dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_NUMA" = "y" ]; then if [ "$CONFIG_NUMA" = "y" ]; then
dep_bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA dep_bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA
......
...@@ -86,6 +86,7 @@ EXPORT_SYMBOL(acpi_get_register); ...@@ -86,6 +86,7 @@ EXPORT_SYMBOL(acpi_get_register);
EXPORT_SYMBOL(acpi_set_register); EXPORT_SYMBOL(acpi_set_register);
EXPORT_SYMBOL(acpi_enter_sleep_state); EXPORT_SYMBOL(acpi_enter_sleep_state);
EXPORT_SYMBOL(acpi_get_system_info); EXPORT_SYMBOL(acpi_get_system_info);
EXPORT_SYMBOL(acpi_get_devices);
/* ACPI OS Services Layer (acpi_osl.c) */ /* ACPI OS Services Layer (acpi_osl.c) */
...@@ -100,6 +101,8 @@ EXPORT_SYMBOL(acpi_os_create_semaphore); ...@@ -100,6 +101,8 @@ EXPORT_SYMBOL(acpi_os_create_semaphore);
EXPORT_SYMBOL(acpi_os_delete_semaphore); EXPORT_SYMBOL(acpi_os_delete_semaphore);
EXPORT_SYMBOL(acpi_os_wait_semaphore); EXPORT_SYMBOL(acpi_os_wait_semaphore);
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
/* ACPI Utilities (acpi_utils.c) */ /* ACPI Utilities (acpi_utils.c) */
EXPORT_SYMBOL(acpi_extract_package); EXPORT_SYMBOL(acpi_extract_package);
...@@ -126,3 +129,15 @@ EXPORT_SYMBOL(acpi_bus_register_driver); ...@@ -126,3 +129,15 @@ EXPORT_SYMBOL(acpi_bus_register_driver);
EXPORT_SYMBOL(acpi_bus_unregister_driver); EXPORT_SYMBOL(acpi_bus_unregister_driver);
#endif /*CONFIG_ACPI_BUS*/ #endif /*CONFIG_ACPI_BUS*/
/* ACPI PCI Driver (pci_irq.c) */
#ifdef CONFIG_ACPI_PCI
#include <linux/pci.h>
extern int acpi_pci_irq_enable(struct pci_dev *dev);
EXPORT_SYMBOL(acpi_pci_irq_enable);
extern int acpi_pci_irq_lookup (int segment, int bus, int device, int pin);
EXPORT_SYMBOL(acpi_pci_irq_lookup);
#endif /*CONFIG_ACPI_PCI */
...@@ -78,9 +78,7 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata = ...@@ -78,9 +78,7 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata =
{"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1}, {"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
/* IBM 600E - _ADR should return 7, but it returns 1 */ /* IBM 600E - _ADR should return 7, but it returns 1 */
{"IBM ", "TP600E ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1}, {"IBM ", "TP600E ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1},
{"VIA694", "AWRDACPI", 0, ACPI_DSDT, all_versions, "Bogus table", 1},
{"ASUS\0\0", "P2B-S ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1}, {"ASUS\0\0", "P2B-S ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
{"COMPAQ", "DSDT", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
{""} {""}
}; };
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsfield - Dispatcher field routines * Module Name: dsfield - Dispatcher field routines
* $Revision: 68 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -103,7 +103,7 @@ acpi_ds_create_buffer_field ( ...@@ -103,7 +103,7 @@ acpi_ds_create_buffer_field (
* Enter the Name_string into the namespace * Enter the Name_string into the namespace
*/ */
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_DEF_ANY, ACPI_IMODE_LOAD_PASS1, ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
flags, walk_state, &(node)); flags, walk_state, &(node));
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status); ACPI_REPORT_NSERROR (arg->common.value.string, status);
...@@ -343,7 +343,7 @@ acpi_ds_create_field ( ...@@ -343,7 +343,7 @@ acpi_ds_create_field (
/* Each remaining arg is a Named Field */ /* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_REGION_FIELD; info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD;
info.region_node = region_node; info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
...@@ -384,17 +384,17 @@ acpi_ds_init_field_objects ( ...@@ -384,17 +384,17 @@ acpi_ds_init_field_objects (
switch (walk_state->opcode) { switch (walk_state->opcode) {
case AML_FIELD_OP: case AML_FIELD_OP:
arg = acpi_ps_get_arg (op, 2); arg = acpi_ps_get_arg (op, 2);
type = INTERNAL_TYPE_REGION_FIELD; type = ACPI_TYPE_LOCAL_REGION_FIELD;
break; break;
case AML_BANK_FIELD_OP: case AML_BANK_FIELD_OP:
arg = acpi_ps_get_arg (op, 4); arg = acpi_ps_get_arg (op, 4);
type = INTERNAL_TYPE_BANK_FIELD; type = ACPI_TYPE_LOCAL_BANK_FIELD;
break; break;
case AML_INDEX_FIELD_OP: case AML_INDEX_FIELD_OP:
arg = acpi_ps_get_arg (op, 3); arg = acpi_ps_get_arg (op, 3);
type = INTERNAL_TYPE_INDEX_FIELD; type = ACPI_TYPE_LOCAL_INDEX_FIELD;
break; break;
default: default:
...@@ -477,11 +477,11 @@ acpi_ds_create_bank_field ( ...@@ -477,11 +477,11 @@ acpi_ds_create_bank_field (
} }
} }
/* Second arg is the Bank Register (must already exist) */ /* Second arg is the Bank Register (Field) (must already exist) */
arg = arg->common.next; arg = arg->common.next;
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_BANK_FIELD_DEFN, ACPI_IMODE_EXECUTE, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status); ACPI_REPORT_NSERROR (arg->common.value.string, status);
...@@ -500,7 +500,7 @@ acpi_ds_create_bank_field ( ...@@ -500,7 +500,7 @@ acpi_ds_create_bank_field (
/* Each remaining arg is a Named Field */ /* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_BANK_FIELD; info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD;
info.region_node = region_node; info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
...@@ -552,7 +552,7 @@ acpi_ds_create_index_field ( ...@@ -552,7 +552,7 @@ acpi_ds_create_index_field (
arg = arg->common.next; arg = arg->common.next;
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_INDEX_FIELD_DEFN, ACPI_IMODE_EXECUTE, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node); ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status); ACPI_REPORT_NSERROR (arg->common.value.string, status);
...@@ -566,7 +566,7 @@ acpi_ds_create_index_field ( ...@@ -566,7 +566,7 @@ acpi_ds_create_index_field (
/* Each remaining arg is a Named Field */ /* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_INDEX_FIELD; info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD;
info.region_node = region_node; info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsmthdat - control method arguments and local variables * Module Name: dsmthdat - control method arguments and local variables
* $Revision: 63 $ * $Revision: 64 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -603,7 +603,7 @@ acpi_ds_store_object_to_local ( ...@@ -603,7 +603,7 @@ acpi_ds_store_object_to_local (
* If we have a valid reference object that came from Ref_of(), do the * If we have a valid reference object that came from Ref_of(), do the
* indirect store * indirect store
*/ */
if ((current_obj_desc->common.type == INTERNAL_TYPE_REFERENCE) && if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
(current_obj_desc->reference.opcode == AML_REF_OF_OP)) { (current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Arg (%p) is an Obj_ref(Node), storing in node %p\n", "Arg (%p) is an Obj_ref(Node), storing in node %p\n",
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsobject - Dispatcher object management routines * Module Name: dsobject - Dispatcher object management routines
* $Revision: 108 $ * $Revision: 110 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -707,7 +707,7 @@ acpi_ds_init_object_from_op ( ...@@ -707,7 +707,7 @@ acpi_ds_init_object_from_op (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
obj_desc->string.pointer = op->common.value.string; obj_desc->string.pointer = op->common.value.string;
obj_desc->string.length = ACPI_STRLEN (op->common.value.string); obj_desc->string.length = (u32) ACPI_STRLEN (op->common.value.string);
/* /*
* The string is contained in the ACPI table, don't ever try * The string is contained in the ACPI table, don't ever try
...@@ -721,7 +721,7 @@ acpi_ds_init_object_from_op ( ...@@ -721,7 +721,7 @@ acpi_ds_init_object_from_op (
break; break;
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (op_info->type) { switch (op_info->type) {
case AML_TYPE_LOCAL_VARIABLE: case AML_TYPE_LOCAL_VARIABLE:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dsopcode - Dispatcher Op Region support and handling of * Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes * "control" opcodes
* $Revision: 82 $ * $Revision: 83 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -1021,7 +1021,7 @@ acpi_ds_exec_end_control_op ( ...@@ -1021,7 +1021,7 @@ acpi_ds_exec_end_control_op (
* Allow references created by the Index operator to return unchanged. * Allow references created by the Index operator to return unchanged.
*/ */
if ((ACPI_GET_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc[0]) == ACPI_DESC_TYPE_OPERAND) && if ((ACPI_GET_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc[0]) == ACPI_DESC_TYPE_OPERAND) &&
(ACPI_GET_OBJECT_TYPE (walk_state->results->results.obj_desc [0]) == INTERNAL_TYPE_REFERENCE) && (ACPI_GET_OBJECT_TYPE (walk_state->results->results.obj_desc [0]) == ACPI_TYPE_LOCAL_REFERENCE) &&
((walk_state->results->results.obj_desc [0])->reference.opcode != AML_INDEX_OP)) { ((walk_state->results->results.obj_desc [0])->reference.opcode != AML_INDEX_OP)) {
status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state); status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsutils - Dispatcher utilities * Module Name: dsutils - Dispatcher utilities
* $Revision: 95 $ * $Revision: 96 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -431,7 +431,7 @@ acpi_ds_create_operand ( ...@@ -431,7 +431,7 @@ acpi_ds_create_operand (
/* Get the object type of the argument */ /* Get the object type of the argument */
op_info = acpi_ps_get_opcode_info (opcode); op_info = acpi_ps_get_opcode_info (opcode);
if (op_info->object_type == INTERNAL_TYPE_INVALID) { if (op_info->object_type == ACPI_TYPE_INVALID) {
return_ACPI_STATUS (AE_NOT_IMPLEMENTED); return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswload - Dispatcher namespace load callbacks * Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 75 $ * $Revision: 78 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -151,49 +151,27 @@ acpi_ds_load1_begin_op ( ...@@ -151,49 +151,27 @@ acpi_ds_load1_begin_op (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type))); "State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
/* switch (walk_state->opcode) {
* Setup the search flags. case AML_SCOPE_OP:
*
* Since we are entering a name into the namespace, we do not want to
* enable the search-to-root upsearch.
*
* There are only two conditions where it is acceptable that the name
* already exists:
* 1) the Scope() operator can reopen a scoping object that was
* previously defined (Scope, Method, Device, etc.)
* 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
* Buffer_field, or Package), the name of the object is already
* in the namespace.
*/
flags = ACPI_NS_NO_UPSEARCH;
if ((walk_state->opcode != AML_SCOPE_OP) &&
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
}
/* /*
* Enter the named type into the internal namespace. We enter the name * The target name of the Scope() operator must exist at this point so
* as we go downward in the parse tree. Any necessary subobjects that involve * that we can actually open the scope to enter new names underneath it.
* arguments to the opcode must be created as we go back up the parse tree later. * Allow search-to-root for single namesegs.
*/ */
status = acpi_ns_lookup (walk_state->scope_info, path, object_type, status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node)); ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status); ACPI_REPORT_NSERROR (path, status);
return (status); return (status);
} }
/* /*
* For the scope op, we must check to make sure that the target is * Check to make sure that the target is
* one of the opcodes that actually opens a scope * one of the opcodes that actually opens a scope
*/ */
if (walk_state->opcode == AML_SCOPE_OP) {
switch (node->type) { switch (node->type) {
case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */ case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER: case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
...@@ -232,8 +210,53 @@ acpi_ds_load1_begin_op ( ...@@ -232,8 +210,53 @@ acpi_ds_load1_begin_op (
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }
break;
default:
/*
* For all other named opcodes, we will enter the name into the namespace.
*
* Setup the search flags.
* Since we are entering a name into the namespace, we do not want to
* enable the search-to-root upsearch.
*
* There are only two conditions where it is acceptable that the name
* already exists:
* 1) the Scope() operator can reopen a scoping object that was
* previously defined (Scope, Method, Device, etc.)
* 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
* Buffer_field, or Package), the name of the object is already
* in the namespace.
*/
flags = ACPI_NS_NO_UPSEARCH;
if ((walk_state->opcode != AML_SCOPE_OP) &&
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
}
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status);
}
break;
} }
/* Common exit */
if (!op) { if (!op) {
/* Create a new op */ /* Create a new op */
...@@ -419,59 +442,43 @@ acpi_ds_load2_begin_op ( ...@@ -419,59 +442,43 @@ acpi_ds_load2_begin_op (
"State=%p Op=%p Type=%X\n", walk_state, op, object_type)); "State=%p Op=%p Type=%X\n", walk_state, op, object_type));
if (walk_state->opcode == AML_FIELD_OP || switch (walk_state->opcode) {
walk_state->opcode == AML_BANK_FIELD_OP || case AML_FIELD_OP:
walk_state->opcode == AML_INDEX_FIELD_OP) { case AML_BANK_FIELD_OP:
case AML_INDEX_FIELD_OP:
node = NULL; node = NULL;
status = AE_OK; status = AE_OK;
} break;
else if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
case AML_INT_NAMEPATH_OP:
/* /*
* The Name_path is an object reference to an existing object. Don't enter the * The Name_path is an object reference to an existing object. Don't enter the
* name into the namespace, but look it up for use later * name into the namespace, but look it up for use later
*/ */
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
} break;
else {
/* All other opcodes */
if (op && op->common.node) {
/* This op/node was previously entered into the namespace */
node = op->common.node;
if (acpi_ns_opens_scope (object_type)) {
status = acpi_ds_scope_stack_push (node, object_type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
} case AML_SCOPE_OP:
return_ACPI_STATUS (AE_OK);
}
/* /*
* Enter the named type into the internal namespace. We enter the name * The Path is an object reference to an existing object. Don't enter the
* as we go downward in the parse tree. Any necessary subobjects that involve * name into the namespace, but look it up for use later
* arguments to the opcode must be created as we go back up the parse tree later.
*/ */
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node)); ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
}
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (buffer_ptr, status); ACPI_REPORT_NSERROR (buffer_ptr, status);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* /*
* For the scope op, we must check to make sure that the target is * We must check to make sure that the target is
* one of the opcodes that actually opens a scope * one of the opcodes that actually opens a scope
*/ */
if (walk_state->opcode == AML_SCOPE_OP) {
switch (node->type) { switch (node->type) {
case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */ case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER: case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
...@@ -508,8 +515,43 @@ acpi_ds_load2_begin_op ( ...@@ -508,8 +515,43 @@ acpi_ds_load2_begin_op (
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }
break;
default:
/* All other opcodes */
if (op && op->common.node) {
/* This op/node was previously entered into the namespace */
node = op->common.node;
if (acpi_ns_opens_scope (object_type)) {
status = acpi_ds_scope_stack_push (node, object_type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
}
return_ACPI_STATUS (AE_OK);
}
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node));
break;
}
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (buffer_ptr, status);
return_ACPI_STATUS (status);
} }
if (!op) { if (!op) {
/* Create a new op */ /* Create a new op */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswscope - Scope stack manipulation * Module Name: dswscope - Scope stack manipulation
* $Revision: 53 $ * $Revision: 56 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "acpi.h" #include "acpi.h"
#include "acinterp.h"
#include "acdispat.h" #include "acdispat.h"
...@@ -88,6 +87,7 @@ acpi_ds_scope_stack_push ( ...@@ -88,6 +87,7 @@ acpi_ds_scope_stack_push (
acpi_walk_state *walk_state) acpi_walk_state *walk_state)
{ {
acpi_generic_state *scope_info; acpi_generic_state *scope_info;
acpi_generic_state *old_scope_info;
ACPI_FUNCTION_TRACE ("Ds_scope_stack_push"); ACPI_FUNCTION_TRACE ("Ds_scope_stack_push");
...@@ -102,7 +102,7 @@ acpi_ds_scope_stack_push ( ...@@ -102,7 +102,7 @@ acpi_ds_scope_stack_push (
/* Make sure object type is valid */ /* Make sure object type is valid */
if (!acpi_ex_validate_object_type (type)) { if (!acpi_ut_valid_object_type (type)) {
ACPI_REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n")); ACPI_REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n"));
} }
...@@ -120,6 +120,28 @@ acpi_ds_scope_stack_push ( ...@@ -120,6 +120,28 @@ acpi_ds_scope_stack_push (
scope_info->scope.node = node; scope_info->scope.node = node;
scope_info->common.value = (u16) type; scope_info->common.value = (u16) type;
walk_state->scope_depth++;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"[%.2d] Pushed scope ", (u32) walk_state->scope_depth));
old_scope_info = walk_state->scope_info;
if (old_scope_info) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%10s)",
old_scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (old_scope_info->common.value)));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (%10s)", "ROOT"));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
", New scope -> [%4.4s] (%s)\n",
scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (scope_info->common.value)));
/* Push new scope object onto stack */ /* Push new scope object onto stack */
acpi_ut_push_generic_state (&walk_state->scope_info, scope_info); acpi_ut_push_generic_state (&walk_state->scope_info, scope_info);
...@@ -150,6 +172,7 @@ acpi_ds_scope_stack_pop ( ...@@ -150,6 +172,7 @@ acpi_ds_scope_stack_pop (
acpi_walk_state *walk_state) acpi_walk_state *walk_state)
{ {
acpi_generic_state *scope_info; acpi_generic_state *scope_info;
acpi_generic_state *new_scope_info;
ACPI_FUNCTION_TRACE ("Ds_scope_stack_pop"); ACPI_FUNCTION_TRACE ("Ds_scope_stack_pop");
...@@ -163,8 +186,25 @@ acpi_ds_scope_stack_pop ( ...@@ -163,8 +186,25 @@ acpi_ds_scope_stack_pop (
return_ACPI_STATUS (AE_STACK_UNDERFLOW); return_ACPI_STATUS (AE_STACK_UNDERFLOW);
} }
walk_state->scope_depth--;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Popped object type (%s)\n", acpi_ut_get_type_name (scope_info->common.value))); "[%.2d] Popped scope [%4.4s] (%10s), New scope -> ",
(u32) walk_state->scope_depth,
scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (scope_info->common.value)));
new_scope_info = walk_state->scope_info;
if (new_scope_info) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%s)\n",
new_scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (new_scope_info->common.value)));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (ROOT)\n"));
}
acpi_ut_delete_generic_state (scope_info); acpi_ut_delete_generic_state (scope_info);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswstate - Dispatcher parse tree walk management routines * Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 68 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -174,7 +174,7 @@ acpi_ds_result_pop ( ...@@ -174,7 +174,7 @@ acpi_ds_result_pop (
acpi_operand_object **object, acpi_operand_object **object,
acpi_walk_state *walk_state) acpi_walk_state *walk_state)
{ {
u32 index; NATIVE_UINT index;
acpi_generic_state *state; acpi_generic_state *state;
...@@ -205,7 +205,7 @@ acpi_ds_result_pop ( ...@@ -205,7 +205,7 @@ acpi_ds_result_pop (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n",
*object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL", *object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL",
index -1, walk_state, state->results.num_results)); (u32) index -1, walk_state, state->results.num_results));
return (AE_OK); return (AE_OK);
} }
......
...@@ -80,6 +80,7 @@ static struct acpi_driver acpi_ec_driver = { ...@@ -80,6 +80,7 @@ static struct acpi_driver acpi_ec_driver = {
struct acpi_ec { struct acpi_ec {
acpi_handle handle; acpi_handle handle;
unsigned long uid;
unsigned long gpe_bit; unsigned long gpe_bit;
acpi_generic_address status_addr; acpi_generic_address status_addr;
acpi_generic_address command_addr; acpi_generic_address command_addr;
...@@ -90,9 +91,6 @@ struct acpi_ec { ...@@ -90,9 +91,6 @@ struct acpi_ec {
/* If we find an EC via the ECDT, we need to keep a ptr to its context */ /* If we find an EC via the ECDT, we need to keep a ptr to its context */
static struct acpi_ec *ec_ecdt; static struct acpi_ec *ec_ecdt;
/* compare this against UIDs in properly enumerated ECs to determine if we
have a dupe */
static unsigned long ecdt_uid = 0xFFFFFFFF;
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Transaction Management Transaction Management
...@@ -297,35 +295,48 @@ struct acpi_ec_query_data { ...@@ -297,35 +295,48 @@ struct acpi_ec_query_data {
u8 data; u8 data;
}; };
static void static void
acpi_ec_gpe_query ( acpi_ec_gpe_query (
void *data) void *ec_cxt)
{ {
struct acpi_ec_query_data *query_data = NULL; struct acpi_ec *ec = (struct acpi_ec *) ec_cxt;
u32 value = 0;
unsigned long flags = 0;
static char object_name[5] = {'_','Q','0','0','\0'}; static char object_name[5] = {'_','Q','0','0','\0'};
const char hex[] = {'0','1','2','3','4','5','6','7', const char hex[] = {'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'}; '8','9','A','B','C','D','E','F'};
ACPI_FUNCTION_TRACE("acpi_ec_gpe_query"); ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
if (!data) if (!ec_cxt)
return; goto end;
query_data = (struct acpi_ec_query_data *) data; spin_lock_irqsave(&ec->lock, flags);
acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
spin_unlock_irqrestore(&ec->lock, flags);
object_name[2] = hex[((query_data->data >> 4) & 0x0F)]; /* TBD: Implement asynch events!
object_name[3] = hex[(query_data->data & 0x0F)]; * NOTE: All we care about are EC-SCI's. Other EC events are
* handled via polling (yuck!). This is because some systems
* treat EC-SCIs as level (versus EDGE!) triggered, preventing
* a purely interrupt-driven approach (grumble, grumble).
*/
if (!(value & ACPI_EC_FLAG_SCI))
goto end;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); if (acpi_ec_query(ec, &value))
goto end;
acpi_evaluate_object(query_data->handle, object_name, NULL, NULL); object_name[2] = hex[((value >> 4) & 0x0F)];
object_name[3] = hex[(value & 0x0F)];
kfree(query_data); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
return; acpi_evaluate_object(ec->handle, object_name, NULL, NULL);
}
end:
acpi_enable_event(ec->gpe_bit, ACPI_EVENT_GPE, 0);
}
static void static void
acpi_ec_gpe_handler ( acpi_ec_gpe_handler (
...@@ -333,44 +344,16 @@ acpi_ec_gpe_handler ( ...@@ -333,44 +344,16 @@ acpi_ec_gpe_handler (
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_ec *ec = (struct acpi_ec *) data; struct acpi_ec *ec = (struct acpi_ec *) data;
u32 value = 0;
unsigned long flags = 0;
struct acpi_ec_query_data *query_data = NULL;
if (!ec) if (!ec)
return; return;
spin_lock_irqsave(&ec->lock, flags); acpi_disable_event(ec->gpe_bit, ACPI_EVENT_GPE, 0);
acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
spin_unlock_irqrestore(&ec->lock, flags);
/* TBD: Implement asynch events!
* NOTE: All we care about are EC-SCI's. Other EC events are
* handled via polling (yuck!). This is because some systems
* treat EC-SCIs as level (versus EDGE!) triggered, preventing
* a purely interrupt-driven approach (grumble, grumble).
*/
if (!(value & ACPI_EC_FLAG_SCI))
return;
if (acpi_ec_query(ec, &value))
return;
query_data = kmalloc(sizeof(struct acpi_ec_query_data), GFP_ATOMIC);
if (!query_data)
return;
query_data->handle = ec->handle;
query_data->data = value;
status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
acpi_ec_gpe_query, query_data); acpi_ec_gpe_query, ec);
if (ACPI_FAILURE(status))
kfree(query_data);
return;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Address Space Management Address Space Management
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
...@@ -559,6 +542,7 @@ acpi_ec_add ( ...@@ -559,6 +542,7 @@ acpi_ec_add (
memset(ec, 0, sizeof(struct acpi_ec)); memset(ec, 0, sizeof(struct acpi_ec));
ec->handle = device->handle; ec->handle = device->handle;
ec->uid = -1;
ec->lock = SPIN_LOCK_UNLOCKED; ec->lock = SPIN_LOCK_UNLOCKED;
sprintf(acpi_device_name(device), "%s", ACPI_EC_DEVICE_NAME); sprintf(acpi_device_name(device), "%s", ACPI_EC_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_EC_CLASS); sprintf(acpi_device_class(device), "%s", ACPI_EC_CLASS);
...@@ -567,10 +551,10 @@ acpi_ec_add ( ...@@ -567,10 +551,10 @@ acpi_ec_add (
/* Use the global lock for all EC transactions? */ /* Use the global lock for all EC transactions? */
acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock); acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock);
/* If our UID matches ecdt_uid, we already found this EC via the /* If our UID matches the UID for the ECDT-enumerated EC,
ECDT. Abort. */ we already found this EC, so abort. */
acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid); acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);
if (ecdt_uid == uid) { if (ec_ecdt && ec_ecdt->uid == uid) {
result = -ENODEV; result = -ENODEV;
goto end; goto end;
} }
...@@ -758,7 +742,12 @@ acpi_ec_ecdt_probe (void) ...@@ -758,7 +742,12 @@ acpi_ec_ecdt_probe (void)
ec_ecdt->lock = SPIN_LOCK_UNLOCKED; ec_ecdt->lock = SPIN_LOCK_UNLOCKED;
/* use the GL just to be safe */ /* use the GL just to be safe */
ec_ecdt->global_lock = TRUE; ec_ecdt->global_lock = TRUE;
ecdt_uid = ecdt_ptr->uid; ec_ecdt->uid = ecdt_ptr->uid;
status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle);
if (ACPI_FAILURE(status)) {
goto error;
}
/* /*
* Install GPE handler * Install GPE handler
...@@ -783,7 +772,9 @@ acpi_ec_ecdt_probe (void) ...@@ -783,7 +772,9 @@ acpi_ec_ecdt_probe (void)
return 0; return 0;
error: error:
printk(KERN_ERR PREFIX "Could not use ECDT\n");
kfree(ec_ecdt); kfree(ec_ecdt);
ec_ecdt = NULL;
return -ENODEV; return -ENODEV;
} }
...@@ -835,3 +826,4 @@ acpi_ec_exit (void) ...@@ -835,3 +826,4 @@ acpi_ec_exit (void)
return_VOID; return_VOID;
} }
/****************************************************************************** /******************************************************************************
* *
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch * Module Name: evevent - Fixed and General Purpose Even handling and dispatch
* $Revision: 92 $ * $Revision: 95 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -343,40 +343,58 @@ acpi_ev_gpe_initialize (void) ...@@ -343,40 +343,58 @@ acpi_ev_gpe_initialize (void)
acpi_gbl_gpe_block_info[0].block_base_number = 0; acpi_gbl_gpe_block_info[0].block_base_number = 0;
acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base; acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base;
/* Warn and exit if there are no GPE registers */
acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count + acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count +
acpi_gbl_gpe_block_info[1].register_count; acpi_gbl_gpe_block_info[1].register_count;
if (!acpi_gbl_gpe_register_count) { if (!acpi_gbl_gpe_register_count) {
ACPI_REPORT_WARNING (("Zero GPEs are defined in the FADT\n")); ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n"));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* Determine the maximum GPE number for this machine */ /*
* Determine the maximum GPE number for this machine.
* Note: both GPE0 and GPE1 are optional, and either can exist without
* the other
*/
if (acpi_gbl_gpe_block_info[0].register_count) {
/* GPE block 0 exists */
acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1; acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1;
}
if (acpi_gbl_gpe_block_info[1].register_count) { if (acpi_gbl_gpe_block_info[1].register_count) {
/* Check for GPE0/GPE1 overlap */ /* GPE block 1 exists */
if (acpi_gbl_gpe_number_max >= acpi_gbl_FADT->gpe1_base) { /* Check for GPE0/GPE1 overlap (if both banks exist) */
ACPI_REPORT_ERROR (("GPE0 block overlaps the GPE1 block\n"));
if ((acpi_gbl_gpe_block_info[0].register_count) &&
(acpi_gbl_gpe_number_max >= acpi_gbl_FADT->gpe1_base)) {
ACPI_REPORT_ERROR ((
"GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d)\n",
acpi_gbl_gpe_number_max, acpi_gbl_FADT->gpe1_base,
acpi_gbl_FADT->gpe1_base + (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1)));
return_ACPI_STATUS (AE_BAD_VALUE); return_ACPI_STATUS (AE_BAD_VALUE);
} }
/* GPE0 and GPE1 do not have to be contiguous in the GPE number space */ /*
* GPE0 and GPE1 do not have to be contiguous in the GPE number space,
acpi_gbl_gpe_number_max = acpi_gbl_FADT->gpe1_base + (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1); * But, GPE0 always starts at zero.
*/
acpi_gbl_gpe_number_max = acpi_gbl_FADT->gpe1_base +
(ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1);
} }
/* Check for Max GPE number out-of-range */ /* Check for Max GPE number out-of-range */
if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) { if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) {
ACPI_REPORT_ERROR (("Maximum GPE number from FADT is too large: 0x%X\n", acpi_gbl_gpe_number_max)); ACPI_REPORT_ERROR (("Maximum GPE number from FADT is too large: 0x%X\n",
acpi_gbl_gpe_number_max));
return_ACPI_STATUS (AE_BAD_VALUE); return_ACPI_STATUS (AE_BAD_VALUE);
} }
/* /* Allocate the GPE number-to-index translation table */
* Allocate the GPE number-to-index translation table
*/
acpi_gbl_gpe_number_to_index = ACPI_MEM_CALLOCATE ( acpi_gbl_gpe_number_to_index = ACPI_MEM_CALLOCATE (
sizeof (ACPI_GPE_INDEX_INFO) * sizeof (ACPI_GPE_INDEX_INFO) *
((ACPI_SIZE) acpi_gbl_gpe_number_max + 1)); ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
...@@ -391,9 +409,8 @@ acpi_ev_gpe_initialize (void) ...@@ -391,9 +409,8 @@ acpi_ev_gpe_initialize (void)
ACPI_MEMSET (acpi_gbl_gpe_number_to_index, (int) ACPI_GPE_INVALID, ACPI_MEMSET (acpi_gbl_gpe_number_to_index, (int) ACPI_GPE_INVALID,
sizeof (ACPI_GPE_INDEX_INFO) * ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1)); sizeof (ACPI_GPE_INDEX_INFO) * ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
/* /* Allocate the GPE register information block */
* Allocate the GPE register information block
*/
acpi_gbl_gpe_register_info = ACPI_MEM_CALLOCATE ( acpi_gbl_gpe_register_info = ACPI_MEM_CALLOCATE (
(ACPI_SIZE) acpi_gbl_gpe_register_count * (ACPI_SIZE) acpi_gbl_gpe_register_count *
sizeof (ACPI_GPE_REGISTER_INFO)); sizeof (ACPI_GPE_REGISTER_INFO));
...@@ -465,7 +482,6 @@ acpi_ev_gpe_initialize (void) ...@@ -465,7 +482,6 @@ acpi_ev_gpe_initialize (void)
* are cleared by writing a '1', while enable registers are cleared * are cleared by writing a '1', while enable registers are cleared
* by writing a '0'. * by writing a '0'.
*/ */
status = acpi_hw_low_level_write (8, 0x00, &gpe_register_info->enable_address, 0); status = acpi_hw_low_level_write (8, 0x00, &gpe_register_info->enable_address, 0);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -479,17 +495,19 @@ acpi_ev_gpe_initialize (void) ...@@ -479,17 +495,19 @@ acpi_ev_gpe_initialize (void)
gpe_register++; gpe_register++;
} }
if (i) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n", ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n",
(s32) gpe_block, acpi_gbl_gpe_block_info[0].register_count, (s32) gpe_block, acpi_gbl_gpe_block_info[0].register_count,
ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)), ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)),
ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)))); ACPI_LODWORD (ACPI_GET_ADDRESS (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", ACPI_REPORT_INFO (("GPE Block%d defined as GPE%d to GPE%d\n",
(s32) gpe_block, (s32) 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].block_base_number + acpi_gbl_gpe_block_info[gpe_block].block_base_number +
((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1))); ((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1)));
} }
}
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
...@@ -794,7 +812,7 @@ acpi_ev_asynch_execute_gpe_method ( ...@@ -794,7 +812,7 @@ acpi_ev_asynch_execute_gpe_method (
*/ */
status = acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL); status = acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("%s while evaluated GPE%X method\n", ACPI_REPORT_ERROR (("%s while evaluating GPE%X method\n",
acpi_format_exception (status), gpe_number)); acpi_format_exception (status), gpe_number));
} }
} }
...@@ -846,7 +864,7 @@ acpi_ev_gpe_dispatch ( ...@@ -846,7 +864,7 @@ acpi_ev_gpe_dispatch (
gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number);
if (gpe_number_index == ACPI_GPE_INVALID) { if (gpe_number_index == ACPI_GPE_INVALID) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid event, GPE[%X].\n", gpe_number)); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "GPE[%X] is not a valid event\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxface - External interfaces for ACPI events * Module Name: evxface - External interfaces for ACPI events
* $Revision: 130 $ * $Revision: 131 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -294,7 +294,7 @@ acpi_install_notify_handler ( ...@@ -294,7 +294,7 @@ acpi_install_notify_handler (
/* Install the handler */ /* Install the handler */
notify_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_NOTIFY); notify_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_NOTIFY);
if (!notify_obj) { if (!notify_obj) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto unlock_and_exit; goto unlock_and_exit;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces. * Address Spaces.
* $Revision: 50 $ * $Revision: 51 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -220,7 +220,7 @@ acpi_install_address_space_handler ( ...@@ -220,7 +220,7 @@ acpi_install_address_space_handler (
* So, we just allocate the object for the handler and link it * So, we just allocate the object for the handler and link it
* into the list. * into the list.
*/ */
handler_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_ADDRESS_HANDLER); handler_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
if (!handler_obj) { if (!handler_obj) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto unlock_and_exit; goto unlock_and_exit;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
* $Revision: 67 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -67,7 +67,7 @@ acpi_ex_add_table ( ...@@ -67,7 +67,7 @@ acpi_ex_add_table (
/* Create an object to be the table handle */ /* Create an object to be the table handle */
obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!obj_desc) { if (!obj_desc) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
...@@ -77,7 +77,6 @@ acpi_ex_add_table ( ...@@ -77,7 +77,6 @@ acpi_ex_add_table (
table_info.pointer = table; table_info.pointer = table;
table_info.length = (ACPI_SIZE) table->length; table_info.length = (ACPI_SIZE) table->length;
table_info.allocation = ACPI_MEM_ALLOCATED; table_info.allocation = ACPI_MEM_ALLOCATED;
table_info.base_pointer = table;
status = acpi_tb_install_table (&table_info); status = acpi_tb_install_table (&table_info);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
...@@ -316,9 +315,9 @@ acpi_ex_load_op ( ...@@ -316,9 +315,9 @@ acpi_ex_load_op (
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n",
obj_desc, acpi_ut_get_object_type_name (obj_desc))); obj_desc, acpi_ut_get_object_type_name (obj_desc)));
...@@ -417,7 +416,7 @@ acpi_ex_unload_table ( ...@@ -417,7 +416,7 @@ acpi_ex_unload_table (
*/ */
if ((!ddb_handle) || if ((!ddb_handle) ||
(ACPI_GET_DESCRIPTOR_TYPE (ddb_handle) != ACPI_DESC_TYPE_OPERAND) || (ACPI_GET_DESCRIPTOR_TYPE (ddb_handle) != ACPI_DESC_TYPE_OPERAND) ||
(ACPI_GET_OBJECT_TYPE (ddb_handle) != INTERNAL_TYPE_REFERENCE)) { (ACPI_GET_OBJECT_TYPE (ddb_handle) != ACPI_TYPE_LOCAL_REFERENCE)) {
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconvrt - Object conversion routines * Module Name: exconvrt - Object conversion routines
* $Revision: 39 $ * $Revision: 41 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -510,7 +510,7 @@ acpi_ex_convert_to_string ( ...@@ -510,7 +510,7 @@ acpi_ex_convert_to_string (
new_buf [index-1] = 0; new_buf [index-1] = 0;
ret_desc->buffer.pointer = new_buf; ret_desc->buffer.pointer = new_buf;
ret_desc->string.length = ACPI_STRLEN ((char *) new_buf); ret_desc->string.length = (u32) ACPI_STRLEN ((char *) new_buf);
/* Return the new buffer descriptor */ /* Return the new buffer descriptor */
...@@ -587,7 +587,7 @@ acpi_ex_convert_to_target_type ( ...@@ -587,7 +587,7 @@ acpi_ex_convert_to_target_type (
case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */ case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */
switch (destination_type) { switch (destination_type) {
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
/* /*
* Named field can always handle conversions * Named field can always handle conversions
*/ */
...@@ -612,8 +612,8 @@ acpi_ex_convert_to_target_type ( ...@@ -612,8 +612,8 @@ acpi_ex_convert_to_target_type (
switch (destination_type) { switch (destination_type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* /*
* These types require an Integer operand. We can convert * These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary. * a Buffer or a String to an Integer if necessary.
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: excreate - Named object creation * Module Name: excreate - Named object creation
* $Revision: 94 $ * $Revision: 97 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -55,7 +55,7 @@ acpi_ex_create_alias ( ...@@ -55,7 +55,7 @@ acpi_ex_create_alias (
{ {
acpi_namespace_node *target_node; acpi_namespace_node *target_node;
acpi_namespace_node *alias_node; acpi_namespace_node *alias_node;
acpi_status status; acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE ("Ex_create_alias"); ACPI_FUNCTION_TRACE ("Ex_create_alias");
...@@ -66,7 +66,7 @@ acpi_ex_create_alias ( ...@@ -66,7 +66,7 @@ acpi_ex_create_alias (
alias_node = (acpi_namespace_node *) walk_state->operands[0]; alias_node = (acpi_namespace_node *) walk_state->operands[0];
target_node = (acpi_namespace_node *) walk_state->operands[1]; target_node = (acpi_namespace_node *) walk_state->operands[1];
if (target_node->type == INTERNAL_TYPE_ALIAS) { if (target_node->type == ACPI_TYPE_LOCAL_ALIAS) {
/* /*
* Dereference an existing alias so that we don't create a chain * Dereference an existing alias so that we don't create a chain
* of aliases. With this code, we guarantee that an alias is * of aliases. With this code, we guarantee that an alias is
...@@ -95,8 +95,8 @@ acpi_ex_create_alias ( ...@@ -95,8 +95,8 @@ acpi_ex_create_alias (
* NS node, not the object itself. This is because for these * NS node, not the object itself. This is because for these
* types, the object can change dynamically via a Store. * types, the object can change dynamically via a Store.
*/ */
alias_node->type = INTERNAL_TYPE_ALIAS; alias_node->type = ACPI_TYPE_LOCAL_ALIAS;
alias_node->object = (acpi_operand_object *) target_node; alias_node->object = ACPI_CAST_PTR (acpi_operand_object, target_node);
break; break;
default: default:
...@@ -117,7 +117,7 @@ acpi_ex_create_alias ( ...@@ -117,7 +117,7 @@ acpi_ex_create_alias (
/* Since both operands are Nodes, we don't need to delete them */ /* Since both operands are Nodes, we don't need to delete them */
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (status);
} }
...@@ -221,8 +221,9 @@ acpi_ex_create_mutex ( ...@@ -221,8 +221,9 @@ acpi_ex_create_mutex (
/* Init object and attach to NS node */ /* Init object and attach to NS node */
obj_desc->mutex.sync_level = (u8) walk_state->operands[1]->integer.value; obj_desc->mutex.sync_level = (u8) walk_state->operands[1]->integer.value;
obj_desc->mutex.node = (acpi_namespace_node *) walk_state->operands[0];
status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0], status = acpi_ns_attach_object (obj_desc->mutex.node,
obj_desc, ACPI_TYPE_MUTEX); obj_desc, ACPI_TYPE_MUTEX);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exdump - Interpreter debug output routines * Module Name: exdump - Interpreter debug output routines
* $Revision: 160 $ * $Revision: 162 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -58,7 +58,6 @@ acpi_ex_dump_operand ( ...@@ -58,7 +58,6 @@ acpi_ex_dump_operand (
{ {
u8 *buf = NULL; u8 *buf = NULL;
u32 length; u32 length;
u32 i;
acpi_operand_object **element; acpi_operand_object **element;
u16 element_index; u16 element_index;
...@@ -97,7 +96,7 @@ acpi_ex_dump_operand ( ...@@ -97,7 +96,7 @@ acpi_ex_dump_operand (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (obj_desc->reference.opcode) { switch (obj_desc->reference.opcode) {
case AML_DEBUG_OP: case AML_DEBUG_OP:
...@@ -217,22 +216,6 @@ acpi_ex_dump_operand ( ...@@ -217,22 +216,6 @@ acpi_ex_dump_operand (
break; break;
case INTERNAL_TYPE_IF:
acpi_os_printf ("If [Integer] %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
case INTERNAL_TYPE_WHILE:
acpi_os_printf ("While [Integer] %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
acpi_os_printf ("Package count %X @ %p\n", acpi_os_printf ("Package count %X @ %p\n",
...@@ -279,24 +262,20 @@ acpi_ex_dump_operand ( ...@@ -279,24 +262,20 @@ acpi_ex_dump_operand (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
acpi_os_printf ("String length %X @ %p \"", acpi_os_printf ("String length %X @ %p ",
obj_desc->string.length, obj_desc->string.pointer); obj_desc->string.length, obj_desc->string.pointer);
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
for (i = 0; i < obj_desc->string.length; i++) { acpi_os_printf ("\n");
acpi_os_printf ("%c",
obj_desc->string.pointer[i]);
}
acpi_os_printf ("\"\n");
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_os_printf ("Bank_field\n"); acpi_os_printf ("Bank_field\n");
break; break;
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf ( acpi_os_printf (
"Region_field: Bits=%X Acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", "Region_field: Bits=%X Acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
...@@ -308,7 +287,7 @@ acpi_ex_dump_operand ( ...@@ -308,7 +287,7 @@ acpi_ex_dump_operand (
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf ("Index_field\n"); acpi_os_printf ("Index_field\n");
break; break;
...@@ -321,16 +300,13 @@ acpi_ex_dump_operand ( ...@@ -321,16 +300,13 @@ acpi_ex_dump_operand (
obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset, obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset,
obj_desc->buffer_field.start_field_bit_offset); obj_desc->buffer_field.start_field_bit_offset);
if (!obj_desc->buffer_field.buffer_obj) if (!obj_desc->buffer_field.buffer_obj) {
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
} }
else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) {
{
acpi_os_printf ("*not a Buffer* \n"); acpi_os_printf ("*not a Buffer* \n");
} }
else else {
{
ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj); ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj);
} }
...@@ -423,13 +399,11 @@ acpi_ex_dump_operands ( ...@@ -423,13 +399,11 @@ acpi_ex_dump_operands (
ACPI_FUNCTION_NAME ("Ex_dump_operands"); ACPI_FUNCTION_NAME ("Ex_dump_operands");
if (!ident) if (!ident) {
{
ident = "?"; ident = "?";
} }
if (!note) if (!note) {
{
note = "?"; note = "?";
} }
...@@ -437,15 +411,13 @@ acpi_ex_dump_operands ( ...@@ -437,15 +411,13 @@ acpi_ex_dump_operands (
"************* Operand Stack Contents (Opcode [%s], %d Operands)\n", "************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
ident, num_levels)); ident, num_levels));
if (num_levels == 0) if (num_levels == 0) {
{
num_levels = 1; num_levels = 1;
} }
/* Dump the operand stack starting at the top */ /* Dump the operand stack starting at the top */
for (i = 0; num_levels > 0; i--, num_levels--) for (i = 0; num_levels > 0; i--, num_levels--) {
{
obj_desc = &operands[i]; obj_desc = &operands[i];
acpi_ex_dump_operand (*obj_desc); acpi_ex_dump_operand (*obj_desc);
} }
...@@ -529,10 +501,8 @@ acpi_ex_dump_node ( ...@@ -529,10 +501,8 @@ acpi_ex_dump_node (
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_ENTRY ();
if (!flags) if (!flags) {
{ if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{
return; return;
} }
} }
...@@ -571,24 +541,20 @@ acpi_ex_dump_object_descriptor ( ...@@ -571,24 +541,20 @@ acpi_ex_dump_object_descriptor (
ACPI_FUNCTION_TRACE ("Ex_dump_object_descriptor"); ACPI_FUNCTION_TRACE ("Ex_dump_object_descriptor");
if (!flags) if (!flags) {
{ if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{
return_VOID; return_VOID;
} }
} }
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
{
acpi_ex_dump_node ((acpi_namespace_node *) obj_desc, flags); acpi_ex_dump_node ((acpi_namespace_node *) obj_desc, flags);
acpi_os_printf ("\nAttached Object (%p):\n", ((acpi_namespace_node *) obj_desc)->object); acpi_os_printf ("\nAttached Object (%p):\n", ((acpi_namespace_node *) obj_desc)->object);
acpi_ex_dump_object_descriptor (((acpi_namespace_node *) obj_desc)->object, flags); acpi_ex_dump_object_descriptor (((acpi_namespace_node *) obj_desc)->object, flags);
return; return;
} }
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
{
acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc); acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
return_VOID; return_VOID;
} }
...@@ -601,8 +567,7 @@ acpi_ex_dump_object_descriptor ( ...@@ -601,8 +567,7 @@ acpi_ex_dump_object_descriptor (
/* Object-specific Fields */ /* Object-specific Fields */
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
{
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value", acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
...@@ -614,7 +579,10 @@ acpi_ex_dump_object_descriptor ( ...@@ -614,7 +579,10 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
acpi_ex_out_integer ("Length", obj_desc->string.length); acpi_ex_out_integer ("Length", obj_desc->string.length);
acpi_ex_out_pointer ("Pointer", obj_desc->string.pointer);
acpi_os_printf ("%20s : %p ", "Pointer", obj_desc->string.pointer);
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
acpi_os_printf ("\n");
break; break;
...@@ -633,14 +601,11 @@ acpi_ex_dump_object_descriptor ( ...@@ -633,14 +601,11 @@ acpi_ex_dump_object_descriptor (
/* Dump the package contents */ /* Dump the package contents */
if (obj_desc->package.count > 0) if (obj_desc->package.count > 0) {
{
acpi_os_printf ("\nPackage Contents:\n"); acpi_os_printf ("\nPackage Contents:\n");
for (i = 0; i < obj_desc->package.count; i++) for (i = 0; i < obj_desc->package.count; i++) {
{
acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]); acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]);
if (obj_desc->package.elements[i]) if (obj_desc->package.elements[i]) {
{
acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i])); acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i]));
} }
acpi_os_printf ("\n"); acpi_os_printf ("\n");
...@@ -723,9 +688,9 @@ acpi_ex_dump_object_descriptor ( ...@@ -723,9 +688,9 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_ex_out_integer ("Field_flags", obj_desc->common_field.field_flags); acpi_ex_out_integer ("Field_flags", obj_desc->common_field.field_flags);
acpi_ex_out_integer ("Access_byte_width", obj_desc->common_field.access_byte_width); acpi_ex_out_integer ("Access_byte_width", obj_desc->common_field.access_byte_width);
...@@ -737,23 +702,22 @@ acpi_ex_dump_object_descriptor ( ...@@ -737,23 +702,22 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits); acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits);
acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node); acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
{
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj); acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj);
break; break;
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_ex_out_pointer ("Region_obj", obj_desc->field.region_obj); acpi_ex_out_pointer ("Region_obj", obj_desc->field.region_obj);
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_ex_out_integer ("Value", obj_desc->bank_field.value); acpi_ex_out_integer ("Value", obj_desc->bank_field.value);
acpi_ex_out_pointer ("Region_obj", obj_desc->bank_field.region_obj); acpi_ex_out_pointer ("Region_obj", obj_desc->bank_field.region_obj);
acpi_ex_out_pointer ("Bank_obj", obj_desc->bank_field.bank_obj); acpi_ex_out_pointer ("Bank_obj", obj_desc->bank_field.bank_obj);
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_ex_out_integer ("Value", obj_desc->index_field.value); acpi_ex_out_integer ("Value", obj_desc->index_field.value);
acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj); acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj);
acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj); acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj);
...@@ -766,7 +730,7 @@ acpi_ex_dump_object_descriptor ( ...@@ -766,7 +730,7 @@ acpi_ex_dump_object_descriptor (
break; break;
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
acpi_ex_out_integer ("Target_type", obj_desc->reference.target_type); acpi_ex_out_integer ("Target_type", obj_desc->reference.target_type);
acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name);
...@@ -777,7 +741,7 @@ acpi_ex_dump_object_descriptor ( ...@@ -777,7 +741,7 @@ acpi_ex_dump_object_descriptor (
break; break;
case INTERNAL_TYPE_ADDRESS_HANDLER: case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
acpi_ex_out_integer ("Space_id", obj_desc->addr_handler.space_id); acpi_ex_out_integer ("Space_id", obj_desc->addr_handler.space_id);
acpi_ex_out_pointer ("Next", obj_desc->addr_handler.next); acpi_ex_out_pointer ("Next", obj_desc->addr_handler.next);
...@@ -787,24 +751,16 @@ acpi_ex_dump_object_descriptor ( ...@@ -787,24 +751,16 @@ acpi_ex_dump_object_descriptor (
break; break;
case INTERNAL_TYPE_NOTIFY: case ACPI_TYPE_LOCAL_NOTIFY:
acpi_ex_out_pointer ("Node", obj_desc->notify_handler.node); acpi_ex_out_pointer ("Node", obj_desc->notify_handler.node);
acpi_ex_out_pointer ("Context", obj_desc->notify_handler.context); acpi_ex_out_pointer ("Context", obj_desc->notify_handler.context);
break; break;
case INTERNAL_TYPE_ALIAS: case ACPI_TYPE_LOCAL_ALIAS:
case INTERNAL_TYPE_FIELD_DEFN: case ACPI_TYPE_LOCAL_EXTRA:
case INTERNAL_TYPE_BANK_FIELD_DEFN: case ACPI_TYPE_LOCAL_DATA:
case INTERNAL_TYPE_INDEX_FIELD_DEFN:
case INTERNAL_TYPE_IF:
case INTERNAL_TYPE_ELSE:
case INTERNAL_TYPE_WHILE:
case INTERNAL_TYPE_SCOPE:
case INTERNAL_TYPE_DEF_ANY:
case INTERNAL_TYPE_EXTRA:
case INTERNAL_TYPE_DATA:
default: default:
acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %s\n", acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %s\n",
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exfldio - Aml Field I/O * Module Name: exfldio - Aml Field I/O
* $Revision: 88 $ * $Revision: 89 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -338,7 +338,7 @@ acpi_ex_field_datum_io ( ...@@ -338,7 +338,7 @@ acpi_ex_field_datum_io (
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
/* Ensure that the Bank_value is not beyond the capacity of the register */ /* Ensure that the Bank_value is not beyond the capacity of the register */
...@@ -366,7 +366,7 @@ acpi_ex_field_datum_io ( ...@@ -366,7 +366,7 @@ acpi_ex_field_datum_io (
/*lint -fallthrough */ /*lint -fallthrough */
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
/* /*
* For simple Region_fields, we just directly access the owning * For simple Region_fields, we just directly access the owning
* Operation Region. * Operation Region.
...@@ -381,7 +381,7 @@ acpi_ex_field_datum_io ( ...@@ -381,7 +381,7 @@ acpi_ex_field_datum_io (
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* Ensure that the Index_value is not beyond the capacity of the register */ /* Ensure that the Index_value is not beyond the capacity of the register */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
* $Revision: 109 $ * $Revision: 110 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -67,7 +67,7 @@ acpi_ex_get_object_reference ( ...@@ -67,7 +67,7 @@ acpi_ex_get_object_reference (
switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) {
case ACPI_DESC_TYPE_OPERAND: case ACPI_DESC_TYPE_OPERAND:
if (ACPI_GET_OBJECT_TYPE (obj_desc) != INTERNAL_TYPE_REFERENCE) { if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_LOCAL_REFERENCE) {
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
} }
...@@ -111,7 +111,7 @@ acpi_ex_get_object_reference ( ...@@ -111,7 +111,7 @@ acpi_ex_get_object_reference (
/* Create a new reference object */ /* Create a new reference object */
reference_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); reference_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!reference_obj) { if (!reference_obj) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exmutex - ASL Mutex Acquire/Release functions * Module Name: exmutex - ASL Mutex Acquire/Release functions
* $Revision: 13 $ * $Revision: 16 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -132,22 +132,35 @@ acpi_ex_acquire_mutex ( ...@@ -132,22 +132,35 @@ acpi_ex_acquire_mutex (
ACPI_FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc); ACPI_FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc);
if (!obj_desc) { if (!obj_desc) {
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* /*
* Current Sync must be less than or equal to the sync level of the * Current Sync must be less than or equal to the sync level of the
* mutex. This mechanism provides some deadlock prevention * mutex. This mechanism provides some deadlock prevention
*/ */
if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect Sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER); return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
} }
/* /*
* Support for multiple acquires by the owning thread * Support for multiple acquires by the owning thread
*/ */
if (obj_desc->mutex.owner_thread == walk_state->thread) {
if ((obj_desc->mutex.owner_thread) &&
(obj_desc->mutex.owner_thread->thread_id == walk_state->thread->thread_id)) {
/* /*
* The mutex is already owned by this thread, * The mutex is already owned by this thread,
* just increment the acquisition depth * just increment the acquisition depth
...@@ -210,12 +223,27 @@ acpi_ex_release_mutex ( ...@@ -210,12 +223,27 @@ acpi_ex_release_mutex (
/* The mutex must have been previously acquired in order to release it */ /* The mutex must have been previously acquired in order to release it */
if (!obj_desc->mutex.owner_thread) { if (!obj_desc->mutex.owner_thread) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], not acquired\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED);
} }
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* The Mutex is owned, but this thread must be the owner */ /* The Mutex is owned, but this thread must be the owner */
if (obj_desc->mutex.owner_thread != walk_state->thread) { if (obj_desc->mutex.owner_thread->thread_id != walk_state->thread->thread_id) {
ACPI_REPORT_ERROR ((
"Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
walk_state->thread->thread_id,
obj_desc->mutex.node->name.ascii,
obj_desc->mutex.owner_thread->thread_id));
return_ACPI_STATUS (AE_AML_NOT_OWNER); return_ACPI_STATUS (AE_AML_NOT_OWNER);
} }
...@@ -224,6 +252,8 @@ acpi_ex_release_mutex ( ...@@ -224,6 +252,8 @@ acpi_ex_release_mutex (
* equal to the current sync level * equal to the current sync level
*/ */
if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect Sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER); return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exnames - interpreter/scanner name load/execute * Module Name: exnames - interpreter/scanner name load/execute
* $Revision: 91 $ * $Revision: 92 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -247,9 +247,9 @@ acpi_ex_get_name_string ( ...@@ -247,9 +247,9 @@ acpi_ex_get_name_string (
ACPI_FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address); ACPI_FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address);
if (INTERNAL_TYPE_REGION_FIELD == data_type || if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type ||
INTERNAL_TYPE_BANK_FIELD == data_type || ACPI_TYPE_LOCAL_BANK_FIELD == data_type ||
INTERNAL_TYPE_INDEX_FIELD == data_type) { ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) {
/* Disallow prefixes for types associated with Field_unit names */ /* Disallow prefixes for types associated with Field_unit names */
name_string = acpi_ex_allocate_name_string (0, 1); name_string = acpi_ex_allocate_name_string (0, 1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exoparg1 - AML execution - opcodes with 1 argument * Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 143 $ * $Revision: 144 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -642,7 +642,7 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -642,7 +642,7 @@ acpi_ex_opcode_1A_0T_1R (
if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) != ACPI_DESC_TYPE_NAMED) { if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) != ACPI_DESC_TYPE_NAMED) {
switch (ACPI_GET_OBJECT_TYPE (operand[0])) { switch (ACPI_GET_OBJECT_TYPE (operand[0])) {
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
/* /*
* This is a Deref_of (Local_x | Arg_x) * This is a Deref_of (Local_x | Arg_x)
* *
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 111 $ * $Revision: 113 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -379,7 +379,7 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -379,7 +379,7 @@ acpi_ex_opcode_2A_1T_1R (
/* Set the string length */ /* Set the string length */
return_desc->string.length = length; return_desc->string.length = (u32) length;
break; break;
...@@ -393,7 +393,7 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -393,7 +393,7 @@ acpi_ex_opcode_2A_1T_1R (
/* Create the internal return object */ /* Create the internal return object */
return_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); return_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!return_desc) { if (!return_desc) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 119 $ * $Revision: 120 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -313,7 +313,7 @@ acpi_ex_prep_field_value ( ...@@ -313,7 +313,7 @@ acpi_ex_prep_field_value (
/* Parameter validation */ /* Parameter validation */
if (info->field_type != INTERNAL_TYPE_INDEX_FIELD) { if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) {
if (!info->region_node) { if (!info->region_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND); return_ACPI_STATUS (AE_AML_NO_OPERAND);
...@@ -349,7 +349,7 @@ acpi_ex_prep_field_value ( ...@@ -349,7 +349,7 @@ acpi_ex_prep_field_value (
/* Initialize areas of the object that are specific to the field type */ /* Initialize areas of the object that are specific to the field type */
switch (info->field_type) { switch (info->field_type) {
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node); obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node);
...@@ -364,7 +364,7 @@ acpi_ex_prep_field_value ( ...@@ -364,7 +364,7 @@ acpi_ex_prep_field_value (
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
obj_desc->bank_field.value = info->bank_value; obj_desc->bank_field.value = info->bank_value;
obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node); obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node);
...@@ -385,7 +385,7 @@ acpi_ex_prep_field_value ( ...@@ -385,7 +385,7 @@ acpi_ex_prep_field_value (
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
obj_desc->index_field.index_obj = acpi_ns_get_attached_object (info->register_node); 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.data_obj = acpi_ns_get_attached_object (info->data_register_node);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresnte - AML Interpreter object resolution * Module Name: exresnte - AML Interpreter object resolution
* $Revision: 59 $ * $Revision: 60 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -88,7 +88,7 @@ acpi_ex_resolve_node_to_value ( ...@@ -88,7 +88,7 @@ acpi_ex_resolve_node_to_value (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p Type=%X\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p Type=%X\n",
node, source_desc, entry_type)); node, source_desc, entry_type));
if (entry_type == INTERNAL_TYPE_ALIAS) { if (entry_type == ACPI_TYPE_LOCAL_ALIAS) {
/* There is always exactly one level of indirection */ /* There is always exactly one level of indirection */
node = (acpi_namespace_node *) node->object; node = (acpi_namespace_node *) node->object;
...@@ -185,9 +185,9 @@ acpi_ex_resolve_node_to_value ( ...@@ -185,9 +185,9 @@ acpi_ex_resolve_node_to_value (
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n",
node, source_desc, entry_type)); node, source_desc, entry_type));
...@@ -223,7 +223,7 @@ acpi_ex_resolve_node_to_value ( ...@@ -223,7 +223,7 @@ acpi_ex_resolve_node_to_value (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */ return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
/* No named references are allowed here */ /* No named references are allowed here */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresolv - AML Interpreter object resolution * Module Name: exresolv - AML Interpreter object resolution
* $Revision: 116 $ * $Revision: 117 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -132,7 +132,7 @@ acpi_ex_resolve_object_to_value ( ...@@ -132,7 +132,7 @@ acpi_ex_resolve_object_to_value (
/* This is an acpi_operand_object */ /* This is an acpi_operand_object */
switch (ACPI_GET_OBJECT_TYPE (stack_desc)) { switch (ACPI_GET_OBJECT_TYPE (stack_desc)) {
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
opcode = stack_desc->reference.opcode; opcode = stack_desc->reference.opcode;
...@@ -262,9 +262,9 @@ acpi_ex_resolve_object_to_value ( ...@@ -262,9 +262,9 @@ acpi_ex_resolve_object_to_value (
* These cases may never happen here, but just in case.. * These cases may never happen here, but just in case..
*/ */
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n",
stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc))); stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc)));
...@@ -309,7 +309,7 @@ acpi_ex_resolve_multiple ( ...@@ -309,7 +309,7 @@ acpi_ex_resolve_multiple (
acpi_object_type type; acpi_object_type type;
ACPI_FUNCTION_TRACE ("Ex_get_object_type"); ACPI_FUNCTION_TRACE ("Acpi_ex_resolve_multiple");
/* /*
...@@ -318,7 +318,7 @@ acpi_ex_resolve_multiple ( ...@@ -318,7 +318,7 @@ acpi_ex_resolve_multiple (
* of the Object_type and Size_of operators). This means traversing * of the Object_type and Size_of operators). This means traversing
* the list of possibly many nested references. * the list of possibly many nested references.
*/ */
while (ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_REFERENCE) { while (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
switch (obj_desc->reference.opcode) { switch (obj_desc->reference.opcode) {
case AML_REF_OF_OP: case AML_REF_OF_OP:
...@@ -427,13 +427,20 @@ acpi_ex_resolve_multiple ( ...@@ -427,13 +427,20 @@ acpi_ex_resolve_multiple (
/* Convert internal types to external types */ /* Convert internal types to external types */
switch (type) { switch (type) {
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
type = ACPI_TYPE_FIELD_UNIT; type = ACPI_TYPE_FIELD_UNIT;
break; break;
case ACPI_TYPE_LOCAL_SCOPE:
/* Per ACPI Specification, Scope is untyped */
type = ACPI_TYPE_ANY;
break;
default: default:
/* No change to Type required */ /* No change to Type required */
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresop - AML Interpreter operand/object resolution * Module Name: exresop - AML Interpreter operand/object resolution
* $Revision: 58 $ * $Revision: 59 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -64,7 +64,7 @@ acpi_ex_check_object_type ( ...@@ -64,7 +64,7 @@ acpi_ex_check_object_type (
return (AE_OK); return (AE_OK);
} }
if (type_needed == INTERNAL_TYPE_REFERENCE) { if (type_needed == ACPI_TYPE_LOCAL_REFERENCE) {
/* /*
* Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
* objects and thus allow them to be targets. (As per the ACPI * objects and thus allow them to be targets. (As per the ACPI
...@@ -183,14 +183,14 @@ acpi_ex_resolve_operands ( ...@@ -183,14 +183,14 @@ acpi_ex_resolve_operands (
/* Check for bad acpi_object_type */ /* Check for bad acpi_object_type */
if (!acpi_ex_validate_object_type (object_type)) { if (!acpi_ut_valid_object_type (object_type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad operand object type [%X]\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad operand object type [%X]\n",
object_type)); object_type));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
} }
if (object_type == (u8) INTERNAL_TYPE_REFERENCE) { if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
/* /*
* Decode the Reference * Decode the Reference
*/ */
...@@ -267,13 +267,13 @@ acpi_ex_resolve_operands ( ...@@ -267,13 +267,13 @@ acpi_ex_resolve_operands (
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
/* Need an operand of type INTERNAL_TYPE_REFERENCE */ /* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE */
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) /* Node (name) ptr OK as-is */ { if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) /* Node (name) ptr OK as-is */ {
goto next_operand; goto next_operand;
} }
status = acpi_ex_check_object_type (INTERNAL_TYPE_REFERENCE, status = acpi_ex_check_object_type (ACPI_TYPE_LOCAL_REFERENCE,
object_type, obj_desc); object_type, obj_desc);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -300,7 +300,7 @@ acpi_ex_resolve_operands ( ...@@ -300,7 +300,7 @@ acpi_ex_resolve_operands (
* -- All others must be resolved below. * -- All others must be resolved below.
*/ */
if ((opcode == AML_STORE_OP) && if ((opcode == AML_STORE_OP) &&
(ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) && (ACPI_GET_OBJECT_TYPE (*stack_ptr) == ACPI_TYPE_LOCAL_REFERENCE) &&
((*stack_ptr)->reference.opcode == AML_INDEX_OP)) { ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) {
goto next_operand; goto next_operand;
} }
...@@ -353,13 +353,6 @@ acpi_ex_resolve_operands ( ...@@ -353,13 +353,6 @@ acpi_ex_resolve_operands (
type_needed = ACPI_TYPE_REGION; type_needed = ACPI_TYPE_REGION;
break; break;
case ARGI_IF: /* If */
/* Need an operand of type INTERNAL_TYPE_IF */
type_needed = INTERNAL_TYPE_IF;
break;
case ARGI_PACKAGE: /* Package */ case ARGI_PACKAGE: /* Package */
/* Need an operand of type ACPI_TYPE_PACKAGE */ /* Need an operand of type ACPI_TYPE_PACKAGE */
...@@ -502,7 +495,7 @@ acpi_ex_resolve_operands ( ...@@ -502,7 +495,7 @@ acpi_ex_resolve_operands (
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
/* Valid operand */ /* Valid operand */
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exstore - AML Interpreter object store support * Module Name: exstore - AML Interpreter object store support
* $Revision: 172 $ * $Revision: 173 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -92,7 +92,7 @@ acpi_ex_store ( ...@@ -92,7 +92,7 @@ acpi_ex_store (
/* Destination object must be a Reference or a Constant object */ /* Destination object must be a Reference or a Constant object */
switch (ACPI_GET_OBJECT_TYPE (dest_desc)) { switch (ACPI_GET_OBJECT_TYPE (dest_desc)) {
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
break; break;
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
...@@ -428,9 +428,9 @@ acpi_ex_store_object_to_node ( ...@@ -428,9 +428,9 @@ acpi_ex_store_object_to_node (
*/ */
switch (target_type) { switch (target_type) {
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* /*
* For fields, copy the source data to the target field. * For fields, copy the source data to the target field.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Module Name: exstoren - AML Interpreter object store support, * Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object) * Store to Node (namespace object)
* $Revision: 51 $ * $Revision: 52 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -67,9 +67,9 @@ acpi_ex_resolve_object ( ...@@ -67,9 +67,9 @@ acpi_ex_resolve_object (
*/ */
switch (target_type) { switch (target_type) {
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* /*
* These cases all require only Integers or values that * These cases all require only Integers or values that
* can be converted to Integers (Strings or Buffers) * can be converted to Integers (Strings or Buffers)
...@@ -84,7 +84,7 @@ acpi_ex_resolve_object ( ...@@ -84,7 +84,7 @@ acpi_ex_resolve_object (
* are all essentially the same. This case handles the * are all essentially the same. This case handles the
* "interchangeable" types Integer, String, and Buffer. * "interchangeable" types Integer, String, and Buffer.
*/ */
if (ACPI_GET_OBJECT_TYPE (source_desc) == INTERNAL_TYPE_REFERENCE) { if (ACPI_GET_OBJECT_TYPE (source_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
/* Resolve a reference object first */ /* Resolve a reference object first */
status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state); status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state);
...@@ -111,7 +111,7 @@ acpi_ex_resolve_object ( ...@@ -111,7 +111,7 @@ acpi_ex_resolve_object (
break; break;
case INTERNAL_TYPE_ALIAS: case ACPI_TYPE_LOCAL_ALIAS:
/* /*
* Aliases are resolved by Acpi_ex_prep_operands * Aliases are resolved by Acpi_ex_prep_operands
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exstorob - AML Interpreter object store support, store to object * Module Name: exstorob - AML Interpreter object store support, store to object
* $Revision: 45 $ * $Revision: 46 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -144,7 +144,7 @@ acpi_ex_store_string_to_string ( ...@@ -144,7 +144,7 @@ acpi_ex_store_string_to_string (
* String will fit in existing buffer. * String will fit in existing buffer.
* Clear old string and copy in the new one * Clear old string and copy in the new one
*/ */
ACPI_MEMSET (target_desc->string.pointer, 0, target_desc->string.length + 1); ACPI_MEMSET (target_desc->string.pointer, 0, (ACPI_SIZE) target_desc->string.length + 1);
ACPI_MEMCPY (target_desc->string.pointer, buffer, length); ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
} }
else { else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exutils - interpreter/scanner utilities * Module Name: exutils - interpreter/scanner utilities
* $Revision: 103 $ * $Revision: 105 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -50,32 +50,6 @@ ...@@ -50,32 +50,6 @@
ACPI_MODULE_NAME ("exutils") ACPI_MODULE_NAME ("exutils")
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
/******************************************************************************* /*******************************************************************************
...@@ -336,7 +310,7 @@ acpi_ex_eisa_id_to_string ( ...@@ -336,7 +310,7 @@ acpi_ex_eisa_id_to_string (
eisa_id = acpi_ut_dword_byte_swap (numeric_id); eisa_id = acpi_ut_dword_byte_swap (numeric_id);
out_string[0] = (char) ('@' + ((eisa_id >> 26) & 0x1f)); out_string[0] = (char) ('@' + (((unsigned long) eisa_id >> 26) & 0x1f));
out_string[1] = (char) ('@' + ((eisa_id >> 21) & 0x1f)); out_string[1] = (char) ('@' + ((eisa_id >> 21) & 0x1f));
out_string[2] = (char) ('@' + ((eisa_id >> 16) & 0x1f)); out_string[2] = (char) ('@' + ((eisa_id >> 16) & 0x1f));
out_string[3] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 12); out_string[3] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 12);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* $Revision: 46 $ * $Revision: 47 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -309,6 +309,11 @@ acpi_enter_sleep_state ( ...@@ -309,6 +309,11 @@ acpi_enter_sleep_state (
} while (!in_value); } while (!in_value);
status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Name: acconfig.h - Global configuration constants * Name: acconfig.h - Global configuration constants
* $Revision: 112 $ * $Revision: 114 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20021002 #define ACPI_CA_VERSION 0x20021022
/* Version of ACPI supported */ /* Version of ACPI supported */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acdisasm.h - AML disassembler * Name: acdisasm.h - AML disassembler
* $Revision: 3 $ * $Revision: 4 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -107,10 +107,6 @@ u32 ...@@ -107,10 +107,6 @@ u32
acpi_dm_dump_name ( acpi_dm_dump_name (
char *name); char *name);
void
acpi_dm_string (
char *string);
void void
acpi_dm_unicode ( acpi_dm_unicode (
acpi_parse_object *op); acpi_parse_object *op);
......
/****************************************************************************** /******************************************************************************
* *
* Name: acglobal.h - Declarations for global variables * Name: acglobal.h - Declarations for global variables
* $Revision: 131 $ * $Revision: 132 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -152,7 +152,7 @@ extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINE ...@@ -152,7 +152,7 @@ extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINE
* *
****************************************************************************/ ****************************************************************************/
#define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1 #define NUM_NS_TYPES ACPI_TYPE_INVALID+1
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) #if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
#define NUM_PREDEFINED_NAMES 10 #define NUM_PREDEFINED_NAMES 10
...@@ -279,8 +279,8 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_db_scope_node; ...@@ -279,8 +279,8 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_db_scope_node;
/* /*
* Statistic globals * Statistic globals
*/ */
ACPI_EXTERN u16 acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1]; ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1];
ACPI_EXTERN u16 acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1]; ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1];
ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc;
ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; ACPI_EXTERN u16 acpi_gbl_node_type_count_misc;
ACPI_EXTERN u32 acpi_gbl_num_nodes; ACPI_EXTERN u32 acpi_gbl_num_nodes;
......
/****************************************************************************** /******************************************************************************
* *
* Name: acinterp.h - Interpreter subcomponent prototypes and defines * Name: acinterp.h - Interpreter subcomponent prototypes and defines
* $Revision: 139 $ * $Revision: 140 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -612,10 +612,6 @@ void ...@@ -612,10 +612,6 @@ void
acpi_ex_truncate_for32bit_table ( acpi_ex_truncate_for32bit_table (
acpi_operand_object *obj_desc); acpi_operand_object *obj_desc);
u8
acpi_ex_validate_object_type (
acpi_object_type type);
u8 u8
acpi_ex_acquire_global_lock ( acpi_ex_acquire_global_lock (
u32 rule); u32 rule);
......
/****************************************************************************** /******************************************************************************
* *
* Name: aclocal.h - Internal data types used across the ACPI subsystem * Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 176 $ * $Revision: 178 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -212,7 +212,6 @@ typedef struct acpi_table_desc ...@@ -212,7 +212,6 @@ typedef struct acpi_table_desc
struct acpi_table_desc *next; struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc; struct acpi_table_desc *installed_desc;
acpi_table_header *pointer; acpi_table_header *pointer;
void *base_pointer;
u8 *aml_start; u8 *aml_start;
u64 physical_address; u64 physical_address;
u32 aml_length; u32 aml_length;
...@@ -655,6 +654,7 @@ typedef struct acpi_parseobj_asl ...@@ -655,6 +654,7 @@ typedef struct acpi_parseobj_asl
char *filename; char *filename;
char *external_name; char *external_name;
char *namepath; char *namepath;
char name_seg[4];
u32 extra_value; u32 extra_value;
u32 column; u32 column;
u32 line_number; u32 line_number;
......
/****************************************************************************** /******************************************************************************
* *
* Name: acnamesp.h - Namespace subcomponent prototypes and defines * Name: acnamesp.h - Namespace subcomponent prototypes and defines
* $Revision: 127 $ * $Revision: 129 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -178,6 +178,10 @@ void ...@@ -178,6 +178,10 @@ void
acpi_ns_delete_children ( acpi_ns_delete_children (
acpi_namespace_node *parent); acpi_namespace_node *parent);
int
acpi_ns_compare_names (
char *name1,
char *name2);
/* /*
* Namespace modification - nsmodify * Namespace modification - nsmodify
...@@ -281,17 +285,13 @@ acpi_ns_get_object_value ( ...@@ -281,17 +285,13 @@ acpi_ns_get_object_value (
/* /*
* Parent/Child/Peer utility functions - nsfamily * Parent/Child/Peer utility functions
*/ */
acpi_name acpi_name
acpi_ns_find_parent_name ( acpi_ns_find_parent_name (
acpi_namespace_node *node_to_search); acpi_namespace_node *node_to_search);
u8
acpi_ns_exist_downstream_sibling (
acpi_namespace_node *this_node);
/* /*
* Name and Scope manipulation - nsnames * Name and Scope manipulation - nsnames
...@@ -397,8 +397,8 @@ acpi_ns_search_node ( ...@@ -397,8 +397,8 @@ acpi_ns_search_node (
void void
acpi_ns_install_node ( acpi_ns_install_node (
acpi_walk_state *walk_state, acpi_walk_state *walk_state,
acpi_namespace_node *parent_node, /* Parent */ acpi_namespace_node *parent_node,
acpi_namespace_node *node, /* New Child*/ acpi_namespace_node *node,
acpi_object_type type); acpi_object_type type);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Name: acobject.h - Definition of acpi_operand_object (Internal object only) * Name: acobject.h - Definition of acpi_operand_object (Internal object only)
* $Revision: 113 $ * $Revision: 114 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -199,6 +199,7 @@ typedef struct acpi_object_mutex ...@@ -199,6 +199,7 @@ typedef struct acpi_object_mutex
void *semaphore; void *semaphore;
union acpi_operand_obj *prev; /* Link for list of acquired mutexes */ union acpi_operand_obj *prev; /* Link for list of acquired mutexes */
union acpi_operand_obj *next; /* Link for list of acquired mutexes */ union acpi_operand_obj *next; /* Link for list of acquired mutexes */
acpi_namespace_node *node; /* containing object */
} ACPI_OBJECT_MUTEX; } ACPI_OBJECT_MUTEX;
......
/****************************************************************************** /******************************************************************************
* *
* Name: acstruct.h - Internal structs * Name: acstruct.h - Internal structs
* $Revision: 19 $ * $Revision: 20 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -59,6 +59,8 @@ typedef struct acpi_walk_state ...@@ -59,6 +59,8 @@ typedef struct acpi_walk_state
u8 return_used; u8 return_used;
u8 walk_type; u8 walk_type;
u16 opcode; /* Current AML opcode */ u16 opcode; /* Current AML opcode */
u8 scope_depth;
u8 reserved1;
u32 arg_count; /* push for fixed or var args */ u32 arg_count; /* push for fixed or var args */
u32 aml_offset; u32 aml_offset;
u32 arg_types; u32 arg_types;
......
/****************************************************************************** /******************************************************************************
* *
* Name: actypes.h - Common data types for the entire ACPI subsystem * Name: actypes.h - Common data types for the entire ACPI subsystem
* $Revision: 239 $ * $Revision: 240 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/* /*
* Data types - Fixed across all compilation models * Data types - Fixed across all compilation models (16/32/64)
* *
* BOOLEAN Logical Boolean. * BOOLEAN Logical Boolean.
* INT8 8-bit (1 byte) signed value * INT8 8-bit (1 byte) signed value
...@@ -91,6 +91,7 @@ typedef UINT64 ACPI_SIZE; ...@@ -91,6 +91,7 @@ typedef UINT64 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 16 #elif ACPI_MACHINE_WIDTH == 16
/* /*
* 16-bit type definitions * 16-bit type definitions
*/ */
...@@ -133,6 +134,7 @@ typedef UINT16 ACPI_SIZE; ...@@ -133,6 +134,7 @@ typedef UINT16 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 32 #elif ACPI_MACHINE_WIDTH == 32
/* /*
* 32-bit type definitions (default) * 32-bit type definitions (default)
*/ */
...@@ -168,7 +170,6 @@ typedef UINT32 ACPI_SIZE; ...@@ -168,7 +170,6 @@ typedef UINT32 ACPI_SIZE;
/* /*
* Miscellaneous common types * Miscellaneous common types
*/ */
typedef UINT32 UINT32_BIT; typedef UINT32 UINT32_BIT;
typedef NATIVE_UINT ACPI_PTRDIFF; typedef NATIVE_UINT ACPI_PTRDIFF;
typedef char NATIVE_CHAR; typedef char NATIVE_CHAR;
...@@ -226,7 +227,6 @@ typedef struct acpi_pointer ...@@ -226,7 +227,6 @@ typedef struct acpi_pointer
/* /*
* Useful defines * Useful defines
*/ */
#ifdef FALSE #ifdef FALSE
#undef FALSE #undef FALSE
#endif #endif
...@@ -245,7 +245,6 @@ typedef struct acpi_pointer ...@@ -245,7 +245,6 @@ typedef struct acpi_pointer
/* /*
* Local datatypes * Local datatypes
*/ */
typedef u32 acpi_status; /* All ACPI Exceptions */ typedef u32 acpi_status; /* All ACPI Exceptions */
typedef u32 acpi_name; /* 4-byte ACPI name */ typedef u32 acpi_name; /* 4-byte ACPI name */
typedef char* acpi_string; /* Null terminated ASCII string */ typedef char* acpi_string; /* Null terminated ASCII string */
...@@ -314,7 +313,6 @@ typedef u64 acpi_integer; ...@@ -314,7 +313,6 @@ typedef u64 acpi_integer;
/* /*
* Constants with special meanings * Constants with special meanings
*/ */
#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) #define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR)
...@@ -386,7 +384,6 @@ typedef u64 acpi_integer; ...@@ -386,7 +384,6 @@ typedef u64 acpi_integer;
/* /*
* Table types. These values are passed to the table related APIs * Table types. These values are passed to the table related APIs
*/ */
typedef u32 acpi_table_type; typedef u32 acpi_table_type;
#define ACPI_TABLE_RSDP (acpi_table_type) 0 #define ACPI_TABLE_RSDP (acpi_table_type) 0
...@@ -401,15 +398,14 @@ typedef u32 acpi_table_type; ...@@ -401,15 +398,14 @@ typedef u32 acpi_table_type;
/* /*
* Types associated with names. The first group of * Types associated with ACPI names and objects. The first group of
* values correspond to the definition of the ACPI * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
* Object_type operator (See the ACPI Spec). Therefore, * of the ACPI Object_type() operator (See the ACPI Spec). Therefore,
* only add to the first group if the spec changes. * only add to the first group if the spec changes.
* *
* Types must be kept in sync with the Acpi_ns_properties * Types must be kept in sync with the global Acpi_ns_properties
* and Acpi_ns_type_names arrays * and Acpi_ns_type_names arrays.
*/ */
typedef u32 acpi_object_type; typedef u32 acpi_object_type;
#define ACPI_TYPE_ANY 0x00 #define ACPI_TYPE_ANY 0x00
...@@ -430,52 +426,45 @@ typedef u32 acpi_object_type; ...@@ -430,52 +426,45 @@ typedef u32 acpi_object_type;
#define ACPI_TYPE_DDB_HANDLE 0x0F #define ACPI_TYPE_DDB_HANDLE 0x0F
#define ACPI_TYPE_DEBUG_OBJECT 0x10 #define ACPI_TYPE_DEBUG_OBJECT 0x10
#define ACPI_TYPE_MAX 0x10 #define ACPI_TYPE_EXTERNAL_MAX 0x10
/* /*
* This section contains object types that do not relate to the ACPI Object_type operator. * These are object types that do not map directly to the ACPI
* They are used for various internal purposes only. If new predefined ACPI_TYPEs are * Object_type() operator. They are used for various internal purposes only.
* added (via the ACPI specification), these internal types must move upwards. * If new predefined ACPI_TYPEs are added (via the ACPI specification), these
* Also, values exceeding the largest official ACPI Object_type must not overlap with * internal types must move upwards. (There is code that depends on these
* defined AML opcodes. * values being contiguous with the external types above.)
*/ */
#define INTERNAL_TYPE_BEGIN 0x11 #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
#define INTERNAL_TYPE_REGION_FIELD 0x11 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13
#define INTERNAL_TYPE_BANK_FIELD 0x12 #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, Ref_of, Index */
#define INTERNAL_TYPE_INDEX_FIELD 0x13 #define ACPI_TYPE_LOCAL_ALIAS 0x15
#define INTERNAL_TYPE_REFERENCE 0x14 /* Arg#, Local#, Name, Debug; used only in descriptors */ #define ACPI_TYPE_LOCAL_NOTIFY 0x16
#define INTERNAL_TYPE_ALIAS 0x15 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x17
#define INTERNAL_TYPE_NOTIFY 0x16 #define ACPI_TYPE_LOCAL_RESOURCE 0x18
#define INTERNAL_TYPE_ADDRESS_HANDLER 0x17 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x19
#define INTERNAL_TYPE_RESOURCE 0x18 #define ACPI_TYPE_LOCAL_SCOPE 0x1A /* 1 Name, multiple Object_list Nodes */
#define INTERNAL_TYPE_RESOURCE_FIELD 0x19
#define ACPI_TYPE_NS_NODE_MAX 0x1A /* Last typecode used within a NS Node */
#define INTERNAL_TYPE_NODE_MAX 0x19 /*
* These are special object types that never appear in
/* These are pseudo-types because there are never any namespace nodes with these types */ * a Namespace node, only in an acpi_operand_object
*/
#define ACPI_TYPE_LOCAL_EXTRA 0x1B
#define ACPI_TYPE_LOCAL_DATA 0x1C
#define INTERNAL_TYPE_FIELD_DEFN 0x1A /* Name, Byte_const, multiple Field_element */ #define ACPI_TYPE_LOCAL_MAX 0x1C
#define INTERNAL_TYPE_BANK_FIELD_DEFN 0x1B /* 2 Name,DWord_const,Byte_const,multi Field_element */
#define INTERNAL_TYPE_INDEX_FIELD_DEFN 0x1C /* 2 Name, Byte_const, multiple Field_element */
#define INTERNAL_TYPE_IF 0x1D
#define INTERNAL_TYPE_ELSE 0x1E
#define INTERNAL_TYPE_WHILE 0x1F
#define INTERNAL_TYPE_SCOPE 0x20 /* Name, multiple Node */
#define INTERNAL_TYPE_DEF_ANY 0x21 /* type is Any, suppress search of enclosing scopes */
#define INTERNAL_TYPE_EXTRA 0x22
#define INTERNAL_TYPE_DATA 0x23
#define INTERNAL_TYPE_MAX 0x23 /* All types above here are invalid */
#define INTERNAL_TYPE_INVALID 0x24 #define ACPI_TYPE_INVALID 0x1D
#define ACPI_TYPE_NOT_FOUND 0xFF #define ACPI_TYPE_NOT_FOUND 0xFF
/* /*
* Bitmapped ACPI types * Bitmapped ACPI types. Used internally only
* Used internally only
*/ */
#define ACPI_BTYPE_ANY 0x00000000 #define ACPI_BTYPE_ANY 0x00000000
#define ACPI_BTYPE_INTEGER 0x00000001 #define ACPI_BTYPE_INTEGER 0x00000001
...@@ -515,7 +504,6 @@ typedef u32 acpi_object_type; ...@@ -515,7 +504,6 @@ typedef u32 acpi_object_type;
/* /*
* Acpi_event Types: Fixed & General Purpose * Acpi_event Types: Fixed & General Purpose
*/ */
typedef u32 acpi_event_type; typedef u32 acpi_event_type;
#define ACPI_EVENT_FIXED 0 #define ACPI_EVENT_FIXED 0
...@@ -524,7 +512,6 @@ typedef u32 acpi_event_type; ...@@ -524,7 +512,6 @@ typedef u32 acpi_event_type;
/* /*
* Fixed events * Fixed events
*/ */
#define ACPI_EVENT_PMTIMER 0 #define ACPI_EVENT_PMTIMER 0
#define ACPI_EVENT_GLOBAL 1 #define ACPI_EVENT_GLOBAL 1
#define ACPI_EVENT_POWER_BUTTON 2 #define ACPI_EVENT_POWER_BUTTON 2
...@@ -543,9 +530,7 @@ typedef u32 acpi_event_type; ...@@ -543,9 +530,7 @@ typedef u32 acpi_event_type;
/* /*
* GPEs * GPEs
*/ */
#define ACPI_EVENT_WAKE_ENABLE 0x1 #define ACPI_EVENT_WAKE_ENABLE 0x1
#define ACPI_EVENT_WAKE_DISABLE 0x1 #define ACPI_EVENT_WAKE_DISABLE 0x1
...@@ -626,10 +611,10 @@ typedef u8 ACPI_ADR_SPACE_TYPE; ...@@ -626,10 +611,10 @@ typedef u8 ACPI_ADR_SPACE_TYPE;
#define ACPI_BITREG_MAX 0x13 #define ACPI_BITREG_MAX 0x13
#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
/* /*
* External ACPI object definition * External ACPI object definition
*/ */
typedef union acpi_obj typedef union acpi_obj
{ {
acpi_object_type type; /* See definition of Acpi_ns_type for values */ acpi_object_type type; /* See definition of Acpi_ns_type for values */
...@@ -688,7 +673,6 @@ typedef union acpi_obj ...@@ -688,7 +673,6 @@ typedef union acpi_obj
/* /*
* List of objects, used as a parameter list for control method evaluation * List of objects, used as a parameter list for control method evaluation
*/ */
typedef struct acpi_obj_list typedef struct acpi_obj_list
{ {
u32 count; u32 count;
...@@ -700,7 +684,6 @@ typedef struct acpi_obj_list ...@@ -700,7 +684,6 @@ typedef struct acpi_obj_list
/* /*
* Miscellaneous common Data Structures used by the interfaces * Miscellaneous common Data Structures used by the interfaces
*/ */
#define ACPI_NO_BUFFER 0 #define ACPI_NO_BUFFER 0
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) #define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) #define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
...@@ -716,7 +699,6 @@ typedef struct ...@@ -716,7 +699,6 @@ typedef struct
/* /*
* Name_type for Acpi_get_name * Name_type for Acpi_get_name
*/ */
#define ACPI_FULL_PATHNAME 0 #define ACPI_FULL_PATHNAME 0
#define ACPI_SINGLE_NAME 1 #define ACPI_SINGLE_NAME 1
#define ACPI_NAME_TYPE_MAX 1 #define ACPI_NAME_TYPE_MAX 1
...@@ -725,7 +707,6 @@ typedef struct ...@@ -725,7 +707,6 @@ typedef struct
/* /*
* Structure and flags for Acpi_get_system_info * Structure and flags for Acpi_get_system_info
*/ */
#define ACPI_SYS_MODE_UNKNOWN 0x0000 #define ACPI_SYS_MODE_UNKNOWN 0x0000
#define ACPI_SYS_MODE_ACPI 0x0001 #define ACPI_SYS_MODE_ACPI 0x0001
#define ACPI_SYS_MODE_LEGACY 0x0002 #define ACPI_SYS_MODE_LEGACY 0x0002
...@@ -745,7 +726,6 @@ typedef struct acpi_table_info ...@@ -745,7 +726,6 @@ typedef struct acpi_table_info
/* /*
* System info returned by Acpi_get_system_info() * System info returned by Acpi_get_system_info()
*/ */
typedef struct _acpi_sys_info typedef struct _acpi_sys_info
{ {
u32 acpi_ca_version; u32 acpi_ca_version;
...@@ -764,7 +744,6 @@ typedef struct _acpi_sys_info ...@@ -764,7 +744,6 @@ typedef struct _acpi_sys_info
/* /*
* Various handlers and callback procedures * Various handlers and callback procedures
*/ */
typedef typedef
u32 (*acpi_event_handler) ( u32 (*acpi_event_handler) (
void *context); void *context);
......
/****************************************************************************** /******************************************************************************
* *
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 146 $ * $Revision: 147 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -637,6 +637,11 @@ acpi_ut_delete_object_cache ( ...@@ -637,6 +637,11 @@ acpi_ut_delete_object_cache (
* utmisc * utmisc
*/ */
void
acpi_ut_print_string (
char *string,
u8 max_length);
acpi_status acpi_status
acpi_ut_divide ( acpi_ut_divide (
acpi_integer *in_dividend, acpi_integer *in_dividend,
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
* $Revision: 161 $ * $Revision: 165 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -142,7 +142,7 @@ acpi_ns_root_initialize (void) ...@@ -142,7 +142,7 @@ acpi_ns_root_initialize (void)
/* /*
* Build an object around the static string * Build an object around the static string
*/ */
obj_desc->string.length = ACPI_STRLEN (init_val->val); obj_desc->string.length = (u32) ACPI_STRLEN (init_val->val);
obj_desc->string.pointer = init_val->val; obj_desc->string.pointer = init_val->val;
obj_desc->common.flags |= AOPOBJ_STATIC_POINTER; obj_desc->common.flags |= AOPOBJ_STATIC_POINTER;
break; break;
...@@ -150,6 +150,7 @@ acpi_ns_root_initialize (void) ...@@ -150,6 +150,7 @@ acpi_ns_root_initialize (void)
case ACPI_TYPE_MUTEX: case ACPI_TYPE_MUTEX:
obj_desc->mutex.node = new_node;
obj_desc->mutex.sync_level = obj_desc->mutex.sync_level =
(u16) ACPI_STRTOUL (init_val->val, NULL, 10); (u16) ACPI_STRTOUL (init_val->val, NULL, 10);
...@@ -246,6 +247,7 @@ acpi_ns_lookup ( ...@@ -246,6 +247,7 @@ acpi_ns_lookup (
acpi_namespace_node *current_node = NULL; acpi_namespace_node *current_node = NULL;
acpi_namespace_node *this_node = NULL; acpi_namespace_node *this_node = NULL;
u32 num_segments; u32 num_segments;
u32 num_carats;
acpi_name simple_name; acpi_name simple_name;
acpi_object_type type_to_check_for; acpi_object_type type_to_check_for;
acpi_object_type this_search_type; acpi_object_type this_search_type;
...@@ -299,26 +301,9 @@ acpi_ns_lookup ( ...@@ -299,26 +301,9 @@ acpi_ns_lookup (
} }
} }
/* /* Save type TBD: may be no longer necessary */
* This check is explicitly split to relax the Type_to_check_for
* conditions for Bank_field_defn. Originally, both Bank_field_defn and
* Def_field_defn caused Type_to_check_for to be set to ACPI_TYPE_REGION,
* but the Bank_field_defn may also check for a Field definition as well
* as an Operation_region.
*/
if (INTERNAL_TYPE_FIELD_DEFN == type) {
/* Def_field_defn defines fields in a Region */
type_to_check_for = ACPI_TYPE_REGION;
}
else if (INTERNAL_TYPE_BANK_FIELD_DEFN == type) {
/* Bank_field_defn defines data fields in a Field Object */
type_to_check_for = ACPI_TYPE_ANY;
}
else {
type_to_check_for = type; type_to_check_for = type;
}
/* /*
* Begin examination of the actual pathname * Begin examination of the actual pathname
...@@ -364,14 +349,15 @@ acpi_ns_lookup ( ...@@ -364,14 +349,15 @@ acpi_ns_lookup (
/* Pathname is relative to current scope, start there */ /* Pathname is relative to current scope, start there */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Searching relative to prefix scope [%p]\n", "Searching relative to prefix scope [%4.4s] (%p)\n",
prefix_node)); prefix_node->name.ascii, prefix_node));
/* /*
* Handle multiple Parent Prefixes (carat) by just getting * Handle multiple Parent Prefixes (carat) by just getting
* the parent node for each prefix instance. * the parent node for each prefix instance.
*/ */
this_node = prefix_node; this_node = prefix_node;
num_carats = 0;
while (*path == (u8) AML_PARENT_PREFIX) { while (*path == (u8) AML_PARENT_PREFIX) {
/* Name is fully qualified, no search rules apply */ /* Name is fully qualified, no search rules apply */
...@@ -384,6 +370,7 @@ acpi_ns_lookup ( ...@@ -384,6 +370,7 @@ acpi_ns_lookup (
/* Backup to the parent node */ /* Backup to the parent node */
num_carats++;
this_node = acpi_ns_get_parent_node (this_node); this_node = acpi_ns_get_parent_node (this_node);
if (!this_node) { if (!this_node) {
/* Current scope has no parent scope */ /* Current scope has no parent scope */
...@@ -396,7 +383,8 @@ acpi_ns_lookup ( ...@@ -396,7 +383,8 @@ acpi_ns_lookup (
if (search_parent_flag == ACPI_NS_NO_UPSEARCH) { if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Path is absolute with one or more carats\n")); "Search scope is [%4.4s], path has %d carat(s)\n",
this_node->name.ascii, num_carats));
} }
} }
...@@ -420,6 +408,7 @@ acpi_ns_lookup ( ...@@ -420,6 +408,7 @@ acpi_ns_lookup (
* have the correct target node and there are no name segments. * have the correct target node and there are no name segments.
*/ */
num_segments = 0; num_segments = 0;
type = this_node->type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Prefix-only Pathname (Zero name segments), Flags=%X\n", flags)); "Prefix-only Pathname (Zero name segments), Flags=%X\n", flags));
...@@ -525,6 +514,7 @@ acpi_ns_lookup ( ...@@ -525,6 +514,7 @@ acpi_ns_lookup (
current_node)); current_node));
} }
*return_node = this_node;
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -535,27 +525,24 @@ acpi_ns_lookup ( ...@@ -535,27 +525,24 @@ acpi_ns_lookup (
* 2) And we are looking for a specific type * 2) And we are looking for a specific type
* (Not checking for TYPE_ANY) * (Not checking for TYPE_ANY)
* 3) Which is not an alias * 3) Which is not an alias
* 4) Which is not a local type (TYPE_DEF_ANY) * 4) Which is not a local type (TYPE_SCOPE)
* 5) Which is not a local type (TYPE_SCOPE) * 5) And the type of target object is known (not TYPE_ANY)
* 6) Which is not a local type (TYPE_INDEX_FIELD_DEFN) * 6) And target object does not match what we are looking for
* 7) And the type of target object is known (not TYPE_ANY)
* 8) And target object does not match what we are looking for
* *
* Then we have a type mismatch. Just warn and ignore it. * Then we have a type mismatch. Just warn and ignore it.
*/ */
if ((num_segments == 0) && if ((num_segments == 0) &&
(type_to_check_for != ACPI_TYPE_ANY) && (type_to_check_for != ACPI_TYPE_ANY) &&
(type_to_check_for != INTERNAL_TYPE_ALIAS) && (type_to_check_for != ACPI_TYPE_LOCAL_ALIAS) &&
(type_to_check_for != INTERNAL_TYPE_DEF_ANY) && (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) &&
(type_to_check_for != INTERNAL_TYPE_SCOPE) &&
(type_to_check_for != INTERNAL_TYPE_INDEX_FIELD_DEFN) &&
(this_node->type != ACPI_TYPE_ANY) && (this_node->type != ACPI_TYPE_ANY) &&
(this_node->type != type_to_check_for)) { (this_node->type != type_to_check_for)) {
/* Complain about a type mismatch */ /* Complain about a type mismatch */
ACPI_REPORT_WARNING ( ACPI_REPORT_WARNING (
("Ns_lookup: %4.4s, type %X, checking for type %X\n", ("Ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n",
(char *) &simple_name, this_node->type, type_to_check_for)); (char *) &simple_name, acpi_ut_get_type_name (this_node->type),
acpi_ut_get_type_name (type_to_check_for)));
} }
/* /*
...@@ -581,15 +568,11 @@ acpi_ns_lookup ( ...@@ -581,15 +568,11 @@ acpi_ns_lookup (
* If entry is a type which opens a scope, push the new scope on the * If entry is a type which opens a scope, push the new scope on the
* scope stack. * scope stack.
*/ */
if (acpi_ns_opens_scope (type_to_check_for)) { if (acpi_ns_opens_scope (type)) {
status = acpi_ds_scope_stack_push (this_node, type, walk_state); status = acpi_ds_scope_stack_push (this_node, type, walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
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 * Module Name: nsalloc - Namespace allocation and deletion utilities
* $Revision: 74 $ * $Revision: 75 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -125,6 +125,55 @@ acpi_ns_delete_node ( ...@@ -125,6 +125,55 @@ acpi_ns_delete_node (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ns_compare_names
*
* PARAMETERS: Name1 - First name to compare
* Name2 - Second name to compare
*
* RETURN: value from strncmp
*
* DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
* underscore are forced to be alphabetically first.
*
******************************************************************************/
int
acpi_ns_compare_names (
char *name1,
char *name2)
{
char reversed_name1[ACPI_NAME_SIZE];
char reversed_name2[ACPI_NAME_SIZE];
u32 i;
u32 j;
/*
* Replace all instances of "underscore" with a value that is smaller so
* that all names that are prefixed with underscore(s) are alphabetically
* first.
*
* Reverse the name bytewise so we can just do a 32-bit compare instead
* of a strncmp.
*/
for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--) {
reversed_name1[j] = name1[i];
if (name1[i] == '_') {
reversed_name1[j] = '*';
}
reversed_name2[j] = name2[i];
if (name2[i] == '_') {
reversed_name2[j] = '*';
}
}
return (*(s32 *) reversed_name1 - *(s32 *) reversed_name2);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ns_install_node * FUNCTION: Acpi_ns_install_node
...@@ -139,8 +188,10 @@ acpi_ns_delete_node ( ...@@ -139,8 +188,10 @@ acpi_ns_delete_node (
* DESCRIPTION: Initialize a new namespace node and install it amongst * DESCRIPTION: Initialize a new namespace node and install it amongst
* its peers. * its peers.
* *
* Note: Current namespace lookup is linear search, so the nodes * Note: Current namespace lookup is linear search. However, the
* are not linked in any particular order. * nodes are linked in alphabetical order to 1) put all reserved
* names (start with underscore) first, and to 2) make a readable
* namespace dump.
* *
******************************************************************************/ ******************************************************************************/
...@@ -153,6 +204,7 @@ acpi_ns_install_node ( ...@@ -153,6 +204,7 @@ acpi_ns_install_node (
{ {
u16 owner_id = TABLE_ID_DSDT; u16 owner_id = TABLE_ID_DSDT;
acpi_namespace_node *child_node; acpi_namespace_node *child_node;
acpi_namespace_node *previous_child_node;
ACPI_FUNCTION_TRACE ("Ns_install_node"); ACPI_FUNCTION_TRACE ("Ns_install_node");
...@@ -172,66 +224,68 @@ acpi_ns_install_node ( ...@@ -172,66 +224,68 @@ acpi_ns_install_node (
child_node = parent_node->child; child_node = parent_node->child;
if (!child_node) { if (!child_node) {
parent_node->child = node; parent_node->child = node;
node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node;
} }
else { else {
while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) { /*
child_node = child_node->peer; * Walk the list whilst searching for the the correct
} * alphabetic placement.
*/
previous_child_node = NULL;
while (acpi_ns_compare_names (child_node->name.ascii, node->name.ascii) < 0) {
if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
/* Last peer; Clear end-of-list flag */
child_node->peer = node; child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
/* Clear end-of-list flag */ /* This node is the new peer to the child node */
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST; child_node->peer = node;
}
/* Init the new entry */ /* This node is the new end-of-list */
node->owner_id = owner_id;
node->flags |= ANOBJ_END_OF_PEER_LIST; node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node; node->peer = parent_node;
break;
}
/* Get next peer */
/* previous_child_node = child_node;
* If adding a name with unknown type, or having to child_node = child_node->peer;
* add the region in order to define fields in it, we
* have a forward reference.
*/
if ((ACPI_TYPE_ANY == type) ||
(INTERNAL_TYPE_FIELD_DEFN == type) ||
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) {
/*
* We don't want to abort here, however!
* We will fill in the actual type when the
* real definition is found later.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] is a forward reference\n",
node->name.ascii));
} }
/* Did the node get inserted at the end-of-list? */
if (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
/* /*
* The Def_field_defn and Bank_field_defn cases are actually * Loop above terminated without reaching the end-of-list.
* looking up the Region in which the field will be defined * Insert the new node at the current location
*/ */
if ((INTERNAL_TYPE_FIELD_DEFN == type) || if (previous_child_node) {
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) { /* Insert node alphabetically */
type = ACPI_TYPE_REGION;
node->peer = child_node;
previous_child_node->peer = node;
} }
else {
/* Insert node alphabetically at start of list */
/* node->peer = child_node;
* Scope, Def_any, and Index_field_defn are bogus "types" which do parent_node->child = node;
* not actually have anything to do with the type of the name }
* being looked up. Save any other value of Type as the type of
* the entry.
*/
if ((type != INTERNAL_TYPE_SCOPE) &&
(type != INTERNAL_TYPE_DEF_ANY) &&
(type != INTERNAL_TYPE_INDEX_FIELD_DEFN)) {
node->type = (u8) type;
} }
}
/* Init the new entry */
node->owner_id = owner_id;
node->type = (u8) type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s (%s) added to %4.4s (%s) %p at %p\n",
node->name.ascii, parent_node, node)); node->name.ascii, acpi_ut_get_type_name (node->type),
parent_node->name.ascii, acpi_ut_get_type_name (parent_node->type), parent_node, node));
/* /*
* Increment the reference count(s) of all parents up to * Increment the reference count(s) of all parents up to
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 141 $ * $Revision: 145 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -150,22 +150,14 @@ acpi_ns_dump_one_object ( ...@@ -150,22 +150,14 @@ acpi_ns_dump_one_object (
acpi_object_type obj_type; acpi_object_type obj_type;
acpi_object_type type; acpi_object_type type;
u32 bytes_to_dump; u32 bytes_to_dump;
u32 downstream_sibling_mask = 0;
u32 level_tmp;
u32 which_bit;
u32 i;
u32 dbg_level; u32 dbg_level;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_object"); ACPI_FUNCTION_NAME ("Ns_dump_one_object");
this_node = acpi_ns_map_handle_to_node (obj_handle); /* Is output enabled? */
level_tmp = level;
type = this_node->type;
which_bit = 1;
if (!(acpi_dbg_level & info->debug_level)) { if (!(acpi_dbg_level & info->debug_level)) {
return (AE_OK); return (AE_OK);
...@@ -176,6 +168,9 @@ acpi_ns_dump_one_object ( ...@@ -176,6 +168,9 @@ acpi_ns_dump_one_object (
return (AE_OK); return (AE_OK);
} }
this_node = acpi_ns_map_handle_to_node (obj_handle);
type = this_node->type;
/* Check if the owner matches */ /* Check if the owner matches */
if ((info->owner_id != ACPI_UINT32_MAX) && if ((info->owner_id != ACPI_UINT32_MAX) &&
...@@ -185,45 +180,12 @@ acpi_ns_dump_one_object ( ...@@ -185,45 +180,12 @@ acpi_ns_dump_one_object (
/* Indent the object according to the level */ /* Indent the object according to the level */
while (level_tmp--) { acpi_os_printf ("%2d%*s", level - 1, level * 2, " ");
/* Print appropriate characters to form tree structure */
if (level_tmp) { /* Check the node type and name */
if (downstream_sibling_mask & which_bit) {
acpi_os_printf ("|");
}
else {
acpi_os_printf (" ");
}
which_bit <<= 1; if (type > ACPI_TYPE_LOCAL_MAX) {
} ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type));
else {
if (acpi_ns_exist_downstream_sibling (this_node + 1)) {
downstream_sibling_mask |= ((u32) 1 << (level - 1));
acpi_os_printf ("+");
}
else {
downstream_sibling_mask &= ACPI_UINT32_MAX ^ ((u32) 1 << (level - 1));
acpi_os_printf ("+");
}
if (this_node->child == NULL) {
acpi_os_printf ("-");
}
else if (acpi_ns_exist_downstream_sibling (this_node->child)) {
acpi_os_printf ("+");
}
else {
acpi_os_printf ("-");
}
}
}
/* Check the integrity of our data */
if (type > INTERNAL_TYPE_MAX) {
type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
} }
if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { if (!acpi_ut_valid_acpi_name (this_node->name.integer)) {
...@@ -233,7 +195,7 @@ acpi_ns_dump_one_object ( ...@@ -233,7 +195,7 @@ acpi_ns_dump_one_object (
/* /*
* Now we can print out the pertinent information * Now we can print out the pertinent information
*/ */
acpi_os_printf (" %4.4s %-12s %p", acpi_os_printf ("%4.4s %-12s %p ",
this_node->name.ascii, acpi_ut_get_type_name (type), this_node); this_node->name.ascii, acpi_ut_get_type_name (type), this_node);
dbg_level = acpi_dbg_level; dbg_level = acpi_dbg_level;
...@@ -254,7 +216,7 @@ acpi_ns_dump_one_object ( ...@@ -254,7 +216,7 @@ acpi_ns_dump_one_object (
switch (type) { switch (type) {
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
acpi_os_printf (" ID %X Len %.4X Addr %p\n", acpi_os_printf ("ID %X Len %.4X Addr %p\n",
obj_desc->processor.proc_id, obj_desc->processor.proc_id,
obj_desc->processor.length, obj_desc->processor.length,
(char *) obj_desc->processor.address); (char *) obj_desc->processor.address);
...@@ -263,13 +225,13 @@ acpi_ns_dump_one_object ( ...@@ -263,13 +225,13 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
acpi_os_printf (" Notification object: %p", obj_desc); acpi_os_printf ("Notify object: %p", obj_desc);
break; break;
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
acpi_os_printf (" Args %X Len %.4X Aml %p\n", acpi_os_printf ("Args %X Len %.4X Aml %p\n",
(u32) obj_desc->method.param_count, (u32) obj_desc->method.param_count,
obj_desc->method.aml_length, obj_desc->method.aml_length,
obj_desc->method.aml_start); obj_desc->method.aml_start);
...@@ -278,7 +240,7 @@ acpi_ns_dump_one_object ( ...@@ -278,7 +240,7 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
acpi_os_printf (" = %8.8X%8.8X\n", acpi_os_printf ("= %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value), ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value)); ACPI_LODWORD (obj_desc->integer.value));
break; break;
...@@ -287,11 +249,11 @@ acpi_ns_dump_one_object ( ...@@ -287,11 +249,11 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Elements %.2X\n", acpi_os_printf ("Elements %.2X\n",
obj_desc->package.count); obj_desc->package.count);
} }
else { else {
acpi_os_printf (" [Length not yet evaluated]\n"); acpi_os_printf ("[Length not yet evaluated]\n");
} }
break; break;
...@@ -299,7 +261,7 @@ acpi_ns_dump_one_object ( ...@@ -299,7 +261,7 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Len %.2X", acpi_os_printf ("Len %.2X",
obj_desc->buffer.length); obj_desc->buffer.length);
/* Dump some of the buffer */ /* Dump some of the buffer */
...@@ -313,28 +275,22 @@ acpi_ns_dump_one_object ( ...@@ -313,28 +275,22 @@ acpi_ns_dump_one_object (
acpi_os_printf ("\n"); acpi_os_printf ("\n");
} }
else { else {
acpi_os_printf (" [Length not yet evaluated]\n"); acpi_os_printf ("[Length not yet evaluated]\n");
} }
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
acpi_os_printf (" Len %.2X", obj_desc->string.length); acpi_os_printf ("Len %.2X ", obj_desc->string.length);
acpi_ut_print_string (obj_desc->string.pointer, 32);
if (obj_desc->string.length > 0) {
acpi_os_printf (" = \"%.32s\"", obj_desc->string.pointer);
if (obj_desc->string.length > 32) {
acpi_os_printf ("...");
}
}
acpi_os_printf ("\n"); acpi_os_printf ("\n");
break; break;
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
acpi_os_printf (" [%s]", acpi_ut_get_region_name (obj_desc->region.space_id)); acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n", acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
ACPI_HIDWORD (obj_desc->region.address), ACPI_HIDWORD (obj_desc->region.address),
...@@ -347,9 +303,9 @@ acpi_ns_dump_one_object ( ...@@ -347,9 +303,9 @@ acpi_ns_dump_one_object (
break; break;
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
acpi_os_printf (" [%s]\n", acpi_os_printf ("[%s]\n",
acpi_ps_get_opcode_name (obj_desc->reference.opcode)); acpi_ps_get_opcode_name (obj_desc->reference.opcode));
break; break;
...@@ -358,43 +314,43 @@ acpi_ns_dump_one_object ( ...@@ -358,43 +314,43 @@ acpi_ns_dump_one_object (
if (obj_desc->buffer_field.buffer_obj && if (obj_desc->buffer_field.buffer_obj &&
obj_desc->buffer_field.buffer_obj->buffer.node) { obj_desc->buffer_field.buffer_obj->buffer.node) {
acpi_os_printf (" Buf [%4.4s]", acpi_os_printf ("Buf [%4.4s]",
obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii); obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii);
} }
break; break;
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf (" Rgn [%4.4s]", acpi_os_printf ("Rgn [%4.4s]",
obj_desc->common_field.region_obj->region.node->name.ascii); obj_desc->common_field.region_obj->region.node->name.ascii);
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_os_printf (" Rgn [%4.4s] Bnk [%4.4s]", acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]",
obj_desc->common_field.region_obj->region.node->name.ascii, obj_desc->common_field.region_obj->region.node->name.ascii,
obj_desc->bank_field.bank_obj->common_field.node->name.ascii); obj_desc->bank_field.bank_obj->common_field.node->name.ascii);
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf (" Idx [%4.4s] Dat [%4.4s]", acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]",
obj_desc->index_field.index_obj->common_field.node->name.ascii, obj_desc->index_field.index_obj->common_field.node->name.ascii,
obj_desc->index_field.data_obj->common_field.node->name.ascii); obj_desc->index_field.data_obj->common_field.node->name.ascii);
break; break;
case INTERNAL_TYPE_ALIAS: case ACPI_TYPE_LOCAL_ALIAS:
acpi_os_printf (" Target %4.4s (%p)\n", ((acpi_namespace_node *) obj_desc)->name.ascii, obj_desc); acpi_os_printf ("Target %4.4s (%p)\n", ((acpi_namespace_node *) obj_desc)->name.ascii, obj_desc);
break; break;
default: default:
acpi_os_printf (" Object %p\n", obj_desc); acpi_os_printf ("Object %p\n", obj_desc);
break; break;
} }
...@@ -402,9 +358,10 @@ acpi_ns_dump_one_object ( ...@@ -402,9 +358,10 @@ acpi_ns_dump_one_object (
switch (type) { switch (type) {
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf (" Off %.2X Len %.2X Acc %.2hd\n", acpi_os_printf (" Off %.2X Len %.2X Acc %.2hd\n",
(obj_desc->common_field.base_byte_offset * 8) (obj_desc->common_field.base_byte_offset * 8)
+ obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.start_field_bit_offset,
...@@ -420,9 +377,7 @@ acpi_ns_dump_one_object ( ...@@ -420,9 +377,7 @@ acpi_ns_dump_one_object (
case ACPI_DISPLAY_OBJECTS: case ACPI_DISPLAY_OBJECTS:
acpi_os_printf ("%p O:%p", acpi_os_printf ("O:%p", obj_desc);
this_node, obj_desc);
if (!obj_desc) { if (!obj_desc) {
/* No attached object, we are done */ /* No attached object, we are done */
...@@ -490,7 +445,7 @@ acpi_ns_dump_one_object ( ...@@ -490,7 +445,7 @@ acpi_ns_dump_one_object (
/* Dump attached objects */ /* Dump attached objects */
while (obj_desc) { while (obj_desc) {
obj_type = INTERNAL_TYPE_INVALID; obj_type = ACPI_TYPE_INVALID;
acpi_os_printf (" Attached Object %p: ", obj_desc); acpi_os_printf (" Attached Object %p: ", obj_desc);
/* Decode the type of attached object and dump the contents */ /* Decode the type of attached object and dump the contents */
...@@ -507,7 +462,7 @@ acpi_ns_dump_one_object ( ...@@ -507,7 +462,7 @@ acpi_ns_dump_one_object (
obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); obj_type = ACPI_GET_OBJECT_TYPE (obj_desc);
if (obj_type > INTERNAL_TYPE_MAX) { if (obj_type > ACPI_TYPE_LOCAL_MAX) {
acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type); acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type);
bytes_to_dump = 32; bytes_to_dump = 32;
} }
...@@ -558,15 +513,15 @@ acpi_ns_dump_one_object ( ...@@ -558,15 +513,15 @@ acpi_ns_dump_one_object (
obj_desc = (void *) obj_desc->method.aml_start; obj_desc = (void *) obj_desc->method.aml_start;
break; break;
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
obj_desc = (void *) obj_desc->field.region_obj; obj_desc = (void *) obj_desc->field.region_obj;
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
obj_desc = (void *) obj_desc->bank_field.region_obj; obj_desc = (void *) obj_desc->bank_field.region_obj;
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
obj_desc = (void *) obj_desc->index_field.index_obj; obj_desc = (void *) obj_desc->index_field.index_obj;
break; break;
...@@ -574,7 +529,7 @@ acpi_ns_dump_one_object ( ...@@ -574,7 +529,7 @@ acpi_ns_dump_one_object (
goto cleanup; goto cleanup;
} }
obj_type = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
} }
cleanup: cleanup:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: nsobject - Utilities for objects attached to namespace * Module Name: nsobject - Utilities for objects attached to namespace
* table entries * table entries
* $Revision: 83 $ * $Revision: 84 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -127,15 +127,10 @@ acpi_ns_attach_object ( ...@@ -127,15 +127,10 @@ acpi_ns_attach_object (
else { else {
obj_desc = (acpi_operand_object *) object; obj_desc = (acpi_operand_object *) object;
/* If a valid type (non-ANY) was given, just use it */ /* Use the given type */
if (ACPI_TYPE_ANY != type) {
object_type = type; object_type = type;
} }
else {
object_type = INTERNAL_TYPE_DEF_ANY;
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
obj_desc, node, node->name.ascii)); obj_desc, node, node->name.ascii));
...@@ -201,7 +196,7 @@ acpi_ns_detach_object ( ...@@ -201,7 +196,7 @@ acpi_ns_detach_object (
obj_desc = node->object; obj_desc = node->object;
if (!obj_desc || if (!obj_desc ||
(ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA)) { (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA)) {
return_VOID; return_VOID;
} }
...@@ -211,7 +206,7 @@ acpi_ns_detach_object ( ...@@ -211,7 +206,7 @@ acpi_ns_detach_object (
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_OPERAND) { if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_OPERAND) {
node->object = obj_desc->common.next_object; node->object = obj_desc->common.next_object;
if (node->object && if (node->object &&
(ACPI_GET_OBJECT_TYPE (node->object) != INTERNAL_TYPE_DATA)) { (ACPI_GET_OBJECT_TYPE (node->object) != ACPI_TYPE_LOCAL_DATA)) {
node->object = node->object->common.next_object; node->object = node->object->common.next_object;
} }
} }
...@@ -256,7 +251,7 @@ acpi_ns_get_attached_object ( ...@@ -256,7 +251,7 @@ acpi_ns_get_attached_object (
if (!node->object || if (!node->object ||
((ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_OPERAND) && ((ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_OPERAND) &&
(ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_NAMED)) || (ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_NAMED)) ||
(ACPI_GET_OBJECT_TYPE (node->object) == INTERNAL_TYPE_DATA)) { (ACPI_GET_OBJECT_TYPE (node->object) == ACPI_TYPE_LOCAL_DATA)) {
return_PTR (NULL); return_PTR (NULL);
} }
...@@ -283,9 +278,9 @@ acpi_ns_get_secondary_object ( ...@@ -283,9 +278,9 @@ acpi_ns_get_secondary_object (
if ((!obj_desc) || if ((!obj_desc) ||
(ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) || (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) ||
(!obj_desc->common.next_object) || (!obj_desc->common.next_object) ||
(ACPI_GET_OBJECT_TYPE (obj_desc->common.next_object) == INTERNAL_TYPE_DATA)) { (ACPI_GET_OBJECT_TYPE (obj_desc->common.next_object) == ACPI_TYPE_LOCAL_DATA)) {
return_PTR (NULL); return_PTR (NULL);
} }
...@@ -320,7 +315,7 @@ acpi_ns_attach_data ( ...@@ -320,7 +315,7 @@ acpi_ns_attach_data (
prev_obj_desc = NULL; prev_obj_desc = NULL;
obj_desc = node->object; obj_desc = node->object;
while (obj_desc) { while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) && if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) { (obj_desc->data.handler == handler)) {
return (AE_ALREADY_EXISTS); return (AE_ALREADY_EXISTS);
} }
...@@ -332,7 +327,7 @@ acpi_ns_attach_data ( ...@@ -332,7 +327,7 @@ acpi_ns_attach_data (
/* Create an internal object for the data */ /* Create an internal object for the data */
data_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_DATA); data_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_DATA);
if (!data_desc) { if (!data_desc) {
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
...@@ -378,7 +373,7 @@ acpi_ns_detach_data ( ...@@ -378,7 +373,7 @@ acpi_ns_detach_data (
prev_obj_desc = NULL; prev_obj_desc = NULL;
obj_desc = node->object; obj_desc = node->object;
while (obj_desc) { while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) && if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) { (obj_desc->data.handler == handler)) {
if (prev_obj_desc) { if (prev_obj_desc) {
prev_obj_desc->common.next_object = obj_desc->common.next_object; prev_obj_desc->common.next_object = obj_desc->common.next_object;
...@@ -422,7 +417,7 @@ acpi_ns_get_attached_data ( ...@@ -422,7 +417,7 @@ acpi_ns_get_attached_data (
obj_desc = node->object; obj_desc = node->object;
while (obj_desc) { while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) && if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) { (obj_desc->data.handler == handler)) {
*data = obj_desc->data.pointer; *data = obj_desc->data.pointer;
return (AE_OK); return (AE_OK);
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: nssearch - Namespace search * Module Name: nssearch - Namespace search
* $Revision: 89 $ * $Revision: 92 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -37,14 +37,15 @@ ...@@ -37,14 +37,15 @@
* FUNCTION: Acpi_ns_search_node * FUNCTION: Acpi_ns_search_node
* *
* PARAMETERS: *Target_name - Ascii ACPI name to search for * PARAMETERS: *Target_name - Ascii ACPI name to search for
* *Node - Starting table where search will begin * *Node - Starting node where search will begin
* Type - Object type to match * Type - Object type to match
* **Return_node - Where the matched Named obj is returned * **Return_node - Where the matched Named obj is returned
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Search a single namespace table. Performs a simple search, * DESCRIPTION: Search a single level of the namespace. Performs a
* does not add entries or search parents. * simple search of the specified level, and does not add
* entries or search parents.
* *
* *
* Named object lists are built (and subsequently dumped) in the * Named object lists are built (and subsequently dumped) in the
...@@ -77,7 +78,7 @@ acpi_ns_search_node ( ...@@ -77,7 +78,7 @@ acpi_ns_search_node (
scope_name = acpi_ns_get_external_pathname (node); scope_name = acpi_ns_get_external_pathname (node);
if (scope_name) { if (scope_name) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %s)\n", ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (%s)\n",
scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type))); scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type)));
ACPI_MEM_FREE (scope_name); ACPI_MEM_FREE (scope_name);
...@@ -86,8 +87,8 @@ acpi_ns_search_node ( ...@@ -86,8 +87,8 @@ acpi_ns_search_node (
#endif #endif
/* /*
* Search for name in this table, which is to say that we must search * Search for name at this namespace level, which is to say that we
* for the name among the children of this object * must search for the name among the children of this object
*/ */
next_node = node->child; next_node = node->child;
while (next_node) { while (next_node) {
...@@ -95,30 +96,8 @@ acpi_ns_search_node ( ...@@ -95,30 +96,8 @@ acpi_ns_search_node (
if (next_node->name.integer == target_name) { if (next_node->name.integer == target_name) {
/* /*
* Found matching entry. Capture the type if appropriate, before * Found matching entry.
* returning the entry.
*
* The Def_field_defn and Bank_field_defn cases are actually looking up
* the Region in which the field will be defined
*/
if ((INTERNAL_TYPE_FIELD_DEFN == type) ||
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) {
type = ACPI_TYPE_REGION;
}
/*
* Scope, Def_any, and Index_field_defn are bogus "types" which do not
* actually have anything to do with the type of the name being
* looked up. For any other value of Type, if the type stored in
* the entry is Any (i.e. unknown), save the actual type.
*/ */
if (type != INTERNAL_TYPE_SCOPE &&
type != INTERNAL_TYPE_DEF_ANY &&
type != INTERNAL_TYPE_INDEX_FIELD_DEFN &&
next_node->type == ACPI_TYPE_ANY) {
next_node->type = (u8) type;
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Name %4.4s Type [%s] found at %p\n", "Name %4.4s Type [%s] found at %p\n",
(char *) &target_name, acpi_ut_get_type_name (next_node->type), next_node)); (char *) &target_name, acpi_ut_get_type_name (next_node->type), next_node));
...@@ -142,7 +121,7 @@ acpi_ns_search_node ( ...@@ -142,7 +121,7 @@ acpi_ns_search_node (
next_node = next_node->peer; next_node = next_node->peer;
} }
/* Searched entire table, not found */ /* Searched entire namespace level, not found */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s Type [%s] not found at %p\n", 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)); (char *) &target_name, acpi_ut_get_type_name (type), next_node));
...@@ -156,14 +135,14 @@ acpi_ns_search_node ( ...@@ -156,14 +135,14 @@ acpi_ns_search_node (
* FUNCTION: Acpi_ns_search_parent_tree * FUNCTION: Acpi_ns_search_parent_tree
* *
* PARAMETERS: *Target_name - Ascii ACPI name to search for * PARAMETERS: *Target_name - Ascii ACPI name to search for
* *Node - Starting table where search will begin * *Node - Starting node where search will begin
* Type - Object type to match * Type - Object type to match
* **Return_node - Where the matched Named Obj is returned * **Return_node - Where the matched Named Obj is returned
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Called when a name has not been found in the current namespace * DESCRIPTION: Called when a name has not been found in the current namespace
* table. Before adding it or giving up, ACPI scope rules require * level. Before adding it or giving up, ACPI scope rules require
* searching enclosing scopes in cases identified by Acpi_ns_local(). * searching enclosing scopes in cases identified by Acpi_ns_local().
* *
* "A name is located by finding the matching name in the current * "A name is located by finding the matching name in the current
...@@ -193,22 +172,19 @@ acpi_ns_search_parent_tree ( ...@@ -193,22 +172,19 @@ acpi_ns_search_parent_tree (
parent_node = acpi_ns_get_parent_node (node); parent_node = acpi_ns_get_parent_node (node);
/* /*
* If there is no parent (at the root) or type is "local", we won't be * If there is no parent (i.e., we are at the root) or
* searching the parent tree. * type is "local", we won't be searching the parent tree.
*/ */
if ((acpi_ns_local (type)) ||
(!parent_node)) {
if (!parent_node) { if (!parent_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n", ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
(char *) &target_name)); (char *) &target_name));
return_ACPI_STATUS (AE_NOT_FOUND);
} }
if (acpi_ns_local (type)) { if (acpi_ns_local (type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"[%4.4s] type [%s] must be local to this scope (no parent search)\n", "[%4.4s] type [%s] must be local to this scope (no parent search)\n",
(char *) &target_name, acpi_ut_get_type_name (type))); (char *) &target_name, acpi_ut_get_type_name (type)));
}
return_ACPI_STATUS (AE_NOT_FOUND); return_ACPI_STATUS (AE_NOT_FOUND);
} }
...@@ -251,8 +227,8 @@ acpi_ns_search_parent_tree ( ...@@ -251,8 +227,8 @@ acpi_ns_search_parent_tree (
* *
* PARAMETERS: Target_name - Ascii ACPI name to search for (4 chars) * PARAMETERS: Target_name - Ascii ACPI name to search for (4 chars)
* Walk_state - Current state of the walk * Walk_state - Current state of the walk
* *Node - Starting table where search will begin * *Node - Starting node where search will begin
* Interpreter_mode - Add names only in MODE_Load_pass_x. * Interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x.
* Otherwise,search only. * Otherwise,search only.
* Type - Object type to match * Type - Object type to match
* Flags - Flags describing the search restrictions * Flags - Flags describing the search restrictions
...@@ -260,12 +236,12 @@ acpi_ns_search_parent_tree ( ...@@ -260,12 +236,12 @@ acpi_ns_search_parent_tree (
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Search for a name segment in a single name table, * DESCRIPTION: Search for a name segment in a single namespace level,
* optionally adding it if it is not found. If the passed * optionally adding it if it is not found. If the passed
* Type is not Any and the type previously stored in the * Type is not Any and the type previously stored in the
* entry was Any (i.e. unknown), update the stored type. * entry was Any (i.e. unknown), update the stored type.
* *
* In IMODE_EXECUTE, search only. * In ACPI_IMODE_EXECUTE, search only.
* In other modes, search and add if not found. * In other modes, search and add if not found.
* *
******************************************************************************/ ******************************************************************************/
...@@ -300,14 +276,12 @@ acpi_ns_search_and_enter ( ...@@ -300,14 +276,12 @@ acpi_ns_search_and_enter (
/* Name must consist of printable characters */ /* Name must consist of printable characters */
if (!acpi_ut_valid_acpi_name (target_name)) { if (!acpi_ut_valid_acpi_name (target_name)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08x *** \n", ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name: %X\n",
target_name)); target_name));
ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name\n"));
return_ACPI_STATUS (AE_BAD_CHARACTER); return_ACPI_STATUS (AE_BAD_CHARACTER);
} }
/* Try to find the name in the table specified by the caller */ /* Try to find the name in the namespace level specified by the caller */
*return_node = ACPI_ENTRY_NOT_FOUND; *return_node = ACPI_ENTRY_NOT_FOUND;
status = acpi_ns_search_node (target_name, node, type, return_node); status = acpi_ns_search_node (target_name, node, type, return_node);
...@@ -340,7 +314,7 @@ acpi_ns_search_and_enter ( ...@@ -340,7 +314,7 @@ acpi_ns_search_and_enter (
if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) && if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) &&
(flags & ACPI_NS_SEARCH_PARENT)) { (flags & ACPI_NS_SEARCH_PARENT)) {
/* /*
* Not found in table - search parent tree according * Not found at this level - search parent tree according
* to ACPI specification * to ACPI specification
*/ */
status = acpi_ns_search_parent_tree (target_name, node, status = acpi_ns_search_parent_tree (target_name, node,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation * parents and siblings and Scope manipulation
* $Revision: 113 $ * $Revision: 115 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -747,7 +747,7 @@ u32 ...@@ -747,7 +747,7 @@ u32
acpi_ns_opens_scope ( acpi_ns_opens_scope (
acpi_object_type type) acpi_object_type type)
{ {
ACPI_FUNCTION_TRACE_U32 ("Ns_opens_scope", type); ACPI_FUNCTION_TRACE_STR ("Ns_opens_scope", acpi_ut_get_type_name (type));
if (!acpi_ut_valid_object_type (type)) { if (!acpi_ut_valid_object_type (type)) {
...@@ -885,43 +885,6 @@ acpi_ns_find_parent_name ( ...@@ -885,43 +885,6 @@ acpi_ns_find_parent_name (
} }
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*******************************************************************************
*
* FUNCTION: Acpi_ns_exist_downstream_sibling
*
* PARAMETERS: *Node - pointer to first Node to examine
*
* RETURN: TRUE if sibling is found, FALSE otherwise
*
* DESCRIPTION: Searches remainder of scope being processed to determine
* whether there is a downstream sibling to the current
* object. This function is used to determine what type of
* line drawing character to use when displaying namespace
* trees.
*
******************************************************************************/
u8
acpi_ns_exist_downstream_sibling (
acpi_namespace_node *node)
{
if (!node) {
return (FALSE);
}
if (node->name.integer) {
return (TRUE);
}
return (FALSE);
}
#endif /* ACPI_DEBUG_OUTPUT */
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ns_get_parent_node * FUNCTION: Acpi_ns_get_parent_node
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem * Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces * ACPI Object evaluation interfaces
* $Revision: 2 $ * $Revision: 3 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -373,7 +373,7 @@ acpi_walk_namespace ( ...@@ -373,7 +373,7 @@ acpi_walk_namespace (
/* Parameter validation */ /* Parameter validation */
if ((type > ACPI_TYPE_MAX) || if ((type > ACPI_TYPE_EXTERNAL_MAX) ||
(!max_depth) || (!max_depth) ||
(!user_function)) { (!user_function)) {
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: nsxfobj - Public interfaces to the ACPI subsystem * Module Name: nsxfobj - Public interfaces to the ACPI subsystem
* ACPI Object oriented interfaces * ACPI Object oriented interfaces
* $Revision: 113 $ * $Revision: 114 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -188,7 +188,7 @@ acpi_get_next_object ( ...@@ -188,7 +188,7 @@ acpi_get_next_object (
/* Parameter validation */ /* Parameter validation */
if (type > ACPI_TYPE_MAX) { if (type > ACPI_TYPE_EXTERNAL_MAX) {
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psopcode - Parser/Interpreter opcode information table * Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 72 $ * $Revision: 73 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -455,31 +455,31 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = ...@@ -455,31 +455,31 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT), /* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT), /* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, INTERNAL_TYPE_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, ACPI_TYPE_LOCAL_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), /* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), /* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), /* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), /* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 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), /* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_LOCAL_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_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT), /* 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 | AML_CONSTANT),
/* 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 | AML_CONSTANT), /* 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 | AML_CONSTANT),
/* 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), /* 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), /* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, ACPI_TYPE_LOCAL_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), /* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), /* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), /* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), /* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), /* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), /* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
...@@ -542,23 +542,23 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = ...@@ -542,23 +542,23 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), /* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), /* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), /* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), /* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), /* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
/* 58 */ ACPI_OP ("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), /* 58 */ ACPI_OP ("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, INTERNAL_TYPE_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, INTERNAL_TYPE_INDEX_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, INTERNAL_TYPE_BANK_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* Internal opcodes that map to invalid AML opcodes */ /* Internal opcodes that map to invalid AML opcodes */
/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), /* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), /* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), /* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 63 */ ACPI_OP ("-NamePath-", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ), /* 63 */ ACPI_OP ("-NamePath-", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ),
/* 64 */ ACPI_OP ("-MethodCall-", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE), /* 64 */ ACPI_OP ("-MethodCall-", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE),
/* 65 */ ACPI_OP ("-ByteList-", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), /* 65 */ ACPI_OP ("-ByteList-", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 66 */ ACPI_OP ("-ReservedField-", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), /* 66 */ ACPI_OP ("-ReservedField-", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
...@@ -566,7 +566,7 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = ...@@ -566,7 +566,7 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
/* 68 */ ACPI_OP ("-AccessField-", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), /* 68 */ ACPI_OP ("-AccessField-", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 69 */ ACPI_OP ("-StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), /* 69 */ ACPI_OP ("-StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 6A */ ACPI_OP ("-Return Value-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL), /* 6A */ ACPI_OP ("-Return Value-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL),
/* 6B */ ACPI_OP ("-UNKNOWN_OP-", ARG_NONE, ARG_NONE, INTERNAL_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS), /* 6B */ ACPI_OP ("-UNKNOWN_OP-", ARG_NONE, ARG_NONE, ACPI_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6C */ ACPI_OP ("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), /* 6C */ ACPI_OP ("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6D */ ACPI_OP ("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), /* 6D */ ACPI_OP ("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS),
...@@ -588,7 +588,7 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = ...@@ -588,7 +588,7 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), /* 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), /* 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), /* 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) /* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE)
/*! [End] no source code translation !*/ /*! [End] no source code translation !*/
}; };
......
...@@ -229,7 +229,7 @@ acpi_pci_irq_add_prt ( ...@@ -229,7 +229,7 @@ acpi_pci_irq_add_prt (
PCI Interrupt Routing Support PCI Interrupt Routing Support
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int int
acpi_pci_irq_lookup ( acpi_pci_irq_lookup (
int segment, int segment,
int bus, int bus,
...@@ -285,8 +285,9 @@ acpi_pci_irq_derive ( ...@@ -285,8 +285,9 @@ acpi_pci_irq_derive (
* Attempt to derive an IRQ for this device from a parent bridge's * Attempt to derive an IRQ for this device from a parent bridge's
* PCI interrupt routing entry (a.k.a. the "bridge swizzle"). * PCI interrupt routing entry (a.k.a. the "bridge swizzle").
*/ */
while (!irq && (bridge = bridge->bus->self)) { while (!irq && bridge->bus->self) {
pin = (pin + PCI_SLOT(bridge->devfn)) % 4; pin = (pin + PCI_SLOT(bridge->devfn)) % 4;
bridge = bridge->bus->self;
irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin); irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin);
} }
......
...@@ -217,7 +217,7 @@ acpi_power_on ( ...@@ -217,7 +217,7 @@ acpi_power_on (
static int static int
acpi_power_off ( acpi_power_off_device (
acpi_handle handle) acpi_handle handle)
{ {
int result = 0; int result = 0;
...@@ -225,7 +225,7 @@ acpi_power_off ( ...@@ -225,7 +225,7 @@ acpi_power_off (
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_power_resource *resource = NULL; struct acpi_power_resource *resource = NULL;
ACPI_FUNCTION_TRACE("acpi_power_off"); ACPI_FUNCTION_TRACE("acpi_power_off_device");
result = acpi_power_get_context(handle, &resource); result = acpi_power_get_context(handle, &resource);
if (result) if (result)
...@@ -358,7 +358,7 @@ acpi_power_transition ( ...@@ -358,7 +358,7 @@ acpi_power_transition (
* Then we dereference all power resources used in the current list. * Then we dereference all power resources used in the current list.
*/ */
for (i=0; i<cl->count; i++) { for (i=0; i<cl->count; i++) {
result = acpi_power_off(cl->handles[i]); result = acpi_power_off_device(cl->handles[i]);
if (result) if (result)
goto end; goto end;
} }
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
#ifdef CONFIG_ACPI_PROCESSOR_PERF
#include <linux/cpufreq.h>
#endif
#define ACPI_PROCESSOR_COMPONENT 0x01000000 #define ACPI_PROCESSOR_COMPONENT 0x01000000
#define ACPI_PROCESSOR_CLASS "processor" #define ACPI_PROCESSOR_CLASS "processor"
#define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver"
...@@ -224,6 +228,11 @@ static struct acpi_processor *processors[NR_CPUS]; ...@@ -224,6 +228,11 @@ static struct acpi_processor *processors[NR_CPUS];
static struct acpi_processor_errata errata; static struct acpi_processor_errata errata;
static void (*pm_idle_save)(void) = NULL; static void (*pm_idle_save)(void) = NULL;
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static unsigned int cpufreq_usage_count = 0;
static struct cpufreq_driver *acpi_cpufreq_driver;
#endif
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Errata Handling Errata Handling
...@@ -830,7 +839,7 @@ acpi_processor_get_power_info ( ...@@ -830,7 +839,7 @@ acpi_processor_get_power_info (
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Performance Management Performance Management
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static int static int
acpi_processor_get_platform_limit ( acpi_processor_get_platform_limit (
struct acpi_processor* pr) struct acpi_processor* pr)
...@@ -1037,6 +1046,7 @@ acpi_processor_set_performance ( ...@@ -1037,6 +1046,7 @@ acpi_processor_set_performance (
u16 port = 0; u16 port = 0;
u8 value = 0; u8 value = 0;
int i = 0; int i = 0;
struct cpufreq_freqs cpufreq_freqs;
ACPI_FUNCTION_TRACE("acpi_processor_set_performance"); ACPI_FUNCTION_TRACE("acpi_processor_set_performance");
...@@ -1068,6 +1078,14 @@ acpi_processor_set_performance ( ...@@ -1068,6 +1078,14 @@ acpi_processor_set_performance (
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n",
pr->performance.state, state)); pr->performance.state, state));
/* cpufreq frequency struct */
cpufreq_freqs.cpu = pr->id;
cpufreq_freqs.old = pr->performance.states[pr->performance.state].core_frequency;
cpufreq_freqs.new = pr->performance.states[state].core_frequency;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
/* /*
* First we write the target state's 'control' value to the * First we write the target state's 'control' value to the
* control_register. * control_register.
...@@ -1101,7 +1119,15 @@ acpi_processor_set_performance ( ...@@ -1101,7 +1119,15 @@ acpi_processor_set_performance (
udelay(10); udelay(10);
} }
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
if (value != pr->performance.states[state].status) { if (value != pr->performance.states[state].status) {
unsigned int tmp = cpufreq_freqs.new;
cpufreq_freqs.new = cpufreq_freqs.old;
cpufreq_freqs.old = tmp;
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n")); ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n"));
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
} }
...@@ -1155,6 +1181,23 @@ acpi_processor_get_performance_info ( ...@@ -1155,6 +1181,23 @@ acpi_processor_get_performance_info (
return_VALUE(0); return_VALUE(0);
} }
#else
static int
acpi_processor_get_performance_info (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info_dummy");
if (!pr)
return_VALUE(-EINVAL);
pr->flags.performance = 0;
return_VALUE(0);
}
#endif
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -1400,17 +1443,24 @@ acpi_processor_apply_limit ( ...@@ -1400,17 +1443,24 @@ acpi_processor_apply_limit (
if (!pr->flags.limit) if (!pr->flags.limit)
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
#ifdef CONFIG_ACPI_PROCESSOR_PERF
if (pr->flags.performance) { if (pr->flags.performance) {
px = pr->performance.platform_limit; px = pr->performance.platform_limit;
if (pr->limit.user.px > px) if (pr->limit.user.px > px)
px = pr->limit.user.px; px = pr->limit.user.px;
if (pr->limit.thermal.px > px) if (pr->limit.thermal.px > px)
px = pr->limit.thermal.px; px = pr->limit.thermal.px;
{
result = acpi_processor_set_performance(pr, px); struct cpufreq_policy policy;
policy.cpu = pr->id;
cpufreq_get_policy(&policy, pr->id);
policy.max = pr->performance.states[px].core_frequency * 1000;
result = cpufreq_set_policy(&policy);
}
if (result) if (result)
goto end; goto end;
} }
#endif
if (pr->flags.throttling) { if (pr->flags.throttling) {
if (pr->limit.user.tx > tx) if (pr->limit.user.tx > tx)
...@@ -1481,9 +1531,6 @@ acpi_processor_set_thermal_limit ( ...@@ -1481,9 +1531,6 @@ acpi_processor_set_thermal_limit (
px = pr->limit.thermal.px; px = pr->limit.thermal.px;
tx = pr->limit.thermal.tx; tx = pr->limit.thermal.tx;
px = pr->limit.thermal.px;
tx = pr->limit.thermal.tx;
switch (type) { switch (type) {
case ACPI_PROCESSOR_LIMIT_NONE: case ACPI_PROCESSOR_LIMIT_NONE:
...@@ -1562,6 +1609,271 @@ acpi_processor_get_limit_info ( ...@@ -1562,6 +1609,271 @@ acpi_processor_get_limit_info (
return_VALUE(0); return_VALUE(0);
} }
/* --------------------------------------------------------------------------
cpufreq interface
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static void
acpi_cpufreq_setpolicy (
struct cpufreq_policy *policy)
{
unsigned int cpu = 0;
unsigned int i = 0;
struct acpi_processor *pr = NULL;
unsigned int next_state = 0;
unsigned int result = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy");
if (!policy)
return_VOID;
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
{
for (i=0; i<NR_CPUS; i++) {
if (processors[i] != NULL) {
cpu = i;
pr = processors[cpu];
break;
}
}
}
else
{
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
}
/* select appropriate P-State */
if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
{
for (i=(pr->performance.state_count - 1); i>= pr->limit.state.px; i--)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
{
next_state = i;
break;
}
}
} else {
for (i=pr->limit.state.px; i < pr->performance.state_count; i++)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
{
next_state = i;
break;
}
}
}
/* set one or all CPUs to the new state */
if (policy->cpu == CPUFREQ_ALL_CPUS) {
for (i=0; i<NR_CPUS; i++)
{
pr = processors[cpu];
if (!pr || !cpu_online(cpu))
continue;
result = acpi_processor_set_performance (pr, next_state);
}
} else {
result = acpi_processor_set_performance (pr, next_state);
}
return_VOID;
}
static void
acpi_cpufreq_verify (
struct cpufreq_policy *policy)
{
unsigned int cpu = 0;
unsigned int i = 0;
struct acpi_processor *pr = NULL;
unsigned int number_states = 0;
unsigned int next_larger_state = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_verify");
if (!policy)
return_VOID;
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
{
for (i=0; i<NR_CPUS; i++) {
if (processors[i] != NULL) {
cpu = i;
pr = processors[cpu];
break;
}
}
}
else
{
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
}
/* first check if min and max are within valid limits */
cpufreq_verify_within_limits(
policy,
pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000,
pr->performance.states[pr->limit.state.px].core_frequency * 1000);
/* now check if at least one value is within this limit */
for (i=pr->limit.state.px; i < pr->performance.state_count; i++)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
number_states++;
if (state_freq > policy->max)
next_larger_state = i;
}
if (number_states)
return_VOID;
/* round up now */
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
return_VOID;
}
static int
acpi_cpufreq_init (
struct acpi_processor *pr)
{
int result = 0;
int i = 0;
int current_state = 0;
struct cpufreq_driver *driver;
ACPI_FUNCTION_TRACE("acpi_cpufreq_init");
if (cpufreq_usage_count) {
if (pr->flags.performance == 1)
cpufreq_usage_count++;
return_VALUE(0);
}
/* test if it works */
current_state = pr->performance.state;
if (current_state == pr->limit.state.px) {
result = acpi_processor_set_performance(pr, (pr->performance.state_count - 1));
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
}
result = acpi_processor_set_performance(pr, pr->limit.state.px);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
if (current_state != 0) {
result = acpi_processor_set_performance(pr, current_state);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
}
/* initialization of main "cpufreq" code*/
driver = kmalloc(sizeof(struct cpufreq_driver) +
NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL);
if (!driver)
return_VALUE(-ENOMEM);
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
for (i=0;i<NR_CPUS;i++)
driver->cpu_cur_freq[0] = pr->performance.states[current_state].core_frequency * 1000;
#endif
driver->verify = &acpi_cpufreq_verify;
driver->setpolicy = &acpi_cpufreq_setpolicy;
for (i=0;i<NR_CPUS;i++) {
driver->policy[i].cpu = pr->id;
driver->policy[i].min = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
driver->policy[i].max = pr->performance.states[pr->limit.state.px].core_frequency * 1000;
driver->policy[i].max_cpu_freq = pr->performance.states[0].core_frequency * 1000;
driver->policy[i].policy = ( pr->performance.states[current_state].core_frequency * 1000 == driver->policy[i].max) ?
CPUFREQ_POLICY_PERFORMANCE : CPUFREQ_POLICY_POWERSAVE;
}
acpi_cpufreq_driver = driver;
result = cpufreq_register(driver);
if (result) {
kfree(driver);
acpi_cpufreq_driver = NULL;
return_VALUE(result);
}
cpufreq_usage_count++;
return_VALUE(0);
}
static int
acpi_cpufreq_exit (
struct acpi_processor *pr)
{
int result = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_exit");
if (!pr)
return_VALUE(-EINVAL);
if (pr->flags.performance)
cpufreq_usage_count--;
if (!cpufreq_usage_count) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Removing cpufreq driver\n"));
result = cpufreq_unregister();
}
return_VALUE(result);
}
#else
static int
acpi_cpufreq_init (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_cpufreq_init_dummy");
return_VALUE(0);
}
static int
acpi_cpufreq_exit (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_cpufreq_exit_dummy");
return_VALUE(0);
}
#endif
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
FS Interface (/proc) FS Interface (/proc)
...@@ -1688,7 +2000,7 @@ acpi_processor_read_power ( ...@@ -1688,7 +2000,7 @@ acpi_processor_read_power (
return_VALUE(len); return_VALUE(len);
} }
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static int static int
acpi_processor_read_performance ( acpi_processor_read_performance (
char *page, char *page,
...@@ -1739,7 +2051,6 @@ acpi_processor_read_performance ( ...@@ -1739,7 +2051,6 @@ acpi_processor_read_performance (
return_VALUE(len); return_VALUE(len);
} }
static int static int
acpi_processor_write_performance ( acpi_processor_write_performance (
struct file *file, struct file *file,
...@@ -1750,6 +2061,8 @@ acpi_processor_write_performance ( ...@@ -1750,6 +2061,8 @@ acpi_processor_write_performance (
int result = 0; int result = 0;
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *) data;
char state_string[12] = {'\0'}; char state_string[12] = {'\0'};
unsigned int new_state = 0;
struct cpufreq_policy policy;
ACPI_FUNCTION_TRACE("acpi_processor_write_performance"); ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
...@@ -1760,14 +2073,20 @@ acpi_processor_write_performance ( ...@@ -1760,14 +2073,20 @@ acpi_processor_write_performance (
return_VALUE(-EFAULT); return_VALUE(-EFAULT);
state_string[count] = '\0'; state_string[count] = '\0';
new_state = simple_strtoul(state_string, NULL, 0);
result = acpi_processor_set_performance(pr, cpufreq_get_policy(&policy, pr->id);
simple_strtoul(state_string, NULL, 0));
policy.cpu = pr->id;
policy.max = pr->performance.states[new_state].core_frequency * 1000;
result = cpufreq_set_policy(&policy);
if (result) if (result)
return_VALUE(result); return_VALUE(result);
return_VALUE(count); return_VALUE(count);
} }
#endif
static int static int
...@@ -2005,6 +2324,7 @@ acpi_processor_add_fs ( ...@@ -2005,6 +2324,7 @@ acpi_processor_add_fs (
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
#ifdef CONFIG_ACPI_PROCESSOR_PERF
/* 'performance' [R/W] */ /* 'performance' [R/W] */
entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
...@@ -2017,6 +2337,7 @@ acpi_processor_add_fs ( ...@@ -2017,6 +2337,7 @@ acpi_processor_add_fs (
entry->write_proc = acpi_processor_write_performance; entry->write_proc = acpi_processor_write_performance;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
#endif
/* 'throttling' [R/W] */ /* 'throttling' [R/W] */
entry = create_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, entry = create_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING,
...@@ -2139,6 +2460,7 @@ acpi_processor_get_info ( ...@@ -2139,6 +2460,7 @@ acpi_processor_get_info (
acpi_processor_get_power_info(pr); acpi_processor_get_power_info(pr);
acpi_processor_get_performance_info(pr); acpi_processor_get_performance_info(pr);
acpi_cpufreq_init(pr);
acpi_processor_get_throttling_info(pr); acpi_processor_get_throttling_info(pr);
acpi_processor_get_limit_info(pr); acpi_processor_get_limit_info(pr);
...@@ -2166,9 +2488,15 @@ acpi_processor_notify ( ...@@ -2166,9 +2488,15 @@ acpi_processor_notify (
switch (event) { switch (event) {
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
#ifdef CONFIG_ACPI_PROCESSOR_PERF
result = acpi_processor_get_platform_limit(pr); result = acpi_processor_get_platform_limit(pr);
if (!result) if (!result)
acpi_processor_apply_limit(pr); acpi_processor_apply_limit(pr);
#else
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Please use kernel with Processor Performance States support included!\n"));
result = 0;
#endif
acpi_bus_generate_event(device, event, acpi_bus_generate_event(device, event,
pr->performance.platform_limit); pr->performance.platform_limit);
...@@ -2288,6 +2616,7 @@ acpi_processor_remove ( ...@@ -2288,6 +2616,7 @@ acpi_processor_remove (
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
} }
acpi_cpufreq_exit(pr);
acpi_processor_remove_fs(device); acpi_processor_remove_fs(device);
processors[pr->id] = NULL; processors[pr->id] = NULL;
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rscalc - Calculate stream and list lengths * Module Name: rscalc - Calculate stream and list lengths
* $Revision: 43 $ * $Revision: 44 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -771,7 +771,7 @@ acpi_rs_get_pci_routing_table_length ( ...@@ -771,7 +771,7 @@ acpi_rs_get_pci_routing_table_length (
for (table_index = 0; table_index < 4 && !name_found; table_index++) { for (table_index = 0; table_index < 4 && !name_found; table_index++) {
if ((ACPI_TYPE_STRING == ACPI_GET_OBJECT_TYPE (*sub_object_list)) || if ((ACPI_TYPE_STRING == ACPI_GET_OBJECT_TYPE (*sub_object_list)) ||
((INTERNAL_TYPE_REFERENCE == ACPI_GET_OBJECT_TYPE (*sub_object_list)) && ((ACPI_TYPE_LOCAL_REFERENCE == ACPI_GET_OBJECT_TYPE (*sub_object_list)) &&
((*sub_object_list)->reference.opcode == AML_INT_NAMEPATH_OP))) { ((*sub_object_list)->reference.opcode == AML_INT_NAMEPATH_OP))) {
name_found = TRUE; name_found = TRUE;
} }
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rscreate - Create resource lists/tables * Module Name: rscreate - Create resource lists/tables
* $Revision: 58 $ * $Revision: 61 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -66,7 +66,8 @@ acpi_rs_create_resource_list ( ...@@ -66,7 +66,8 @@ acpi_rs_create_resource_list (
ACPI_FUNCTION_TRACE ("Rs_create_resource_list"); ACPI_FUNCTION_TRACE ("Rs_create_resource_list");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n", byte_stream_buffer)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n",
byte_stream_buffer));
/* /*
* Params already validated, so we don't re-validate here * Params already validated, so we don't re-validate here
...@@ -135,13 +136,13 @@ acpi_rs_create_pci_routing_table ( ...@@ -135,13 +136,13 @@ acpi_rs_create_pci_routing_table (
acpi_buffer *output_buffer) acpi_buffer *output_buffer)
{ {
u8 *buffer; u8 *buffer;
acpi_operand_object **top_object_list = NULL; acpi_operand_object **top_object_list;
acpi_operand_object **sub_object_list = NULL; acpi_operand_object **sub_object_list;
acpi_operand_object *package_element = NULL; acpi_operand_object *obj_desc;
ACPI_SIZE buffer_size_needed = 0; ACPI_SIZE buffer_size_needed = 0;
u32 number_of_elements = 0; u32 number_of_elements;
u32 index = 0; u32 index;
acpi_pci_routing_table *user_prt = NULL; acpi_pci_routing_table *user_prt;
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_status status; acpi_status status;
acpi_buffer path_buffer; acpi_buffer path_buffer;
...@@ -161,7 +162,8 @@ acpi_rs_create_pci_routing_table ( ...@@ -161,7 +162,8 @@ acpi_rs_create_pci_routing_table (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n", (u32) buffer_size_needed)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n",
(u32) buffer_size_needed));
/* Validate/Allocate/Clear caller buffer */ /* Validate/Allocate/Clear caller buffer */
...@@ -171,7 +173,8 @@ acpi_rs_create_pci_routing_table ( ...@@ -171,7 +173,8 @@ acpi_rs_create_pci_routing_table (
} }
/* /*
* Loop through the ACPI_INTERNAL_OBJECTS - Each object should contain an * Loop through the ACPI_INTERNAL_OBJECTS - Each object
* should be a package that in turn contains an
* acpi_integer Address, a u8 Pin, a Name and a u8 Source_index. * acpi_integer Address, a u8 Pin, a Name and a u8 Source_index.
*/ */
top_object_list = package_object->package.elements; top_object_list = package_object->package.elements;
...@@ -194,81 +197,98 @@ acpi_rs_create_pci_routing_table ( ...@@ -194,81 +197,98 @@ acpi_rs_create_pci_routing_table (
* The minus four is to subtract the size of the u8 Source[4] member * The minus four is to subtract the size of the u8 Source[4] member
* because it is added below. * because it is added below.
*/ */
user_prt->length = (sizeof (acpi_pci_routing_table) -4); user_prt->length = (sizeof (acpi_pci_routing_table) - 4);
/* /*
* Dereference the sub-package * Each element of the top-level package must also be a package
*/ */
package_element = *top_object_list; if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X]) Need sub-package, found %s\n",
index, acpi_ut_get_object_type_name (*top_object_list)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* Each sub-package must be of length 4 */
if ((*top_object_list)->package.count != 4) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X]) Need package of length 4, found length %d\n",
index, (*top_object_list)->package.count));
return_ACPI_STATUS (AE_AML_PACKAGE_LIMIT);
}
/* /*
* Dereference the sub-package.
* The Sub_object_list will now point to an array of the four IRQ * The Sub_object_list will now point to an array of the four IRQ
* elements: Address, Pin, Source and Source_index * elements: [Address, Pin, Source, Source_index]
*/ */
sub_object_list = package_element->package.elements; sub_object_list = (*top_object_list)->package.elements;
/* /*
* 1) First subobject: Dereference the Address * 1) First subobject: Dereference the PRT.Address
*/ */
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) { obj_desc = sub_object_list[0];
user_prt->address = (*sub_object_list)->integer.value; if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
user_prt->address = obj_desc->integer.value;
} }
else { else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
acpi_ut_get_object_type_name (*sub_object_list))); "(PRT[%X].Address) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA); return_ACPI_STATUS (AE_BAD_DATA);
} }
/* /*
* 2) Second subobject: Dereference the Pin * 2) Second subobject: Dereference the PRT.Pin
*/ */
sub_object_list++; obj_desc = sub_object_list[1];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) { user_prt->pin = (u32) obj_desc->integer.value;
user_prt->pin = (u32) (*sub_object_list)->integer.value;
} }
else { else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
acpi_ut_get_object_type_name (*sub_object_list))); "(PRT[%X].Pin) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA); return_ACPI_STATUS (AE_BAD_DATA);
} }
/* /*
* 3) Third subobject: Dereference the Source Name * 3) Third subobject: Dereference the PRT.Source_name
*/ */
sub_object_list++; obj_desc = sub_object_list[2];
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
switch (ACPI_GET_OBJECT_TYPE (*sub_object_list)) { case ACPI_TYPE_LOCAL_REFERENCE:
case INTERNAL_TYPE_REFERENCE:
if (obj_desc->reference.opcode != AML_INT_NAMEPATH_OP) {
if ((*sub_object_list)->reference.opcode != AML_INT_NAMEPATH_OP) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n", "(PRT[%X].Source) Need name, found reference op %X\n",
(*sub_object_list)->reference.opcode)); index, obj_desc->reference.opcode));
return_ACPI_STATUS (AE_BAD_DATA); return_ACPI_STATUS (AE_BAD_DATA);
} }
node = (*sub_object_list)->reference.node; node = obj_desc->reference.node;
/* Use *remaining* length of the buffer as max for pathname */ /* Use *remaining* length of the buffer as max for pathname */
path_buffer.length = output_buffer->length - path_buffer.length = output_buffer->length -
(u32) ((u8 *) user_prt->source - (u8 *) output_buffer->pointer); (u32) ((u8 *) user_prt->source -
(u8 *) output_buffer->pointer);
path_buffer.pointer = user_prt->source; path_buffer.pointer = user_prt->source;
status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer); status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer);
user_prt->length += ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */ user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
ACPI_STRCPY (user_prt->source, ACPI_STRCPY (user_prt->source, obj_desc->string.pointer);
(*sub_object_list)->string.pointer);
/* Add to the Length field the length of the string */ /* Add to the Length field the length of the string */
user_prt->length += (*sub_object_list)->string.length; user_prt->length += obj_desc->string.length;
break; break;
...@@ -285,8 +305,9 @@ acpi_rs_create_pci_routing_table ( ...@@ -285,8 +305,9 @@ acpi_rs_create_pci_routing_table (
default: default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
acpi_ut_get_object_type_name (*sub_object_list))); "(PRT[%X].Source) Need Ref/String/Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA); return_ACPI_STATUS (AE_BAD_DATA);
} }
...@@ -295,20 +316,20 @@ acpi_rs_create_pci_routing_table ( ...@@ -295,20 +316,20 @@ acpi_rs_create_pci_routing_table (
user_prt->length = ACPI_ROUND_UP_TO_64_bITS (user_prt->length); user_prt->length = ACPI_ROUND_UP_TO_64_bITS (user_prt->length);
/* /*
* 4) Fourth subobject: Dereference the Source Index * 4) Fourth subobject: Dereference the PRT.Source_index
*/ */
sub_object_list++; obj_desc = sub_object_list[3];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) { user_prt->source_index = (u32) obj_desc->integer.value;
user_prt->source_index = (u32) (*sub_object_list)->integer.value;
} }
else { else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
acpi_ut_get_object_type_name (*sub_object_list))); "(PRT[%X].Source_index) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA); return_ACPI_STATUS (AE_BAD_DATA);
} }
/* Point to the next acpi_operand_object */ /* Point to the next acpi_operand_object in the top level package */
top_object_list++; top_object_list++;
} }
...@@ -349,7 +370,8 @@ acpi_rs_create_byte_stream ( ...@@ -349,7 +370,8 @@ acpi_rs_create_byte_stream (
ACPI_FUNCTION_TRACE ("Rs_create_byte_stream"); ACPI_FUNCTION_TRACE ("Rs_create_byte_stream");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n", linked_list_buffer)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n",
linked_list_buffer));
/* /*
* Params already validated, so we don't re-validate here * Params already validated, so we don't re-validate here
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbconvrt - ACPI Table conversion utilities * Module Name: tbconvrt - ACPI Table conversion utilities
* $Revision: 43 $ * $Revision: 44 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -137,7 +137,6 @@ acpi_tb_convert_to_xsdt ( ...@@ -137,7 +137,6 @@ acpi_tb_convert_to_xsdt (
/* Point the table descriptor to the new table */ /* Point the table descriptor to the new table */
table_info->pointer = (acpi_table_header *) new_table; table_info->pointer = (acpi_table_header *) new_table;
table_info->base_pointer = (acpi_table_header *) new_table;
table_info->length = table_size; table_info->length = table_size;
table_info->allocation = ACPI_MEM_ALLOCATED; table_info->allocation = ACPI_MEM_ALLOCATED;
...@@ -385,7 +384,6 @@ acpi_tb_convert_table_fadt (void) ...@@ -385,7 +384,6 @@ acpi_tb_convert_table_fadt (void)
/* Install the new table */ /* Install the new table */
table_desc->pointer = (acpi_table_header *) acpi_gbl_FADT; table_desc->pointer = (acpi_table_header *) acpi_gbl_FADT;
table_desc->base_pointer = acpi_gbl_FADT;
table_desc->allocation = ACPI_MEM_ALLOCATED; table_desc->allocation = ACPI_MEM_ALLOCATED;
table_desc->length = sizeof (fadt_descriptor_rev2); table_desc->length = sizeof (fadt_descriptor_rev2);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbget - ACPI Table get* routines * Module Name: tbget - ACPI Table get* routines
* $Revision: 80 $ * $Revision: 81 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -386,7 +386,6 @@ acpi_tb_get_this_table ( ...@@ -386,7 +386,6 @@ acpi_tb_get_this_table (
table_info->pointer = full_table; table_info->pointer = full_table;
table_info->length = (ACPI_SIZE) header->length; table_info->length = (ACPI_SIZE) header->length;
table_info->allocation = allocation; table_info->allocation = allocation;
table_info->base_pointer = full_table;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n", "Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n",
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbgetall - Get all required ACPI tables * Module Name: tbgetall - Get all required ACPI tables
* $Revision: 2 $ * $Revision: 3 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -218,7 +218,13 @@ acpi_tb_get_required_tables ( ...@@ -218,7 +218,13 @@ acpi_tb_get_required_tables (
* Get the tables needed by this subsystem (FADT and any SSDTs). * Get the tables needed by this subsystem (FADT and any SSDTs).
* NOTE: All other tables are completely ignored at this time. * NOTE: All other tables are completely ignored at this time.
*/ */
acpi_tb_get_primary_table (&address, &table_info); status = acpi_tb_get_primary_table (&address, &table_info);
if ((status != AE_OK) && (status != AE_TABLE_NOT_SUPPORTED)) {
ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n",
acpi_format_exception (status),
ACPI_HIDWORD (address.pointer.value),
ACPI_LODWORD (address.pointer.value)));
}
} }
/* We must have a FADT to continue */ /* We must have a FADT to continue */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbinstal - ACPI table installation and removal * Module Name: tbinstal - ACPI table installation and removal
* $Revision: 63 $ * $Revision: 64 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -286,7 +286,6 @@ acpi_tb_init_table_descriptor ( ...@@ -286,7 +286,6 @@ acpi_tb_init_table_descriptor (
table_desc->type = table_info->type; table_desc->type = table_info->type;
table_desc->pointer = table_info->pointer; table_desc->pointer = table_info->pointer;
table_desc->base_pointer = table_info->base_pointer;
table_desc->length = table_info->length; table_desc->length = table_info->length;
table_desc->allocation = table_info->allocation; table_desc->allocation = table_info->allocation;
table_desc->aml_start = (u8 *) (table_desc->pointer + 1), table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
...@@ -480,12 +479,12 @@ acpi_tb_delete_single_table ( ...@@ -480,12 +479,12 @@ acpi_tb_delete_single_table (
case ACPI_MEM_ALLOCATED: case ACPI_MEM_ALLOCATED:
ACPI_MEM_FREE (table_desc->base_pointer); ACPI_MEM_FREE (table_desc->pointer);
break; break;
case ACPI_MEM_MAPPED: case ACPI_MEM_MAPPED:
acpi_os_unmap_memory (table_desc->base_pointer, table_desc->length); acpi_os_unmap_memory (table_desc->pointer, table_desc->length);
break; break;
default: default:
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbrsdt - ACPI RSDT table utilities * Module Name: tbrsdt - ACPI RSDT table utilities
* $Revision: 3 $ * $Revision: 4 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -108,7 +108,6 @@ acpi_tb_verify_rsdp ( ...@@ -108,7 +108,6 @@ acpi_tb_verify_rsdp (
table_info.pointer = ACPI_CAST_PTR (acpi_table_header, rsdp); table_info.pointer = ACPI_CAST_PTR (acpi_table_header, rsdp);
table_info.length = sizeof (RSDP_DESCRIPTOR); table_info.length = sizeof (RSDP_DESCRIPTOR);
table_info.allocation = ACPI_MEM_MAPPED; table_info.allocation = ACPI_MEM_MAPPED;
table_info.base_pointer = rsdp;
/* Save the table pointers and allocation info */ /* Save the table pointers and allocation info */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utcopy - Internal to external object translation utilities * Module Name: utcopy - Internal to external object translation utilities
* $Revision: 104 $ * $Revision: 105 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -113,7 +113,7 @@ acpi_ut_copy_isimple_to_esimple ( ...@@ -113,7 +113,7 @@ acpi_ut_copy_isimple_to_esimple (
break; break;
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
/* /*
* This is an object reference. Attempt to dereference it. * This is an object reference. Attempt to dereference it.
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: utdelete - object deletion and reference count utilities * Module Name: utdelete - object deletion and reference count utilities
* $Revision: 91 $ * $Revision: 92 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -417,7 +417,7 @@ acpi_ut_update_object_reference ( ...@@ -417,7 +417,7 @@ acpi_ut_update_object_reference (
break; break;
case INTERNAL_TYPE_ADDRESS_HANDLER: case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
/* Must walk list of address handlers */ /* Must walk list of address handlers */
...@@ -462,7 +462,7 @@ acpi_ut_update_object_reference ( ...@@ -462,7 +462,7 @@ acpi_ut_update_object_reference (
break; break;
case INTERNAL_TYPE_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
status = acpi_ut_create_update_state_and_push ( status = acpi_ut_create_update_state_and_push (
object->field.region_obj, action, &state_list); object->field.region_obj, action, &state_list);
...@@ -472,7 +472,7 @@ acpi_ut_update_object_reference ( ...@@ -472,7 +472,7 @@ acpi_ut_update_object_reference (
break; break;
case INTERNAL_TYPE_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
status = acpi_ut_create_update_state_and_push ( status = acpi_ut_create_update_state_and_push (
object->bank_field.bank_obj, action, &state_list); object->bank_field.bank_obj, action, &state_list);
...@@ -488,7 +488,7 @@ acpi_ut_update_object_reference ( ...@@ -488,7 +488,7 @@ acpi_ut_update_object_reference (
break; break;
case INTERNAL_TYPE_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
status = acpi_ut_create_update_state_and_push ( status = acpi_ut_create_update_state_and_push (
object->index_field.index_obj, action, &state_list); object->index_field.index_obj, action, &state_list);
...@@ -505,7 +505,7 @@ acpi_ut_update_object_reference ( ...@@ -505,7 +505,7 @@ acpi_ut_update_object_reference (
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
default: default:
/* No subobjects */ /* No subobjects */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utglobal - Global variables for the ACPI subsystem * Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 171 $ * $Revision: 172 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -176,11 +176,11 @@ const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES] = { ...@@ -176,11 +176,11 @@ const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES] = {
*/ */
const acpi_predefined_names acpi_gbl_pre_defined_names[] = const acpi_predefined_names acpi_gbl_pre_defined_names[] =
{ {"_GPE", INTERNAL_TYPE_SCOPE, NULL}, { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_PR_", INTERNAL_TYPE_SCOPE, NULL}, {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", INTERNAL_TYPE_SCOPE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", INTERNAL_TYPE_SCOPE, NULL}, {"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_REV", ACPI_TYPE_INTEGER, "2"}, {"_REV", ACPI_TYPE_INTEGER, "2"},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"}, {"_GL_", ACPI_TYPE_MUTEX, "0"},
...@@ -225,17 +225,10 @@ const u8 acpi_gbl_ns_properties[] = ...@@ -225,17 +225,10 @@ const u8 acpi_gbl_ns_properties[] =
ACPI_NS_NORMAL, /* 23 Address Handler */ ACPI_NS_NORMAL, /* 23 Address Handler */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */ ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */ ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */
ACPI_NS_NORMAL, /* 26 Def_field_defn */ ACPI_NS_NEWSCOPE, /* 26 Scope */
ACPI_NS_NORMAL, /* 27 Bank_field_defn */ ACPI_NS_NORMAL, /* 27 Extra */
ACPI_NS_NORMAL, /* 28 Index_field_defn */ ACPI_NS_NORMAL, /* 28 Data */
ACPI_NS_NORMAL, /* 29 If */ ACPI_NS_NORMAL /* 29 Invalid */
ACPI_NS_NORMAL, /* 30 Else */
ACPI_NS_NORMAL, /* 31 While */
ACPI_NS_NEWSCOPE, /* 32 Scope */
ACPI_NS_LOCAL, /* 33 Def_any */
ACPI_NS_NORMAL, /* 34 Extra */
ACPI_NS_NORMAL, /* 35 Data */
ACPI_NS_NORMAL /* 36 Invalid */
}; };
...@@ -481,17 +474,10 @@ static const NATIVE_CHAR *acpi_gbl_ns_type_names[] = /* printable names of AC ...@@ -481,17 +474,10 @@ static const NATIVE_CHAR *acpi_gbl_ns_type_names[] = /* printable names of AC
/* 23 */ "Addr_handler", /* 23 */ "Addr_handler",
/* 24 */ "Resource_desc", /* 24 */ "Resource_desc",
/* 25 */ "Resource_fld", /* 25 */ "Resource_fld",
/* 26 */ "Region_fld_dfn", /* 26 */ "Scope",
/* 27 */ "Bank_fld_dfn", /* 27 */ "Extra",
/* 28 */ "Index_fld_dfn", /* 28 */ "Data",
/* 29 */ "If", /* 39 */ "Invalid"
/* 30 */ "Else",
/* 31 */ "While",
/* 32 */ "Scope",
/* 33 */ "Def_any",
/* 34 */ "Extra",
/* 35 */ "Data",
/* 36 */ "Invalid"
}; };
...@@ -500,7 +486,7 @@ acpi_ut_get_type_name ( ...@@ -500,7 +486,7 @@ acpi_ut_get_type_name (
acpi_object_type type) acpi_object_type type)
{ {
if (type > INTERNAL_TYPE_INVALID) if (type > ACPI_TYPE_INVALID)
{ {
return ((NATIVE_CHAR *) acpi_gbl_bad_type); return ((NATIVE_CHAR *) acpi_gbl_bad_type);
} }
...@@ -563,7 +549,7 @@ acpi_ut_get_mutex_name ( ...@@ -563,7 +549,7 @@ acpi_ut_get_mutex_name (
* *
* FUNCTION: Acpi_ut_valid_object_type * FUNCTION: Acpi_ut_valid_object_type
* *
* PARAMETERS: None. * PARAMETERS: Type - Object type to be validated
* *
* RETURN: TRUE if valid object type * RETURN: TRUE if valid object type
* *
...@@ -576,14 +562,12 @@ acpi_ut_valid_object_type ( ...@@ -576,14 +562,12 @@ acpi_ut_valid_object_type (
acpi_object_type type) acpi_object_type type)
{ {
if (type > ACPI_TYPE_MAX) if (type > ACPI_TYPE_LOCAL_MAX)
{
if ((type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX))
{ {
/* Note: Assumes all TYPEs are contiguous (external/local) */
return (FALSE); return (FALSE);
} }
}
return (TRUE); return (TRUE);
} }
...@@ -767,7 +751,7 @@ acpi_ut_init_globals ( ...@@ -767,7 +751,7 @@ acpi_ut_init_globals (
acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED;
acpi_gbl_root_node_struct.type = ACPI_TYPE_ANY; acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
acpi_gbl_root_node_struct.child = NULL; acpi_gbl_root_node_struct.child = NULL;
acpi_gbl_root_node_struct.peer = NULL; acpi_gbl_root_node_struct.peer = NULL;
acpi_gbl_root_node_struct.object = NULL; acpi_gbl_root_node_struct.object = NULL;
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: utmisc - common utility procedures * Module Name: utmisc - common utility procedures
* $Revision: 84 $ * $Revision: 85 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -32,6 +32,98 @@ ...@@ -32,6 +32,98 @@
ACPI_MODULE_NAME ("utmisc") ACPI_MODULE_NAME ("utmisc")
/*******************************************************************************
*
* FUNCTION: Acpi_ut_print_string
*
* PARAMETERS: String - Null terminated ASCII string
*
* RETURN: None
*
* DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape
* sequences.
*
******************************************************************************/
void
acpi_ut_print_string (
char *string,
u8 max_length)
{
u32 i;
if (!string) {
acpi_os_printf ("<\"NULL STRING PTR\">");
return;
}
acpi_os_printf ("\"");
for (i = 0; string[i] && (i < max_length); i++) {
/* Escape sequences */
switch (string[i]) {
case 0x07:
acpi_os_printf ("\\a"); /* BELL */
break;
case 0x08:
acpi_os_printf ("\\b"); /* BACKSPACE */
break;
case 0x0C:
acpi_os_printf ("\\f"); /* FORMFEED */
break;
case 0x0A:
acpi_os_printf ("\\n"); /* LINEFEED */
break;
case 0x0D:
acpi_os_printf ("\\r"); /* CARRIAGE RETURN*/
break;
case 0x09:
acpi_os_printf ("\\t"); /* HORIZONTAL TAB */
break;
case 0x0B:
acpi_os_printf ("\\v"); /* VERTICAL TAB */
break;
case '\'': /* Single Quote */
case '\"': /* Double Quote */
case '\\': /* Backslash */
acpi_os_printf ("\\%c", (int) string[i]);
break;
default:
/* Check for printable character or hex escape */
if (ACPI_IS_PRINT (string[i]))
{
/* This is a normal character */
acpi_os_printf ("%c", (int) string[i]);
}
else
{
/* All others will be Hex escapes */
acpi_os_printf ("\\x%2.2X", (s32) string[i]);
}
break;
}
}
acpi_os_printf ("\"");
if (i == max_length && string[i]) {
acpi_os_printf ("...");
}
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ut_dword_byte_swap * FUNCTION: Acpi_ut_dword_byte_swap
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utobject - ACPI object create/delete/size/cache routines * Module Name: utobject - ACPI object create/delete/size/cache routines
* $Revision: 76 $ * $Revision: 77 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -87,7 +87,7 @@ acpi_ut_create_internal_object_dbg ( ...@@ -87,7 +87,7 @@ acpi_ut_create_internal_object_dbg (
return_PTR (NULL); return_PTR (NULL);
} }
second_object->common.type = INTERNAL_TYPE_EXTRA; second_object->common.type = ACPI_TYPE_LOCAL_EXTRA;
second_object->common.reference_count = 1; second_object->common.reference_count = 1;
/* Link the second object to the first */ /* Link the second object to the first */
...@@ -352,7 +352,7 @@ acpi_ut_get_simple_object_size ( ...@@ -352,7 +352,7 @@ acpi_ut_get_simple_object_size (
break; break;
case INTERNAL_TYPE_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (internal_object->reference.opcode) { switch (internal_object->reference.opcode) {
case AML_INT_NAMEPATH_OP: case AML_INT_NAMEPATH_OP:
......
...@@ -90,7 +90,7 @@ struct acpi_table_header { ...@@ -90,7 +90,7 @@ struct acpi_table_header {
typedef struct { typedef struct {
u8 type; u8 type;
u8 length; u8 length;
} acpi_table_entry_header __attribute__ ((packed)); } __attribute__ ((packed)) acpi_table_entry_header;
/* Root System Description Table (RSDT) */ /* Root System Description Table (RSDT) */
...@@ -143,7 +143,7 @@ typedef struct { ...@@ -143,7 +143,7 @@ typedef struct {
u16 polarity:2; u16 polarity:2;
u16 trigger:2; u16 trigger:2;
u16 reserved:12; u16 reserved:12;
} acpi_interrupt_flags __attribute__ ((packed)); } __attribute__ ((packed)) acpi_interrupt_flags;
struct acpi_table_lapic { struct acpi_table_lapic {
acpi_table_entry_header header; acpi_table_entry_header header;
...@@ -330,7 +330,7 @@ struct acpi_table_ecdt { ...@@ -330,7 +330,7 @@ struct acpi_table_ecdt {
acpi_generic_address ec_data; acpi_generic_address ec_data;
u32 uid; u32 uid;
u8 gpe_bit; u8 gpe_bit;
char *ec_id; char ec_id[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Table Handlers */ /* Table Handlers */
......
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