Commit a89cc9b6 authored by Andy Grover's avatar Andy Grover Committed by Andy Grover

ACPI interpreter updates:

- Improved ACPI mode switching (Kochi Takayoshi)
- Improved namespace handling of parent operator "^^"
- Changed the names of some proprocessor macros
- Other improvements
parent 33921b31
...@@ -7,7 +7,7 @@ export ACPI_CFLAGS ...@@ -7,7 +7,7 @@ export ACPI_CFLAGS
ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include
ifdef CONFIG_ACPI_DEBUG ifdef CONFIG_ACPI_DEBUG
ACPI_CFLAGS += -DACPI_DEBUG ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT
endif endif
EXTRA_CFLAGS += $(ACPI_CFLAGS) EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbcmds - debug commands and output routines * Module Name: dbcmds - debug commands and output routines
* $Revision: 85 $ * $Revision: 87 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#include "acresrc.h" #include "acresrc.h"
#include "acdisasm.h" #include "acdisasm.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbcmds") ACPI_MODULE_NAME ("dbcmds")
...@@ -1111,4 +1111,4 @@ acpi_db_check_integrity (void) ...@@ -1111,4 +1111,4 @@ acpi_db_check_integrity (void)
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbdisply - debug display commands * Module Name: dbdisply - debug display commands
* $Revision: 76 $ * $Revision: 78 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
#include "acdebug.h" #include "acdebug.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbdisply") ACPI_MODULE_NAME ("dbdisply")
...@@ -855,5 +855,5 @@ acpi_db_display_argument_object ( ...@@ -855,5 +855,5 @@ acpi_db_display_argument_object (
acpi_db_display_internal_object (obj_desc, walk_state); acpi_db_display_internal_object (obj_desc, walk_state);
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbexec - debugger control method execution * Module Name: dbexec - debugger control method execution
* $Revision: 42 $ * $Revision: 44 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#include "acpi.h" #include "acpi.h"
#include "acdebug.h" #include "acdebug.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbexec") ACPI_MODULE_NAME ("dbexec")
...@@ -209,7 +209,7 @@ acpi_db_execute ( ...@@ -209,7 +209,7 @@ acpi_db_execute (
acpi_buffer return_obj; acpi_buffer return_obj;
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
u32 previous_allocations; u32 previous_allocations;
u32 allocations; u32 allocations;
...@@ -236,7 +236,7 @@ acpi_db_execute ( ...@@ -236,7 +236,7 @@ acpi_db_execute (
acpi_os_sleep (0, 10); acpi_os_sleep (0, 10);
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
/* Memory allocation tracking */ /* Memory allocation tracking */
...@@ -400,6 +400,6 @@ acpi_db_create_execution_threads ( ...@@ -400,6 +400,6 @@ acpi_db_create_execution_threads (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dbfileio - Debugger file I/O commands. These can't usually * Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode) * be used when running the debugger in Ring 0 (Kernel mode)
* $Revision: 67 $ * $Revision: 68 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include "acnamesp.h" #include "acnamesp.h"
#include "actables.h" #include "actables.h"
#if (defined ENABLE_DEBUGGER || defined ACPI_DISASSEMBLER) #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio") ACPI_MODULE_NAME ("dbfileio")
...@@ -86,7 +86,7 @@ acpi_db_match_argument ( ...@@ -86,7 +86,7 @@ acpi_db_match_argument (
} }
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_db_close_debug_file * FUNCTION: Acpi_db_close_debug_file
...@@ -395,5 +395,5 @@ acpi_db_load_acpi_table ( ...@@ -395,5 +395,5 @@ acpi_db_load_acpi_table (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/****************************************************************************** /******************************************************************************
* *
* Module Name: dbhistry - debugger HISTORY command * Module Name: dbhistry - debugger HISTORY command
* $Revision: 24 $ * $Revision: 25 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#include "acpi.h" #include "acpi.h"
#include "acdebug.h" #include "acdebug.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbhistry") ACPI_MODULE_NAME ("dbhistry")
...@@ -185,5 +185,5 @@ acpi_db_get_from_history ( ...@@ -185,5 +185,5 @@ acpi_db_get_from_history (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbinput - user front-end to the AML debugger * Module Name: dbinput - user front-end to the AML debugger
* $Revision: 86 $ * $Revision: 87 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#include "acdebug.h" #include "acdebug.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbinput") ACPI_MODULE_NAME ("dbinput")
...@@ -888,5 +888,5 @@ acpi_db_user_commands ( ...@@ -888,5 +888,5 @@ acpi_db_user_commands (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbstats - Generation and display of ACPI table statistics * Module Name: dbstats - Generation and display of ACPI table statistics
* $Revision: 60 $ * $Revision: 61 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#include <acdebug.h> #include <acdebug.h>
#include <acnamesp.h> #include <acnamesp.h>
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbstats") ACPI_MODULE_NAME ("dbstats")
/* /*
...@@ -148,8 +148,6 @@ acpi_db_enumerate_object ( ...@@ -148,8 +148,6 @@ acpi_db_enumerate_object (
} }
#ifndef PARSER_ONLY
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_db_classify_one_object * FUNCTION: Acpi_db_classify_one_object
...@@ -254,8 +252,6 @@ acpi_db_count_namespace_objects ( ...@@ -254,8 +252,6 @@ acpi_db_count_namespace_objects (
FALSE, acpi_db_classify_one_object, NULL, NULL); FALSE, acpi_db_classify_one_object, NULL, NULL);
} }
#endif
/******************************************************************************* /*******************************************************************************
* *
...@@ -303,13 +299,11 @@ acpi_db_display_statistics ( ...@@ -303,13 +299,11 @@ acpi_db_display_statistics (
switch (type) switch (type)
{ {
#ifndef PARSER_ONLY
case CMD_STAT_ALLOCATIONS: case CMD_STAT_ALLOCATIONS:
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
acpi_ut_dump_allocation_info (); acpi_ut_dump_allocation_info ();
#endif #endif
break; break;
#endif
case CMD_STAT_TABLES: case CMD_STAT_TABLES:
...@@ -322,8 +316,6 @@ acpi_db_display_statistics ( ...@@ -322,8 +316,6 @@ acpi_db_display_statistics (
case CMD_STAT_OBJECTS: case CMD_STAT_OBJECTS:
#ifndef PARSER_ONLY
acpi_db_count_namespace_objects (); acpi_db_count_namespace_objects ();
acpi_os_printf ("\nObjects defined in the current namespace:\n\n"); acpi_os_printf ("\nObjects defined in the current namespace:\n\n");
...@@ -340,8 +332,6 @@ acpi_db_display_statistics ( ...@@ -340,8 +332,6 @@ acpi_db_display_statistics (
acpi_os_printf ("%16.16s % 10ld% 10ld\n", "TOTALS:", acpi_os_printf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
acpi_gbl_num_nodes, acpi_gbl_num_objects); acpi_gbl_num_nodes, acpi_gbl_num_objects);
#endif
break; break;
case CMD_STAT_MEMORY: case CMD_STAT_MEMORY:
...@@ -445,7 +435,7 @@ acpi_db_display_statistics ( ...@@ -445,7 +435,7 @@ acpi_db_display_statistics (
case CMD_STAT_STACK: case CMD_STAT_STACK:
#if defined(ACPI_DEBUG) #if defined(ACPI_DEBUG_OUTPUT)
size = (u32) (acpi_gbl_entry_stack_pointer - acpi_gbl_lowest_stack_pointer); size = (u32) (acpi_gbl_entry_stack_pointer - acpi_gbl_lowest_stack_pointer);
...@@ -466,4 +456,4 @@ acpi_db_display_statistics ( ...@@ -466,4 +456,4 @@ acpi_db_display_statistics (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbutils - AML debugger utilities * Module Name: dbutils - AML debugger utilities
* $Revision: 55 $ * $Revision: 56 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include "acdispat.h" #include "acdispat.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbutils") ACPI_MODULE_NAME ("dbutils")
...@@ -375,6 +375,6 @@ acpi_db_local_ns_lookup ( ...@@ -375,6 +375,6 @@ acpi_db_local_ns_lookup (
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbxface - AML Debugger external interfaces * Module Name: dbxface - AML Debugger external interfaces
* $Revision: 61 $ * $Revision: 64 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include "acdisasm.h" #include "acdisasm.h"
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbxface") ACPI_MODULE_NAME ("dbxface")
...@@ -184,7 +184,7 @@ acpi_db_single_step ( ...@@ -184,7 +184,7 @@ acpi_db_single_step (
/* Restore everything */ /* Restore everything */
op->common.next = next; op->common.next = next;
acpi_os_printf ("\n"); acpi_os_printf ("\n\n");
acpi_dbg_level = original_debug_level; acpi_dbg_level = original_debug_level;
} }
...@@ -385,4 +385,4 @@ acpi_db_terminate (void) ...@@ -385,4 +385,4 @@ acpi_db_terminate (void)
} }
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsfield - Dispatcher field routines * Module Name: dsfield - Dispatcher field routines
* $Revision: 65 $ * $Revision: 66 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
* $Revision: 87 $ * $Revision: 88 $
* *
*****************************************************************************/ *****************************************************************************/
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsmthdat - control method arguments and local variables * Module Name: dsmthdat - control method arguments and local variables
* $Revision: 62 $ * $Revision: 63 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -587,23 +587,40 @@ acpi_ds_store_object_to_local ( ...@@ -587,23 +587,40 @@ acpi_ds_store_object_to_local (
* *
* Weird, but true. * Weird, but true.
*/ */
if ((opcode == AML_ARG_OP) && if (opcode == AML_ARG_OP) {
(ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) == ACPI_DESC_TYPE_NAMED)) { /*
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, * Make sure that the object is the correct type. This may be overkill, but
"Arg (%p) is an Obj_ref(Node), storing in node %p\n", * it is here because references were NS nodes in the past. Now they are
obj_desc, current_obj_desc)); * operand objects of type Reference.
*/
/* Detach an existing object from the Node */ if (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) != ACPI_DESC_TYPE_OPERAND) {
ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: %X\n",
acpi_ns_detach_object ((acpi_namespace_node *) current_obj_desc); current_obj_desc->common.type));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* /*
* Store this object into the Node * If we have a valid reference object that came from Ref_of(), do the
* (perform the indirect store) * indirect store
*/ */
status = acpi_ns_attach_object ((acpi_namespace_node *) current_obj_desc, if ((current_obj_desc->common.type == INTERNAL_TYPE_REFERENCE) &&
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc)); (current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
return_ACPI_STATUS (status); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Arg (%p) is an Obj_ref(Node), storing in node %p\n",
obj_desc, current_obj_desc));
/* Detach an existing object from the referenced Node */
acpi_ns_detach_object (current_obj_desc->reference.object);
/*
* Store this object into the Node
* (perform the indirect store)
*/
status = acpi_ns_attach_object (current_obj_desc->reference.object,
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc));
return_ACPI_STATUS (status);
}
} }
/* /*
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsobject - Dispatcher object management routines * Module Name: dsobject - Dispatcher object management routines
* $Revision: 105 $ * $Revision: 106 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 80 $ * $Revision: 81 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dswexec - Dispatcher method execution callbacks; * Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter. * dispatch to interpreter.
* $Revision: 94 $ * $Revision: 95 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswload - Dispatcher namespace load callbacks * Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 69 $ * $Revision: 70 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -296,7 +296,7 @@ acpi_ds_load2_begin_op ( ...@@ -296,7 +296,7 @@ acpi_ds_load2_begin_op (
NATIVE_CHAR *buffer_ptr; NATIVE_CHAR *buffer_ptr;
ACPI_FUNCTION_NAME ("Ds_load2_begin_op"); ACPI_FUNCTION_TRACE ("Ds_load2_begin_op");
op = walk_state->op; op = walk_state->op;
...@@ -307,7 +307,7 @@ acpi_ds_load2_begin_op ( ...@@ -307,7 +307,7 @@ acpi_ds_load2_begin_op (
if ((!(walk_state->op_info->flags & AML_NSOPCODE) && (walk_state->opcode != AML_INT_NAMEPATH_OP)) || if ((!(walk_state->op_info->flags & AML_NSOPCODE) && (walk_state->opcode != AML_INT_NAMEPATH_OP)) ||
(!(walk_state->op_info->flags & AML_NAMED))) { (!(walk_state->op_info->flags & AML_NAMED))) {
return (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* /*
...@@ -320,7 +320,7 @@ acpi_ds_load2_begin_op ( ...@@ -320,7 +320,7 @@ acpi_ds_load2_begin_op (
if (!buffer_ptr) { if (!buffer_ptr) {
/* No name, just exit */ /* No name, just exit */
return (AE_OK); return_ACPI_STATUS (AE_OK);
} }
} }
else { else {
...@@ -368,11 +368,11 @@ acpi_ds_load2_begin_op ( ...@@ -368,11 +368,11 @@ acpi_ds_load2_begin_op (
if (acpi_ns_opens_scope (object_type)) { if (acpi_ns_opens_scope (object_type)) {
status = acpi_ds_scope_stack_push (node, object_type, walk_state); status = acpi_ds_scope_stack_push (node, object_type, walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return (status); return_ACPI_STATUS (status);
} }
} }
return (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* /*
...@@ -390,7 +390,7 @@ acpi_ds_load2_begin_op ( ...@@ -390,7 +390,7 @@ acpi_ds_load2_begin_op (
op = acpi_ps_alloc_op (walk_state->opcode); op = acpi_ps_alloc_op (walk_state->opcode);
if (!op) { if (!op) {
return (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
/* Initialize the new op */ /* Initialize the new op */
...@@ -410,7 +410,7 @@ acpi_ds_load2_begin_op ( ...@@ -410,7 +410,7 @@ acpi_ds_load2_begin_op (
op->common.node = node; op->common.node = node;
} }
return (status); return_ACPI_STATUS (status);
} }
...@@ -444,7 +444,7 @@ acpi_ds_load2_end_op ( ...@@ -444,7 +444,7 @@ acpi_ds_load2_end_op (
#endif #endif
ACPI_FUNCTION_NAME ("Ds_load2_end_op"); ACPI_FUNCTION_TRACE ("Ds_load2_end_op");
op = walk_state->op; op = walk_state->op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
...@@ -453,7 +453,7 @@ acpi_ds_load2_end_op ( ...@@ -453,7 +453,7 @@ acpi_ds_load2_end_op (
/* Only interested in opcodes that have namespace objects */ /* Only interested in opcodes that have namespace objects */
if (!(walk_state->op_info->flags & AML_NSOBJECT)) { if (!(walk_state->op_info->flags & AML_NSOBJECT)) {
return (AE_OK); return_ACPI_STATUS (AE_OK);
} }
if (op->common.aml_opcode == AML_SCOPE_OP) { if (op->common.aml_opcode == AML_SCOPE_OP) {
...@@ -479,13 +479,13 @@ acpi_ds_load2_end_op ( ...@@ -479,13 +479,13 @@ acpi_ds_load2_end_op (
/* Pop the scope stack */ /* Pop the scope stack */
if (acpi_ns_opens_scope (object_type)) { if (acpi_ns_opens_scope (object_type) && (op->common.aml_opcode != AML_INT_METHODCALL_OP)) {
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
acpi_ut_get_type_name (object_type), op)); acpi_ut_get_type_name (object_type), op));
status = acpi_ds_scope_stack_pop (walk_state); status = acpi_ds_scope_stack_pop (walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return (status); return_ACPI_STATUS (status);
} }
} }
...@@ -730,7 +730,7 @@ acpi_ds_load2_end_op ( ...@@ -730,7 +730,7 @@ acpi_ds_load2_end_op (
walk_state->operands[0] = NULL; walk_state->operands[0] = NULL;
walk_state->num_operands = 0; walk_state->num_operands = 0;
return (status); return_ACPI_STATUS (status);
} }
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswstate - Dispatcher parse tree walk management routines * Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 67 $ * $Revision: 68 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -835,6 +835,8 @@ acpi_ds_create_walk_state ( ...@@ -835,6 +835,8 @@ acpi_ds_create_walk_state (
walk_state->method_desc = mth_desc; walk_state->method_desc = mth_desc;
walk_state->thread = thread; walk_state->thread = thread;
walk_state->parser_state.start_op = origin;
/* Init the method args/local */ /* Init the method args/local */
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
...@@ -883,6 +885,7 @@ acpi_ds_init_aml_walk ( ...@@ -883,6 +885,7 @@ acpi_ds_init_aml_walk (
{ {
acpi_status status; acpi_status status;
acpi_parse_state *parser_state = &walk_state->parser_state; acpi_parse_state *parser_state = &walk_state->parser_state;
acpi_parse_object *extra_op;
ACPI_FUNCTION_TRACE ("Ds_init_aml_walk"); ACPI_FUNCTION_TRACE ("Ds_init_aml_walk");
...@@ -925,9 +928,23 @@ acpi_ds_init_aml_walk ( ...@@ -925,9 +928,23 @@ acpi_ds_init_aml_walk (
} }
} }
else { else {
/* Setup the current scope */ /*
* Setup the current scope.
* Find a Named Op that has a namespace node associated with it.
* search upwards from this Op. Current scope is the first
* Op with a namespace node.
*/
extra_op = parser_state->start_op;
while (extra_op && !extra_op->common.node) {
extra_op = extra_op->common.parent;
}
if (!extra_op) {
parser_state->start_node = NULL;
}
else {
parser_state->start_node = extra_op->common.node;
}
parser_state->start_node = parser_state->start_op->common.node;
if (parser_state->start_node) { if (parser_state->start_node) {
/* Push start scope on scope stack and make it current */ /* Push start scope on scope stack and make it current */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch * Module Name: evevent - Fixed and General Purpose Even handling and dispatch
* $Revision: 88 $ * $Revision: 90 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -104,7 +104,7 @@ acpi_ev_handler_initialize ( ...@@ -104,7 +104,7 @@ acpi_ev_handler_initialize (
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE ("Ev_initialize"); ACPI_FUNCTION_TRACE ("Ev_handler_initialize");
/* Install the SCI handler */ /* Install the SCI handler */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evmisc - Miscellaneous event manager support functions * Module Name: evmisc - Miscellaneous event manager support functions
* $Revision: 53 $ * $Revision: 56 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -442,11 +442,13 @@ acpi_ev_acquire_global_lock ( ...@@ -442,11 +442,13 @@ acpi_ev_acquire_global_lock (
ACPI_FUNCTION_TRACE ("Ev_acquire_global_lock"); ACPI_FUNCTION_TRACE ("Ev_acquire_global_lock");
#ifndef ACPI_APPLICATION
/* Make sure that we actually have a global lock */ /* Make sure that we actually have a global lock */
if (!acpi_gbl_global_lock_present) { if (!acpi_gbl_global_lock_present) {
return_ACPI_STATUS (AE_NO_GLOBAL_LOCK); return_ACPI_STATUS (AE_NO_GLOBAL_LOCK);
} }
#endif
/* One more thread wants the global lock */ /* One more thread wants the global lock */
...@@ -552,9 +554,56 @@ acpi_ev_release_global_lock (void) ...@@ -552,9 +554,56 @@ acpi_ev_release_global_lock (void)
void void
acpi_ev_terminate (void) acpi_ev_terminate (void)
{ {
NATIVE_UINT_MAX32 i;
acpi_status status;
ACPI_FUNCTION_TRACE ("Ev_terminate"); ACPI_FUNCTION_TRACE ("Ev_terminate");
/*
* Disable all event-related functionality.
* In all cases, on error, print a message but obviously we don't abort.
*/
/*
* Disable all fixed events
*/
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
status = acpi_disable_event(i, ACPI_EVENT_FIXED, 0);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i));
}
}
/*
* Disable all GPEs
*/
for (i = 0; i < acpi_gbl_gpe_number_max; i++) {
if (acpi_ev_get_gpe_number_index(i) != ACPI_GPE_INVALID) {
status = acpi_hw_disable_gpe(i);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable GPE %d.\n", i));
}
}
}
/*
* Remove SCI handler
*/
status = acpi_ev_remove_sci_handler();
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to remove SCI handler.\n"));
}
/*
* Return to original mode if necessary
*/
if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
status = acpi_disable ();
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_disable failed.\n"));
}
}
/* /*
* Free global tables, etc. * Free global tables, etc.
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evregion - ACPI Address_space (Op_region) handler dispatch * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
* $Revision: 134 $ * $Revision: 135 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evrgnini- ACPI Address_space (Op_region) init * Module Name: evrgnini- ACPI Address_space (Op_region) init
* $Revision: 62 $ * $Revision: 63 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxface - External interfaces for ACPI events * Module Name: evxface - External interfaces for ACPI events
* $Revision: 129 $ * $Revision: 130 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
* $Revision: 55 $ * $Revision: 57 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -52,16 +52,14 @@ acpi_enable (void) ...@@ -52,16 +52,14 @@ acpi_enable (void)
ACPI_FUNCTION_TRACE ("Acpi_enable"); ACPI_FUNCTION_TRACE ("Acpi_enable");
/* Make sure we have ACPI tables */ /* Make sure we have the FADT*/
if (!acpi_gbl_DSDT) { if (!acpi_gbl_FADT) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n")); ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No FADT information present!\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES); return_ACPI_STATUS (AE_NO_ACPI_TABLES);
} }
acpi_gbl_original_mode = acpi_hw_get_mode (); if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
if (acpi_gbl_original_mode == ACPI_SYS_MODE_ACPI) {
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in ACPI mode.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in ACPI mode.\n"));
} }
else { else {
...@@ -88,8 +86,7 @@ acpi_enable (void) ...@@ -88,8 +86,7 @@ acpi_enable (void)
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Returns the system to original ACPI/legacy mode, and * DESCRIPTION: Transfers the system into LEGACY mode.
* uninstalls the SCI interrupt handler.
* *
******************************************************************************/ ******************************************************************************/
...@@ -101,20 +98,26 @@ acpi_disable (void) ...@@ -101,20 +98,26 @@ acpi_disable (void)
ACPI_FUNCTION_TRACE ("Acpi_disable"); ACPI_FUNCTION_TRACE ("Acpi_disable");
if (!acpi_gbl_FADT) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No FADT information present!\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
if (acpi_hw_get_mode () != acpi_gbl_original_mode) { if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) {
/* Restore original mode */ ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in LEGACY mode.\n"));
}
else {
/* Transition to LEGACY mode */
status = acpi_hw_set_mode (ACPI_SYS_MODE_LEGACY);
status = acpi_hw_set_mode (acpi_gbl_original_mode);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not transition to LEGACY mode."));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
}
/* Unload the SCI interrupt handler */ ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to LEGACY mode successful\n"));
}
status = acpi_ev_remove_sci_handler ();
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exdump - Interpreter debug output routines * Module Name: exdump - Interpreter debug output routines
* $Revision: 157 $ * $Revision: 159 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* The following routines are used for debug output only * The following routines are used for debug output only
*/ */
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/***************************************************************************** /*****************************************************************************
* *
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exfldio - Aml Field I/O * Module Name: exfldio - Aml Field I/O
* $Revision: 87 $ * $Revision: 88 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 107 $ * $Revision: 108 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 141 $ * $Revision: 142 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 109 $ * $Revision: 110 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 118 $ * $Revision: 119 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exregion - ACPI default Op_region (address space) handlers * Module Name: exregion - ACPI default Op_region (address space) handlers
* $Revision: 79 $ * $Revision: 80 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 54 $ * $Revision: 55 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -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: 168 $ * $Revision: 169 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exutils - interpreter/scanner utilities * Module Name: exutils - interpreter/scanner utilities
* $Revision: 102 $ * $Revision: 103 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -261,7 +261,8 @@ acpi_ex_release_global_lock ( ...@@ -261,7 +261,8 @@ acpi_ex_release_global_lock (
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
/* Report the error, but there isn't much else we can do */ /* Report the error, but there isn't much else we can do */
ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n")); ACPI_REPORT_ERROR (("Could not release ACPI Global Lock, %s\n",
acpi_format_exception (status)));
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
* $Revision: 58 $ * $Revision: 60 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -96,6 +96,27 @@ acpi_hw_set_mode ( ...@@ -96,6 +96,27 @@ acpi_hw_set_mode (
ACPI_FUNCTION_TRACE ("Hw_set_mode"); ACPI_FUNCTION_TRACE ("Hw_set_mode");
/*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
* system does not support mode transition.
*/
if (!acpi_gbl_FADT->smi_cmd) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No SMI_CMD in FADT, mode transition failed.\n"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
/*
* ACPI 2.0 clarified the meaning of ACPI_ENABLE and ACPI_DISABLE
* in FADT: If it is zero, enabling or disabling is not supported.
* As old systems may have used zero for mode transition,
* we make sure both the numbers are zero to determine these
* transitions are not supported.
*/
if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No mode transition supported in this system.\n"));
return_ACPI_STATUS (AE_OK);
}
switch (mode) { switch (mode) {
case ACPI_SYS_MODE_ACPI: case ACPI_SYS_MODE_ACPI:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: hwgpe - Low level GPE enable/disable/clear functions * Module Name: hwgpe - Low level GPE enable/disable/clear functions
* $Revision: 41 $ * $Revision: 42 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Module Name: hwregs - Read/write access functions for the various ACPI * Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers. * control and status registers.
* $Revision: 133 $ * $Revision: 134 $
* *
******************************************************************************/ ******************************************************************************/
......
...@@ -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: 45 $ * $Revision: 46 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Name: acconfig.h - Global configuration constants * Name: acconfig.h - Global configuration constants
* $Revision: 107 $ * $Revision: 109 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
*****************************************************************************/ *****************************************************************************/
/* /*
* ACPI_DEBUG - This switch enables all the debug facilities of the * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
* ACPI subsystem. This includes the DEBUG_PRINT output * ACPI subsystem. This includes the DEBUG_PRINT output
* statements. When disabled, all DEBUG_PRINT * statements. When disabled, all DEBUG_PRINT
* statements are compiled out. * statements are compiled out.
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20020725 #define ACPI_CA_VERSION 0x20020815
/* Version of ACPI supported */ /* Version of ACPI supported */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acdisasm.h - AML disassembler * Name: acdisasm.h - AML disassembler
* $Revision: 2 $ * $Revision: 3 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Name: acglobal.h - Declarations for global variables * Name: acglobal.h - Declarations for global variables
* $Revision: 128 $ * $Revision: 130 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -152,8 +152,12 @@ extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINE ...@@ -152,8 +152,12 @@ extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINE
****************************************************************************/ ****************************************************************************/
#define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1 #define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1
#define NUM_PREDEFINED_NAMES 9
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
#define NUM_PREDEFINED_NAMES 10
#else
#define NUM_PREDEFINED_NAMES 9
#endif
ACPI_EXTERN acpi_namespace_node acpi_gbl_root_node_struct; ACPI_EXTERN acpi_namespace_node acpi_gbl_root_node_struct;
ACPI_EXTERN acpi_namespace_node *acpi_gbl_root_node; ACPI_EXTERN acpi_namespace_node *acpi_gbl_root_node;
...@@ -161,7 +165,7 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_root_node; ...@@ -161,7 +165,7 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_root_node;
extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES];
extern const acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; extern const acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES];
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
ACPI_EXTERN u32 acpi_gbl_current_node_count; ACPI_EXTERN u32 acpi_gbl_current_node_count;
ACPI_EXTERN u32 acpi_gbl_current_node_size; ACPI_EXTERN u32 acpi_gbl_current_node_size;
ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
...@@ -245,7 +249,7 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; ...@@ -245,7 +249,7 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
#endif #endif
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
extern u8 acpi_gbl_method_executing; extern u8 acpi_gbl_method_executing;
extern u8 acpi_gbl_db_terminate_threads; extern u8 acpi_gbl_db_terminate_threads;
...@@ -287,7 +291,7 @@ ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; ...@@ -287,7 +291,7 @@ ACPI_EXTERN u32 acpi_gbl_size_of_method_trees;
ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; ACPI_EXTERN u32 acpi_gbl_size_of_node_entries;
ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
#endif /* ENABLE_DEBUGGER */ #endif /* ACPI_DEBUGGER */
#endif /* __ACGLOBAL_H__ */ #endif /* __ACGLOBAL_H__ */
/****************************************************************************** /******************************************************************************
* *
* Name: aclocal.h - Internal data types used across the ACPI subsystem * Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 173 $ * $Revision: 175 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -73,7 +73,7 @@ typedef u32 ACPI_MUTEX_HANDLE; ...@@ -73,7 +73,7 @@ typedef u32 ACPI_MUTEX_HANDLE;
#define NUM_MTX MAX_MTX+1 #define NUM_MTX MAX_MTX+1
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
#ifdef DEFINE_ACPI_GLOBALS #ifdef DEFINE_ACPI_GLOBALS
/* Names for the mutexes used in the subsystem */ /* Names for the mutexes used in the subsystem */
...@@ -567,7 +567,7 @@ acpi_status (*ACPI_EXECUTE_OP) ( ...@@ -567,7 +567,7 @@ acpi_status (*ACPI_EXECUTE_OP) (
*/ */
typedef struct acpi_opcode_info typedef struct acpi_opcode_info
{ {
#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG) #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
NATIVE_CHAR *name; /* Opcode name (disassembler/debug only) */ NATIVE_CHAR *name; /* Opcode name (disassembler/debug only) */
#endif #endif
u32 parse_args; /* Grammar/Parse time arguments */ u32 parse_args; /* Grammar/Parse time arguments */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acmacros.h - C macros for the entire subsystem. * Name: acmacros.h - C macros for the entire subsystem.
* $Revision: 126 $ * $Revision: 128 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
/* /*
* Macros for the master AML opcode table * Macros for the master AML opcode table
*/ */
#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG) #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,Pargs,Iargs,flags,obj_type,class,type} #define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,Pargs,Iargs,flags,obj_type,class,type}
#else #else
#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {Pargs,Iargs,flags,obj_type,class,type} #define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {Pargs,Iargs,flags,obj_type,class,type}
...@@ -353,11 +353,11 @@ ...@@ -353,11 +353,11 @@
/* /*
* Error reporting. These versions add callers module and line#. Since * Error reporting. These versions add callers module and line#. Since
* _THIS_MODULE gets compiled out when ACPI_DEBUG isn't defined, only * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only
* use it in debug mode. * use it in debug mode.
*/ */
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
acpi_os_printf ACPI_PARAM_LIST(fp);} acpi_os_printf ACPI_PARAM_LIST(fp);}
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
* Debug macros that are conditionally compiled * Debug macros that are conditionally compiled
*/ */
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
#define ACPI_MODULE_NAME(name) static char *_THIS_MODULE = name; #define ACPI_MODULE_NAME(name) static char *_THIS_MODULE = name;
...@@ -525,9 +525,9 @@ ...@@ -525,9 +525,9 @@
/* /*
* Some code only gets executed when the debugger is built in. * Some code only gets executed when the debugger is built in.
* Note that this is entirely independent of whether the * Note that this is entirely independent of whether the
* DEBUG_PRINT stuff (set by ACPI_DEBUG) is on, or not. * DEBUG_PRINT stuff (set by ACPI_DEBUG_OUTPUT) is on, or not.
*/ */
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
#define ACPI_DEBUGGER_EXEC(a) a #define ACPI_DEBUGGER_EXEC(a) a
#else #else
#define ACPI_DEBUGGER_EXEC(a) #define ACPI_DEBUGGER_EXEC(a)
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
/* /*
* For 16-bit code, we want to shrink some things even though * For 16-bit code, we want to shrink some things even though
* we are using ACPI_DEBUG to get the debug output * we are using ACPI_DEBUG_OUTPUT to get the debug output
*/ */
#if ACPI_MACHINE_WIDTH == 16 #if ACPI_MACHINE_WIDTH == 16
#undef ACPI_DEBUG_ONLY_MEMBERS #undef ACPI_DEBUG_ONLY_MEMBERS
...@@ -545,7 +545,7 @@ ...@@ -545,7 +545,7 @@
#endif #endif
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
/* /*
* 1) Set name to blanks * 1) Set name to blanks
* 2) Copy the object name * 2) Copy the object name
......
...@@ -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: 112 $ * $Revision: 113 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Name: acoutput.h -- debug output * Name: acoutput.h -- debug output
* $Revision: 87 $ * $Revision: 90 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -43,18 +43,20 @@ ...@@ -43,18 +43,20 @@
#define ACPI_DISPATCHER 0x00000040 #define ACPI_DISPATCHER 0x00000040
#define ACPI_EXECUTER 0x00000080 #define ACPI_EXECUTER 0x00000080
#define ACPI_RESOURCES 0x00000100 #define ACPI_RESOURCES 0x00000100
#define ACPI_DEBUGGER 0x00000200 #define ACPI_CA_DEBUGGER 0x00000200
#define ACPI_OS_SERVICES 0x00000400 #define ACPI_OS_SERVICES 0x00000400
#define ACPI_CA_DISASSEMBLER 0x00000800
#define ACPI_ALL_COMPONENTS 0x00000FFF
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
/* Component IDs for ACPI tools and utilities */ /* Component IDs for ACPI tools and utilities */
#define ACPI_COMPILER 0x00001000 #define ACPI_COMPILER 0x00001000
#define ACPI_TOOLS 0x00002000 #define ACPI_TOOLS 0x00002000
#define ACPI_ALL_COMPONENTS 0x00003FFF
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
/* Component IDs reserved for ACPI drivers */ /* Component IDs reserved for ACPI drivers */
#define ACPI_ALL_DRIVERS 0xFFFF0000 #define ACPI_ALL_DRIVERS 0xFFFF0000
...@@ -94,7 +96,8 @@ ...@@ -94,7 +96,8 @@
#define ACPI_LV_ALLOCATIONS 0x00100000 #define ACPI_LV_ALLOCATIONS 0x00100000
#define ACPI_LV_FUNCTIONS 0x00200000 #define ACPI_LV_FUNCTIONS 0x00200000
#define ACPI_LV_VERBOSITY2 0x00300000 | ACPI_LV_VERBOSITY1 #define ACPI_LV_OPTIMIZATIONS 0x00400000
#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1
#define ACPI_LV_ALL ACPI_LV_VERBOSITY2 #define ACPI_LV_ALL ACPI_LV_VERBOSITY2
/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */ /* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
...@@ -144,6 +147,7 @@ ...@@ -144,6 +147,7 @@
#define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD) #define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD)
#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES) #define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS) #define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES) #define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS) #define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS) #define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
* $Revision: 60 $ * $Revision: 61 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -86,7 +86,7 @@ acpi_ps_get_next_simple_arg ( ...@@ -86,7 +86,7 @@ acpi_ps_get_next_simple_arg (
u32 arg_type, u32 arg_type,
acpi_parse_object *arg); acpi_parse_object *arg);
void acpi_status
acpi_ps_get_next_namepath ( acpi_ps_get_next_namepath (
acpi_parse_state *parser_state, acpi_parse_state *parser_state,
acpi_parse_object *arg, acpi_parse_object *arg,
...@@ -97,11 +97,12 @@ acpi_parse_object * ...@@ -97,11 +97,12 @@ acpi_parse_object *
acpi_ps_get_next_field ( acpi_ps_get_next_field (
acpi_parse_state *parser_state); acpi_parse_state *parser_state);
acpi_parse_object * acpi_status
acpi_ps_get_next_arg ( acpi_ps_get_next_arg (
acpi_parse_state *parser_state, acpi_parse_state *parser_state,
u32 arg_type, u32 arg_type,
u32 *arg_count); u32 *arg_count,
acpi_parse_object **return_arg);
/* psfind */ /* psfind */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acresrc.h - Resource Manager function prototypes * Name: acresrc.h - Resource Manager function prototypes
* $Revision: 33 $ * $Revision: 34 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -139,8 +139,8 @@ typedef struct ...@@ -139,8 +139,8 @@ typedef struct
u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
u16 flush_size; /* Number of flush strides that need to be read */ u16 flush_size; /* Number of flush strides that need to be read */
u16 flush_stride; /* Processor's memory cache line width, in bytes */ u16 flush_stride; /* Processor's memory cache line width, in bytes */
u8 duty_offset; /* Processor_s duty cycle index in processor's P_CNT reg*/ u8 duty_offset; /* Processors duty cycle index in processor's P_CNT reg*/
u8 duty_width; /* Processor_s duty cycle value bit width in P_CNT register.*/ u8 duty_width; /* Processors duty cycle value bit width in P_CNT register.*/
u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* Index to century in RTC CMOS RAM */ u8 century; /* Index to century in RTC CMOS RAM */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 142 $ * $Revision: 143 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -94,7 +94,7 @@ acpi_ut_validate_fadt ( ...@@ -94,7 +94,7 @@ acpi_ut_validate_fadt (
* Ut_global - Global data structures and procedures * Ut_global - Global data structures and procedures
*/ */
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
NATIVE_CHAR * NATIVE_CHAR *
acpi_ut_get_mutex_name ( acpi_ut_get_mutex_name (
...@@ -686,7 +686,7 @@ void ...@@ -686,7 +686,7 @@ void
acpi_ut_set_integer_width ( acpi_ut_set_integer_width (
u8 revision); u8 revision);
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
void void
acpi_ut_display_init_pathname ( acpi_ut_display_init_pathname (
acpi_handle obj_handle, acpi_handle obj_handle,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Name: amlcode.h - Definitions for AML, as included in "definition blocks" * Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived * Declarations and definitions contained herein are derived
* directly from the ACPI specification. * directly from the ACPI specification.
* $Revision: 69 $ * $Revision: 70 $
* *
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: amlresrc.h - AML resource descriptors * Module Name: amlresrc.h - AML resource descriptors
* $Revision: 20 $ * $Revision: 22 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -328,172 +328,5 @@ typedef union asl_resource_desc ...@@ -328,172 +328,5 @@ typedef union asl_resource_desc
} ASL_RESOURCE_DESC; } ASL_RESOURCE_DESC;
#define NEXT_RESOURCE_DESC(a,b) (ASL_RESOURCE_DESC *) (((char *) (a)) + sizeof(b))
#define DEFAULT_RESOURCE_DESC_SIZE (sizeof (ASL_RESOURCE_DESC) + sizeof (ASL_END_TAG_DESC))
/*
* Resource utilities
*/
ASL_RESOURCE_NODE *
rs_allocate_resource_node (
u32 size);
void
rs_create_bit_field (
acpi_parse_object *op,
char *name,
u32 byte_offset,
u32 bit_offset);
void
rs_create_byte_field (
acpi_parse_object *op,
char *name,
u32 byte_offset);
void
rs_set_flag_bits (
u8 *flags,
acpi_parse_object *op,
u8 position,
u8 default);
acpi_parse_object *
rs_complete_node_and_get_next (
acpi_parse_object *op);
ASL_RESOURCE_NODE *
rs_do_one_resource_descriptor (
acpi_parse_object *descriptor_type_op,
u32 current_byte_offset);
u32
rs_link_descriptor_chain (
ASL_RESOURCE_NODE **previous_rnode,
ASL_RESOURCE_NODE *rnode);
/*
* Small descriptors
*/
ASL_RESOURCE_NODE *
rs_do_dma_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_end_dependent_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_fixed_io_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_interrupt_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_io_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_irq_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_irq_no_flags_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_memory24_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_memory32_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_memory32_fixed_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_start_dependent_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_start_dependent_no_pri_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_vendor_small_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
/*
* Large descriptors
*/
u32
rs_get_string_data_length (
acpi_parse_object *initializer_op);
ASL_RESOURCE_NODE *
rs_do_dword_io_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_dword_memory_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_qword_io_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_qword_memory_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_word_io_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_word_bus_number_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_vendor_large_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
ASL_RESOURCE_NODE *
rs_do_general_register_descriptor (
acpi_parse_object *op,
u32 current_byte_offset);
#endif #endif
/****************************************************************************** /******************************************************************************
* *
* Name: acenv.h - Generation environment specific items * Name: acenv.h - Generation environment specific items
* $Revision: 99 $ * $Revision: 101 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#ifdef _ACPI_DUMP_APP #ifdef _ACPI_DUMP_APP
#ifndef MSDOS #ifndef MSDOS
#define ACPI_DEBUG #define ACPI_DEBUG_OUTPUT
#endif #endif
#define ACPI_APPLICATION #define ACPI_APPLICATION
#define ACPI_DISASSEMBLER #define ACPI_DISASSEMBLER
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
#ifdef _ACPI_EXEC_APP #ifdef _ACPI_EXEC_APP
#undef DEBUGGER_THREADING #undef DEBUGGER_THREADING
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
#define ACPI_DEBUG #define ACPI_DEBUG_OUTPUT
#define ACPI_APPLICATION #define ACPI_APPLICATION
#define ENABLE_DEBUGGER #define ACPI_DEBUGGER
#define ACPI_DISASSEMBLER #define ACPI_DISASSEMBLER
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
#endif #endif
#ifdef _ACPI_ASL_COMPILER #ifdef _ACPI_ASL_COMPILER
#define ACPI_DEBUG #define ACPI_DEBUG_OUTPUT
#define ACPI_APPLICATION #define ACPI_APPLICATION
#define ACPI_DISASSEMBLER #define ACPI_DISASSEMBLER
#define ACPI_CONSTANT_EVAL_ONLY #define ACPI_CONSTANT_EVAL_ONLY
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
* 1) This is the debug version * 1) This is the debug version
* 2) This is NOT a 16-bit version of the code (not enough real-mode memory) * 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
*/ */
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
#if ACPI_MACHINE_WIDTH != 16 #if ACPI_MACHINE_WIDTH != 16
#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_DBG_TRACK_ALLOCATIONS
#endif #endif
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
* $Revision: 156 $ * $Revision: 161 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -117,6 +117,19 @@ acpi_ns_root_initialize (void) ...@@ -117,6 +117,19 @@ acpi_ns_root_initialize (void)
* used for initial values are implemented here. * used for initial values are implemented here.
*/ */
switch (init_val->type) { switch (init_val->type) {
case ACPI_TYPE_METHOD:
obj_desc->method.param_count =
(u8) ACPI_STRTOUL (init_val->val, NULL, 10);
obj_desc->common.flags |= AOPOBJ_DATA_VALID;
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
/* Compiler cheats by putting parameter count in the Owner_iD */
new_node->owner_id = obj_desc->method.param_count;
#endif
break;
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
obj_desc->integer.value = obj_desc->integer.value =
...@@ -228,6 +241,7 @@ acpi_ns_lookup ( ...@@ -228,6 +241,7 @@ acpi_ns_lookup (
acpi_namespace_node **return_node) acpi_namespace_node **return_node)
{ {
acpi_status status; acpi_status status;
NATIVE_CHAR *path = pathname;
acpi_namespace_node *prefix_node; acpi_namespace_node *prefix_node;
acpi_namespace_node *current_node = NULL; acpi_namespace_node *current_node = NULL;
acpi_namespace_node *this_node = NULL; acpi_namespace_node *this_node = NULL;
...@@ -235,7 +249,9 @@ acpi_ns_lookup ( ...@@ -235,7 +249,9 @@ acpi_ns_lookup (
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;
u32 local_flags = flags & ~ACPI_NS_ERROR_IF_FOUND; u32 search_parent_flag = ACPI_NS_SEARCH_PARENT;
u32 local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND |
ACPI_NS_SEARCH_PARENT);
ACPI_FUNCTION_TRACE ("Ns_lookup"); ACPI_FUNCTION_TRACE ("Ns_lookup");
...@@ -266,6 +282,21 @@ acpi_ns_lookup ( ...@@ -266,6 +282,21 @@ acpi_ns_lookup (
} }
else { else {
prefix_node = scope_info->scope.node; prefix_node = scope_info->scope.node;
if (ACPI_GET_DESCRIPTOR_TYPE (prefix_node) != ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%p] Not a namespace node\n",
prefix_node));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/*
* This node might not be a actual "scope" node (such as a
* Device/Method, etc.) It could be a Package or other object node.
* Backup up the tree to find the containing scope node.
*/
while (!acpi_ns_opens_scope (prefix_node->type) &&
prefix_node->type != ACPI_TYPE_ANY) {
prefix_node = acpi_ns_get_parent_node (prefix_node);
}
} }
/* /*
...@@ -297,7 +328,7 @@ acpi_ns_lookup ( ...@@ -297,7 +328,7 @@ acpi_ns_lookup (
num_segments = 0; num_segments = 0;
this_node = acpi_gbl_root_node; this_node = acpi_gbl_root_node;
pathname = ""; path = "";
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Null Pathname (Zero segments), Flags=%X\n", flags)); "Null Pathname (Zero segments), Flags=%X\n", flags));
...@@ -316,23 +347,24 @@ acpi_ns_lookup ( ...@@ -316,23 +347,24 @@ acpi_ns_lookup (
* Parent Prefixes (in which case the name's scope is relative * Parent Prefixes (in which case the name's scope is relative
* to the current scope). * to the current scope).
*/ */
if (*pathname == (u8) AML_ROOT_PREFIX) { if (*path == (u8) AML_ROOT_PREFIX) {
/* Pathname is fully qualified, start from the root */ /* Pathname is fully qualified, start from the root */
this_node = acpi_gbl_root_node; this_node = acpi_gbl_root_node;
search_parent_flag = ACPI_NS_NO_UPSEARCH;
/* Point to name segment part */ /* Point to name segment part */
pathname++; path++;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching from root [%p]\n", ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
this_node)); "Path is absolute from root [%p]\n", this_node));
} }
else { else {
/* 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 pfx scope [%p]\n", "Searching relative to prefix scope [%p]\n",
prefix_node)); prefix_node));
/* /*
...@@ -340,12 +372,15 @@ acpi_ns_lookup ( ...@@ -340,12 +372,15 @@ acpi_ns_lookup (
* the parent node for each prefix instance. * the parent node for each prefix instance.
*/ */
this_node = prefix_node; this_node = prefix_node;
while (*pathname == (u8) AML_PARENT_PREFIX) { while (*path == (u8) AML_PARENT_PREFIX) {
/* Name is fully qualified, no search rules apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH;
/* /*
* Point past this prefix to the name segment * Point past this prefix to the name segment
* part or the next Parent Prefix * part or the next Parent Prefix
*/ */
pathname++; path++;
/* Backup to the parent node */ /* Backup to the parent node */
...@@ -358,6 +393,11 @@ acpi_ns_lookup ( ...@@ -358,6 +393,11 @@ acpi_ns_lookup (
return_ACPI_STATUS (AE_NOT_FOUND); return_ACPI_STATUS (AE_NOT_FOUND);
} }
} }
if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Path is absolute with one or more carats\n"));
}
} }
/* /*
...@@ -373,7 +413,7 @@ acpi_ns_lookup ( ...@@ -373,7 +413,7 @@ acpi_ns_lookup (
* Examine the name prefix opcode, if any, to determine the number of * Examine the name prefix opcode, if any, to determine the number of
* segments. * segments.
*/ */
switch (*pathname) { switch (*path) {
case 0: case 0:
/* /*
* Null name after a root or parent prefixes. We already * Null name after a root or parent prefixes. We already
...@@ -387,10 +427,14 @@ acpi_ns_lookup ( ...@@ -387,10 +427,14 @@ acpi_ns_lookup (
case AML_DUAL_NAME_PREFIX: case AML_DUAL_NAME_PREFIX:
/* More than one Name_seg, search rules do not apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH;
/* Two segments, point to first name segment */ /* Two segments, point to first name segment */
num_segments = 2; num_segments = 2;
pathname++; path++;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Dual Pathname (2 segments, Flags=%X)\n", flags)); "Dual Pathname (2 segments, Flags=%X)\n", flags));
...@@ -398,11 +442,15 @@ acpi_ns_lookup ( ...@@ -398,11 +442,15 @@ acpi_ns_lookup (
case AML_MULTI_NAME_PREFIX_OP: case AML_MULTI_NAME_PREFIX_OP:
/* More than one Name_seg, search rules do not apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH;
/* Extract segment count, point to first name segment */ /* Extract segment count, point to first name segment */
pathname++; path++;
num_segments = (u32) (u8) *pathname; num_segments = (u32) (u8) *path;
pathname++; path++;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Multi Pathname (%d Segments, Flags=%X) \n", "Multi Pathname (%d Segments, Flags=%X) \n",
...@@ -421,33 +469,49 @@ acpi_ns_lookup ( ...@@ -421,33 +469,49 @@ acpi_ns_lookup (
break; break;
} }
ACPI_DEBUG_EXEC (acpi_ns_print_pathname (num_segments, pathname)); ACPI_DEBUG_EXEC (acpi_ns_print_pathname (num_segments, path));
} }
/* /*
* Search namespace for each segment of the name. Loop through and * Search namespace for each segment of the name. Loop through and
* verify/add each name segment. * verify (or add to the namespace) each name segment.
*
* The object type is significant only at the last name
* segment. (We don't care about the types along the path, only
* the type of the final target object.)
*/ */
this_search_type = ACPI_TYPE_ANY;
current_node = this_node; current_node = this_node;
while (num_segments && current_node) { while (num_segments && current_node) {
/*
* Search for the current name segment under the current
* named object. The Type is significant only at the last name
* segment. (We don't care about the types along the path, only
* the type of the final target object.)
*/
this_search_type = ACPI_TYPE_ANY;
num_segments--; num_segments--;
if (!num_segments) { if (!num_segments) {
/*
* This is the last segment, enable typechecking
*/
this_search_type = type; this_search_type = type;
local_flags = flags;
/*
* Only allow automatic parent search (search rules) if the caller
* requested it AND we have a single, non-fully-qualified Name_seg
*/
if ((search_parent_flag != ACPI_NS_NO_UPSEARCH) &&
(flags & ACPI_NS_SEARCH_PARENT)) {
local_flags |= ACPI_NS_SEARCH_PARENT;
}
/* Set error flag according to caller */
if (flags & ACPI_NS_ERROR_IF_FOUND) {
local_flags |= ACPI_NS_ERROR_IF_FOUND;
}
} }
/* Extract one ACPI name from the front of the pathname */ /* Extract one ACPI name from the front of the pathname */
ACPI_MOVE_UNALIGNED32_TO_32 (&simple_name, pathname); ACPI_MOVE_UNALIGNED32_TO_32 (&simple_name, path);
/* Try to find the ACPI name */ /* Try to find the single (4 character) ACPI name */
status = acpi_ns_search_and_enter (simple_name, walk_state, current_node, status = acpi_ns_search_and_enter (simple_name, walk_state, current_node,
interpreter_mode, this_search_type, local_flags, &this_node); interpreter_mode, this_search_type, local_flags, &this_node);
...@@ -457,7 +521,8 @@ acpi_ns_lookup ( ...@@ -457,7 +521,8 @@ acpi_ns_lookup (
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Name [%4.4s] not found in scope [%4.4s] %p\n", "Name [%4.4s] not found in scope [%4.4s] %p\n",
(char *) &simple_name, (char *) &current_node->name, current_node)); (char *) &simple_name, (char *) &current_node->name,
current_node));
} }
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -504,7 +569,7 @@ acpi_ns_lookup ( ...@@ -504,7 +569,7 @@ acpi_ns_lookup (
/* Point to next name segment and make this node current */ /* Point to next name segment and make this node current */
pathname += ACPI_NAME_SIZE; path += ACPI_NAME_SIZE;
current_node = this_node; current_node = this_node;
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 137 $ * $Revision: 139 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define _COMPONENT ACPI_NAMESPACE #define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsdump") ACPI_MODULE_NAME ("nsdump")
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/******************************************************************************* /*******************************************************************************
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 1 $ * $Revision: 3 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
ACPI_MODULE_NAME ("nsdumpdv") ACPI_MODULE_NAME ("nsdumpdv")
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/******************************************************************************* /*******************************************************************************
* *
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: nseval - Object evaluation interfaces -- includes control * Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution. * method lookup and execution.
* $Revision: 117 $ * $Revision: 118 $
* *
******************************************************************************/ ******************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsinit - namespace initialization * Module Name: nsinit - namespace initialization
* $Revision: 47 $ * $Revision: 49 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -369,7 +369,7 @@ acpi_ns_init_one_device ( ...@@ -369,7 +369,7 @@ acpi_ns_init_one_device (
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND) {
/* Ignore error and move on to next device */ /* Ignore error and move on to next device */
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
NATIVE_CHAR *scope_name = acpi_ns_get_external_pathname (obj_handle); NATIVE_CHAR *scope_name = acpi_ns_get_external_pathname (obj_handle);
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n",
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsload - namespace loading/expanding/contracting procedures * Module Name: nsload - namespace loading/expanding/contracting procedures
* $Revision: 57 $ * $Revision: 58 $
* *
*****************************************************************************/ *****************************************************************************/
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: nsnames - Name manipulation and search * Module Name: nsnames - Name manipulation and search
* $Revision: 78 $ * $Revision: 79 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -103,7 +103,7 @@ acpi_ns_build_external_path ( ...@@ -103,7 +103,7 @@ acpi_ns_build_external_path (
} }
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ns_get_external_pathname * FUNCTION: Acpi_ns_get_external_pathname
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: nssearch - Namespace search * Module Name: nssearch - Namespace search
* $Revision: 86 $ * $Revision: 89 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -71,7 +71,7 @@ acpi_ns_search_node ( ...@@ -71,7 +71,7 @@ acpi_ns_search_node (
ACPI_FUNCTION_TRACE ("Ns_search_node"); ACPI_FUNCTION_TRACE ("Ns_search_node");
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
if (ACPI_LV_NAMES & acpi_dbg_level) { if (ACPI_LV_NAMES & acpi_dbg_level) {
NATIVE_CHAR *scope_name; NATIVE_CHAR *scope_name;
...@@ -290,10 +290,10 @@ acpi_ns_search_and_enter ( ...@@ -290,10 +290,10 @@ acpi_ns_search_and_enter (
/* Parameter validation */ /* Parameter validation */
if (!node || !target_name || !return_node) { if (!node || !target_name || !return_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %X Return %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param: Node %p Name %X Return_node %p\n",
node, target_name, return_node)); node, target_name, return_node));
ACPI_REPORT_ERROR (("Ns_search_and_enter: bad (null) parameter\n")); ACPI_REPORT_ERROR (("Ns_search_and_enter: Null parameter\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
......
...@@ -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: 110 $ * $Revision: 112 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -434,9 +434,12 @@ acpi_ns_externalize_name ( ...@@ -434,9 +434,12 @@ acpi_ns_externalize_name (
case '^': case '^':
for (i = 0; i < internal_name_length; i++) { for (i = 0; i < internal_name_length; i++) {
if (internal_name[i] != '^') { if (internal_name[i] == '^') {
prefix_length = i + 1; prefix_length = i + 1;
} }
else {
break;
}
} }
if (i == internal_name_length) { if (i == internal_name_length) {
...@@ -834,7 +837,7 @@ acpi_ns_find_parent_name ( ...@@ -834,7 +837,7 @@ acpi_ns_find_parent_name (
} }
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/******************************************************************************* /*******************************************************************************
* *
...@@ -868,7 +871,7 @@ acpi_ns_exist_downstream_sibling ( ...@@ -868,7 +871,7 @@ acpi_ns_exist_downstream_sibling (
return (FALSE); return (FALSE);
} }
#endif /* ACPI_DEBUG */ #endif /* ACPI_DEBUG_OUTPUT */
/******************************************************************************* /*******************************************************************************
......
...@@ -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: 1 $ * $Revision: 2 $
* *
******************************************************************************/ ******************************************************************************/
......
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: psopcode - Parser/Interpreter opcode information table * Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 71 $ * $Revision: 72 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -558,17 +558,17 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = ...@@ -558,17 +558,17 @@ const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_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, INTERNAL_TYPE_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),
/* 67 */ ACPI_OP ("[NamedField]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), /* 67 */ ACPI_OP ("-NamedField-", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
/* 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, INTERNAL_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),
/* ACPI 2.0 opcodes */ /* ACPI 2.0 opcodes */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psparse - Parser top level AML parse routines * Module Name: psparse - Parser top level AML parse routines
* $Revision: 129 $ * $Revision: 133 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -111,58 +111,6 @@ acpi_ps_peek_opcode ( ...@@ -111,58 +111,6 @@ acpi_ps_peek_opcode (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ps_find_object
*
* PARAMETERS: Opcode - Current opcode
* Parser_state - Current state
* Walk_state - Current state
* *Op - Where found/new op is returned
*
* RETURN: Status
*
* DESCRIPTION: Find a named object. Two versions - one to search the parse
* tree (for parser-only applications such as acpidump), another
* to search the ACPI internal namespace (the parse tree may no
* longer exist)
*
******************************************************************************/
#ifdef PARSER_ONLY
acpi_status
acpi_ps_find_object (
acpi_walk_state *walk_state,
acpi_parse_object **out_op)
{
NATIVE_CHAR *path;
/* We are only interested in opcodes that have an associated name */
if (!(walk_state->op_info->flags & AML_NAMED)) {
*out_op = walk_state->op;
return (AE_OK);
}
/* Find the name in the parse tree */
path = acpi_ps_get_next_namestring (&walk_state->parser_state);
*out_op = acpi_ps_find (acpi_ps_get_parent_scope (&walk_state->parser_state),
path, walk_state->opcode, 1);
if (!(*out_op)) {
return (AE_NOT_FOUND);
}
return (AE_OK);
}
#endif
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ps_complete_this_op * FUNCTION: Acpi_ps_complete_this_op
...@@ -181,7 +129,6 @@ acpi_ps_complete_this_op ( ...@@ -181,7 +129,6 @@ acpi_ps_complete_this_op (
acpi_walk_state *walk_state, acpi_walk_state *walk_state,
acpi_parse_object *op) acpi_parse_object *op)
{ {
#ifndef PARSER_ONLY
acpi_parse_object *prev; acpi_parse_object *prev;
acpi_parse_object *next; acpi_parse_object *next;
const acpi_opcode_info *parent_info; const acpi_opcode_info *parent_info;
...@@ -317,10 +264,6 @@ acpi_ps_complete_this_op ( ...@@ -317,10 +264,6 @@ acpi_ps_complete_this_op (
} }
return_VOID; return_VOID;
#else
return;
#endif
} }
...@@ -381,6 +324,13 @@ acpi_ps_next_parse_state ( ...@@ -381,6 +324,13 @@ acpi_ps_next_parse_state (
parser_state->aml = walk_state->aml_last_while; parser_state->aml = walk_state->aml_last_while;
break; break;
#if 0
case AE_CTRL_SKIP:
parser_state->aml = parser_state->scope->parse_scope.pkg_end;
status = AE_OK;
break;
#endif
case AE_CTRL_TRUE: case AE_CTRL_TRUE:
...@@ -585,14 +535,25 @@ acpi_ps_parse_loop ( ...@@ -585,14 +535,25 @@ acpi_ps_parse_loop (
* Get and append arguments until we find the node that contains * Get and append arguments until we find the node that contains
* the name (the type ARGP_NAME). * the name (the type ARGP_NAME).
*/ */
while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) != ARGP_NAME) { while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) &&
arg = acpi_ps_get_next_arg (parser_state, (GET_CURRENT_ARG_TYPE (walk_state->arg_types) != ARGP_NAME)) {
status = acpi_ps_get_next_arg (parser_state,
GET_CURRENT_ARG_TYPE (walk_state->arg_types), GET_CURRENT_ARG_TYPE (walk_state->arg_types),
&walk_state->arg_count); &walk_state->arg_count, &arg);
if (ACPI_FAILURE (status)) {
goto close_this_op;
}
acpi_ps_append_arg (&pre_op, arg); acpi_ps_append_arg (&pre_op, arg);
INCREMENT_ARG_LIST (walk_state->arg_types); INCREMENT_ARG_LIST (walk_state->arg_types);
} }
/* Make sure that we found a NAME and didn't run out of arguments */
if (!GET_CURRENT_ARG_TYPE (walk_state->arg_types)) {
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
/* We know that this arg is a name, move to next arg */ /* We know that this arg is a name, move to next arg */
INCREMENT_ARG_LIST (walk_state->arg_types); INCREMENT_ARG_LIST (walk_state->arg_types);
...@@ -688,8 +649,8 @@ acpi_ps_parse_loop ( ...@@ -688,8 +649,8 @@ acpi_ps_parse_loop (
if (walk_state->op_info) { if (walk_state->op_info) {
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Opcode %4.4hX [%s] Op %p Aml %p Aml_offset %5.5X\n", "Opcode %4.4X [%s] Op %p Aml %p Aml_offset %5.5X\n",
op->common.aml_opcode, walk_state->op_info->name, (u32) op->common.aml_opcode, walk_state->op_info->name,
op, parser_state->aml, op->common.aml_offset)); op, parser_state->aml, op->common.aml_offset));
} }
} }
...@@ -717,7 +678,17 @@ acpi_ps_parse_loop ( ...@@ -717,7 +678,17 @@ acpi_ps_parse_loop (
case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */ case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
acpi_ps_get_next_namepath (parser_state, op, &walk_state->arg_count, 1); status = acpi_ps_get_next_namepath (parser_state, op, &walk_state->arg_count, 1);
if (ACPI_FAILURE (status)) {
/* NOT_FOUND is an error only if we are actually executing a method */
if ((((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) &&
(status == AE_NOT_FOUND)) ||
(status != AE_NOT_FOUND)) {
goto close_this_op;
}
}
walk_state->arg_types = 0; walk_state->arg_types = 0;
break; break;
...@@ -729,14 +700,24 @@ acpi_ps_parse_loop ( ...@@ -729,14 +700,24 @@ acpi_ps_parse_loop (
while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) { while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) {
walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml, walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml,
parser_state->aml_start); parser_state->aml_start);
arg = acpi_ps_get_next_arg (parser_state, status = acpi_ps_get_next_arg (parser_state,
GET_CURRENT_ARG_TYPE (walk_state->arg_types), GET_CURRENT_ARG_TYPE (walk_state->arg_types),
&walk_state->arg_count); &walk_state->arg_count, &arg);
if (ACPI_FAILURE (status)) {
/* NOT_FOUND is an error only if we are actually executing a method */
if ((((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) &&
(status == AE_NOT_FOUND) &&
(op->common.aml_opcode != AML_COND_REF_OF_OP)) ||
(status != AE_NOT_FOUND)) {
goto close_this_op;
}
}
if (arg) { if (arg) {
arg->common.aml_offset = walk_state->aml_offset; arg->common.aml_offset = walk_state->aml_offset;
acpi_ps_append_arg (op, arg); acpi_ps_append_arg (op, arg);
} }
INCREMENT_ARG_LIST (walk_state->arg_types); INCREMENT_ARG_LIST (walk_state->arg_types);
} }
...@@ -887,15 +868,17 @@ acpi_ps_parse_loop ( ...@@ -887,15 +868,17 @@ acpi_ps_parse_loop (
acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
walk_state->op = op; if (op) {
walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); walk_state->op = op;
walk_state->opcode = op->common.aml_opcode; walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
walk_state->opcode = op->common.aml_opcode;
status = walk_state->ascending_callback (walk_state); status = walk_state->ascending_callback (walk_state);
status = acpi_ps_next_parse_state (walk_state, op, status); status = acpi_ps_next_parse_state (walk_state, op, status);
acpi_ps_complete_this_op (walk_state, op); acpi_ps_complete_this_op (walk_state, op);
op = NULL; op = NULL;
}
status = AE_OK; status = AE_OK;
break; break;
...@@ -1053,6 +1036,7 @@ acpi_ps_parse_aml ( ...@@ -1053,6 +1036,7 @@ acpi_ps_parse_aml (
acpi_walk_state *walk_state) acpi_walk_state *walk_state)
{ {
acpi_status status; acpi_status status;
acpi_status terminate_status;
ACPI_THREAD_STATE *thread; ACPI_THREAD_STATE *thread;
ACPI_THREAD_STATE *prev_walk_list = acpi_gbl_current_walk_list; ACPI_THREAD_STATE *prev_walk_list = acpi_gbl_current_walk_list;
acpi_walk_state *previous_walk_state; acpi_walk_state *previous_walk_state;
...@@ -1131,10 +1115,9 @@ acpi_ps_parse_aml ( ...@@ -1131,10 +1115,9 @@ acpi_ps_parse_aml (
* there's lots of cleanup to do * there's lots of cleanup to do
*/ */
if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) { if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) {
status = acpi_ds_terminate_control_method (walk_state); terminate_status = acpi_ds_terminate_control_method (walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (terminate_status)) {
ACPI_REPORT_ERROR (("Could not terminate control method properly\n")); ACPI_REPORT_ERROR (("Could not terminate control method properly\n"));
status = AE_OK;
/* Ignore error and continue */ /* Ignore error and continue */
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: pstree - Parser op tree manipulation/traversal/search * Module Name: pstree - Parser op tree manipulation/traversal/search
* $Revision: 39 $ * $Revision: 40 $
* *
*****************************************************************************/ *****************************************************************************/
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rsdump - Functions to display the resource structures. * Module Name: rsdump - Functions to display the resource structures.
* $Revision: 32 $ * $Revision: 33 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
ACPI_MODULE_NAME ("rsdump") ACPI_MODULE_NAME ("rsdump")
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/******************************************************************************* /*******************************************************************************
* *
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbconvrt - ACPI Table conversion utilities * Module Name: tbconvrt - ACPI Table conversion utilities
* $Revision: 42 $ * $Revision: 43 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbget - ACPI Table get* routines * Module Name: tbget - ACPI Table get* routines
* $Revision: 78 $ * $Revision: 79 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbgetall - Get all required ACPI tables * Module Name: tbgetall - Get all required ACPI tables
* $Revision: 1 $ * $Revision: 2 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbinstal - ACPI table installation and removal * Module Name: tbinstal - ACPI table installation and removal
* $Revision: 62 $ * $Revision: 63 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbrsdt - ACPI RSDT table utilities * Module Name: tbrsdt - ACPI RSDT table utilities
* $Revision: 2 $ * $Revision: 3 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbutils - Table manipulation utilities * Module Name: tbutils - Table manipulation utilities
* $Revision: 55 $ * $Revision: 56 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -135,7 +135,7 @@ acpi_tb_validate_table_header ( ...@@ -135,7 +135,7 @@ acpi_tb_validate_table_header (
table_header, (char *) &signature)); table_header, (char *) &signature));
ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n", ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n",
table_header->length)); (u32) table_header->length));
ACPI_DUMP_BUFFER (table_header, sizeof (acpi_table_header)); ACPI_DUMP_BUFFER (table_header, sizeof (acpi_table_header));
return (AE_BAD_HEADER); return (AE_BAD_HEADER);
} }
...@@ -176,7 +176,7 @@ acpi_tb_verify_table_checksum ( ...@@ -176,7 +176,7 @@ acpi_tb_verify_table_checksum (
if (checksum) { if (checksum) {
ACPI_REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n", ACPI_REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n",
checksum, table_header->signature)); (u32) checksum, table_header->signature));
status = AE_BAD_CHECKSUM; status = AE_BAD_CHECKSUM;
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utdebug - Debug print routines * Module Name: utdebug - Debug print routines
* $Revision: 103 $ * $Revision: 104 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
ACPI_MODULE_NAME ("utdebug") ACPI_MODULE_NAME ("utdebug")
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF;
static char *acpi_gbl_fn_entry_str = "----Entry"; static char *acpi_gbl_fn_entry_str = "----Entry";
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: uteval - Object evaluation * Module Name: uteval - Object evaluation
* $Revision: 40 $ * $Revision: 41 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utglobal - Global variables for the ACPI subsystem * Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 165 $ * $Revision: 168 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -126,7 +126,7 @@ acpi_format_exception ( ...@@ -126,7 +126,7 @@ acpi_format_exception (
/* Debug switch - level and trace mask */ /* Debug switch - level and trace mask */
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
u32 acpi_dbg_level = DEBUG_DEFAULT; u32 acpi_dbg_level = DEBUG_DEFAULT;
#else #else
u32 acpi_dbg_level = NORMAL_DEFAULT; u32 acpi_dbg_level = NORMAL_DEFAULT;
...@@ -185,6 +185,10 @@ const acpi_predefined_names acpi_gbl_pre_defined_names[] = ...@@ -185,6 +185,10 @@ const acpi_predefined_names acpi_gbl_pre_defined_names[] =
{"_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"},
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, "1"},
#endif
{NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */
}; };
...@@ -522,7 +526,7 @@ acpi_ut_get_object_type_name ( ...@@ -522,7 +526,7 @@ acpi_ut_get_object_type_name (
} }
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/* /*
* Strings and procedures used for debug only * Strings and procedures used for debug only
...@@ -773,7 +777,7 @@ acpi_ut_init_globals ( ...@@ -773,7 +777,7 @@ acpi_ut_init_globals (
acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST; acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST;
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX; acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX;
#endif #endif
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utinit - Common ACPI subsystem initialization * Module Name: utinit - Common ACPI subsystem initialization
* $Revision: 112 $ * $Revision: 113 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -198,14 +198,14 @@ acpi_ut_subsystem_shutdown (void) ...@@ -198,14 +198,14 @@ acpi_ut_subsystem_shutdown (void)
acpi_gbl_shutdown = TRUE; acpi_gbl_shutdown = TRUE;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n"));
/* Close the Namespace */
acpi_ns_terminate ();
/* Close the Acpi_event Handling */ /* Close the Acpi_event Handling */
acpi_ev_terminate (); acpi_ev_terminate ();
/* Close the Namespace */
acpi_ns_terminate ();
/* Close the globals */ /* Close the globals */
acpi_ut_terminate (); acpi_ut_terminate ();
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: utmisc - common utility procedures * Module Name: utmisc - common utility procedures
* $Revision: 78 $ * $Revision: 80 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -104,7 +104,7 @@ acpi_ut_set_integer_width ( ...@@ -104,7 +104,7 @@ acpi_ut_set_integer_width (
} }
#ifdef ACPI_DEBUG #ifdef ACPI_DEBUG_OUTPUT
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ut_display_init_pathname * FUNCTION: Acpi_ut_display_init_pathname
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utxface - External interfaces for "global" ACPI functions * Module Name: utxface - External interfaces for "global" ACPI functions
* $Revision: 97 $ * $Revision: 100 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -159,6 +159,8 @@ acpi_enable_subsystem ( ...@@ -159,6 +159,8 @@ acpi_enable_subsystem (
if (!(flags & ACPI_NO_ACPI_ENABLE)) { if (!(flags & ACPI_NO_ACPI_ENABLE)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n")); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
acpi_gbl_original_mode = acpi_hw_get_mode();
status = acpi_enable (); status = acpi_enable ();
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_enable failed.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_enable failed.\n"));
...@@ -291,7 +293,7 @@ acpi_terminate (void) ...@@ -291,7 +293,7 @@ acpi_terminate (void)
acpi_ut_mutex_terminate (); acpi_ut_mutex_terminate ();
#ifdef ENABLE_DEBUGGER #ifdef ACPI_DEBUGGER
/* Shut down the debugger */ /* Shut down the debugger */
......
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