Commit 6050790e authored by Andy Grover's avatar Andy Grover

Interpreter update

parent fe65ee28
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbcmds - debug commands and output routines * Module Name: dbcmds - debug commands and output routines
* $Revision: 84 $ * $Revision: 85 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "acevents.h" #include "acevents.h"
#include "acdebug.h" #include "acdebug.h"
#include "acresrc.h" #include "acresrc.h"
#include "acdisasm.h"
#ifdef ENABLE_DEBUGGER #ifdef ENABLE_DEBUGGER
...@@ -342,7 +343,7 @@ acpi_db_disassemble_aml ( ...@@ -342,7 +343,7 @@ acpi_db_disassemble_aml (
num_statements = ACPI_STRTOUL (statements, NULL, 0); num_statements = ACPI_STRTOUL (statements, NULL, 0);
} }
acpi_db_display_op (NULL, op, num_statements); acpi_dm_disassemble (NULL, op, num_statements);
} }
......
...@@ -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: 64 $ * $Revision: 67 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "acnamesp.h" #include "acnamesp.h"
#include "actables.h" #include "actables.h"
#ifdef ENABLE_DEBUGGER #if (defined ENABLE_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_DEBUGGER #define _COMPONENT ACPI_DEBUGGER
ACPI_MODULE_NAME ("dbfileio") ACPI_MODULE_NAME ("dbfileio")
...@@ -86,6 +86,7 @@ acpi_db_match_argument ( ...@@ -86,6 +86,7 @@ acpi_db_match_argument (
} }
#ifdef ENABLE_DEBUGGER
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_db_close_debug_file * FUNCTION: Acpi_db_close_debug_file
...@@ -148,6 +149,7 @@ acpi_db_open_debug_file ( ...@@ -148,6 +149,7 @@ acpi_db_open_debug_file (
#endif #endif
} }
#endif
#ifdef ACPI_APPLICATION #ifdef ACPI_APPLICATION
...@@ -190,7 +192,7 @@ acpi_db_load_table( ...@@ -190,7 +192,7 @@ acpi_db_load_table(
status = acpi_tb_validate_table_header (&table_header); status = acpi_tb_validate_table_header (&table_header);
if ((ACPI_FAILURE (status)) || if ((ACPI_FAILURE (status)) ||
(table_header.length > 524288)) /* 1/2 Mbyte should be enough */ { (table_header.length > 0x800000)) /* 8 Mbyte should be enough */ {
acpi_os_printf ("Table header is invalid!\n"); acpi_os_printf ("Table header is invalid!\n");
return (AE_ERROR); return (AE_ERROR);
} }
...@@ -296,7 +298,7 @@ ae_local_load_table ( ...@@ -296,7 +298,7 @@ ae_local_load_table (
} }
#ifndef PARSER_ONLY #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node); status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
/* Uninstall table and free the buffer */ /* Uninstall table and free the buffer */
...@@ -330,7 +332,7 @@ acpi_db_get_acpi_table ( ...@@ -330,7 +332,7 @@ acpi_db_get_acpi_table (
/* Get the entire file */ /* Get the entire file */
acpi_os_printf ("Loading Acpi table from file %s\n", filename); fprintf (stderr, "Loading Acpi table from file %s\n", filename);
status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length); status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length);
fclose(fp); fclose(fp);
...@@ -383,8 +385,8 @@ acpi_db_load_acpi_table ( ...@@ -383,8 +385,8 @@ acpi_db_load_acpi_table (
return (status); return (status);
} }
acpi_os_printf ("%4.4s at %p successfully installed and loaded\n", fprintf (stderr, "Acpi table [%4.4s] successfully installed and loaded\n",
acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr); acpi_gbl_db_table_ptr->signature);
acpi_gbl_acpi_hardware_present = FALSE; acpi_gbl_acpi_hardware_present = FALSE;
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbxface - AML Debugger external interfaces * Module Name: dbxface - AML Debugger external interfaces
* $Revision: 59 $ * $Revision: 61 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "acpi.h" #include "acpi.h"
#include "amlcode.h" #include "amlcode.h"
#include "acdebug.h" #include "acdebug.h"
#include "acdisasm.h"
#ifdef ENABLE_DEBUGGER #ifdef ENABLE_DEBUGGER
...@@ -164,7 +165,7 @@ acpi_db_single_step ( ...@@ -164,7 +165,7 @@ acpi_db_single_step (
/* Now we can display it */ /* Now we can display it */
acpi_db_display_op (walk_state, display_op, ACPI_UINT32_MAX); acpi_dm_disassemble (walk_state, display_op, ACPI_UINT32_MAX);
if ((op->common.aml_opcode == AML_IF_OP) || if ((op->common.aml_opcode == AML_IF_OP) ||
(op->common.aml_opcode == AML_WHILE_OP)) { (op->common.aml_opcode == AML_WHILE_OP)) {
...@@ -351,7 +352,6 @@ acpi_db_initialize (void) ...@@ -351,7 +352,6 @@ acpi_db_initialize (void)
} }
if (!acpi_gbl_db_opt_verbose) { if (!acpi_gbl_db_opt_verbose) {
acpi_gbl_db_disasm_indent = " ";
acpi_gbl_db_opt_disasm = TRUE; acpi_gbl_db_opt_disasm = TRUE;
acpi_gbl_db_opt_stats = FALSE; acpi_gbl_db_opt_stats = FALSE;
} }
......
This diff is collapsed.
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsutils - Dispatcher utilities * Module Name: dsutils - Dispatcher utilities
* $Revision: 93 $ * $Revision: 94 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#define _COMPONENT ACPI_DISPATCHER #define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsutils") ACPI_MODULE_NAME ("dsutils")
#ifndef ACPI_NO_METHOD_EXECUTION
/******************************************************************************* /*******************************************************************************
* *
...@@ -235,6 +236,47 @@ acpi_ds_delete_result_if_not_used ( ...@@ -235,6 +236,47 @@ acpi_ds_delete_result_if_not_used (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ds_resolve_operands
*
* PARAMETERS: Walk_state - Current walk state with operands on stack
*
* RETURN: Status
*
* DESCRIPTION: Resolve all operands to their values. Used to prepare
* arguments to a control method invocation (a call from one
* method to another.)
*
******************************************************************************/
acpi_status
acpi_ds_resolve_operands (
acpi_walk_state *walk_state)
{
u32 i;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
/*
* Attempt to resolve each of the valid operands
* Method arguments are passed by value, not by reference
*/
for (i = 0; i < walk_state->num_operands; i++) {
status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
if (ACPI_FAILURE (status)) {
break;
}
}
return_ACPI_STATUS (status);
}
#endif
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ds_create_operand * FUNCTION: Acpi_ds_create_operand
...@@ -515,42 +557,3 @@ acpi_ds_create_operands ( ...@@ -515,42 +557,3 @@ acpi_ds_create_operands (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ds_resolve_operands
*
* PARAMETERS: Walk_state - Current walk state with operands on stack
*
* RETURN: Status
*
* DESCRIPTION: Resolve all operands to their values. Used to prepare
* arguments to a control method invocation (a call from one
* method to another.)
*
******************************************************************************/
acpi_status
acpi_ds_resolve_operands (
acpi_walk_state *walk_state)
{
u32 i;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
/*
* Attempt to resolve each of the valid operands
* Method arguments are passed by value, not by reference
*/
for (i = 0; i < walk_state->num_operands; i++) {
status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
if (ACPI_FAILURE (status)) {
break;
}
}
return_ACPI_STATUS (status);
}
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswload - Dispatcher namespace load callbacks * Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 67 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -70,9 +70,11 @@ acpi_ds_init_callbacks ( ...@@ -70,9 +70,11 @@ acpi_ds_init_callbacks (
break; break;
case 3: case 3:
#ifndef ACPI_NO_METHOD_EXECUTION
walk_state->parse_flags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE; walk_state->parse_flags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_exec_begin_op; walk_state->descending_callback = acpi_ds_exec_begin_op;
walk_state->ascending_callback = acpi_ds_exec_end_op; walk_state->ascending_callback = acpi_ds_exec_end_op;
#endif
break; break;
default: default:
...@@ -169,6 +171,11 @@ acpi_ds_load1_begin_op ( ...@@ -169,6 +171,11 @@ acpi_ds_load1_begin_op (
op->named.name = node->name.integer; op->named.name = node->name.integer;
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
op->named.path = (u8 *) path;
#endif
/* /*
* Put the Node in the "op" object that the parser uses, so we * Put the Node in the "op" object that the parser uses, so we
* can get it again quickly when this scope is closed * can get it again quickly when this scope is closed
...@@ -221,6 +228,7 @@ acpi_ds_load1_end_op ( ...@@ -221,6 +228,7 @@ acpi_ds_load1_end_op (
object_type = walk_state->op_info->object_type; object_type = walk_state->op_info->object_type;
#ifndef ACPI_NO_METHOD_EXECUTION
if (walk_state->op_info->flags & AML_FIELD) { if (walk_state->op_info->flags & AML_FIELD) {
if (walk_state->opcode == AML_FIELD_OP || if (walk_state->opcode == AML_FIELD_OP ||
walk_state->opcode == AML_BANK_FIELD_OP || walk_state->opcode == AML_BANK_FIELD_OP ||
...@@ -238,6 +246,7 @@ acpi_ds_load1_end_op ( ...@@ -238,6 +246,7 @@ acpi_ds_load1_end_op (
return (status); return (status);
} }
} }
#endif
if (op->common.aml_opcode == AML_NAME_OP) { if (op->common.aml_opcode == AML_NAME_OP) {
/* For Name opcode, get the object type from the argument */ /* For Name opcode, get the object type from the argument */
...@@ -430,7 +439,9 @@ acpi_ds_load2_end_op ( ...@@ -430,7 +439,9 @@ acpi_ds_load2_end_op (
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_parse_object *arg; acpi_parse_object *arg;
acpi_namespace_node *new_node; acpi_namespace_node *new_node;
#ifndef ACPI_NO_METHOD_EXECUTION
u32 i; u32 i;
#endif
ACPI_FUNCTION_NAME ("Ds_load2_end_op"); ACPI_FUNCTION_NAME ("Ds_load2_end_op");
...@@ -478,6 +489,7 @@ acpi_ds_load2_end_op ( ...@@ -478,6 +489,7 @@ acpi_ds_load2_end_op (
} }
} }
/* /*
* Named operations are as follows: * Named operations are as follows:
* *
...@@ -515,6 +527,8 @@ acpi_ds_load2_end_op ( ...@@ -515,6 +527,8 @@ acpi_ds_load2_end_op (
arg = op->common.value.arg; arg = op->common.value.arg;
switch (walk_state->op_info->type) { switch (walk_state->op_info->type) {
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_TYPE_CREATE_FIELD: case AML_TYPE_CREATE_FIELD:
/* /*
...@@ -604,7 +618,7 @@ acpi_ds_load2_end_op ( ...@@ -604,7 +618,7 @@ acpi_ds_load2_end_op (
} }
break; break;
#endif /* ACPI_NO_METHOD_EXECUTION */
case AML_TYPE_NAMED_COMPLEX: case AML_TYPE_NAMED_COMPLEX:
...@@ -629,6 +643,7 @@ acpi_ds_load2_end_op ( ...@@ -629,6 +643,7 @@ acpi_ds_load2_end_op (
break; break;
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP: case AML_REGION_OP:
/* /*
* The Op_region is not fully parsed at this time. Only valid argument is the Space_id. * The Op_region is not fully parsed at this time. Only valid argument is the Space_id.
...@@ -656,6 +671,7 @@ acpi_ds_load2_end_op ( ...@@ -656,6 +671,7 @@ acpi_ds_load2_end_op (
status = acpi_ds_create_node (walk_state, node, op); status = acpi_ds_create_node (walk_state, node, op);
break; break;
#endif /* ACPI_NO_METHOD_EXECUTION */
default: default:
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswstate - Dispatcher parse tree walk management routines * Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 65 $ * $Revision: 67 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -837,7 +837,7 @@ acpi_ds_create_walk_state ( ...@@ -837,7 +837,7 @@ acpi_ds_create_walk_state (
/* Init the method args/local */ /* Init the method args/local */
#ifndef _ACPI_ASL_COMPILER #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
acpi_ds_method_data_init (walk_state); acpi_ds_method_data_init (walk_state);
#endif #endif
...@@ -858,7 +858,6 @@ acpi_ds_create_walk_state ( ...@@ -858,7 +858,6 @@ acpi_ds_create_walk_state (
} }
#ifndef _ACPI_ASL_COMPILER
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ds_init_aml_walk * FUNCTION: Acpi_ds_init_aml_walk
...@@ -943,7 +942,6 @@ acpi_ds_init_aml_walk ( ...@@ -943,7 +942,6 @@ acpi_ds_init_aml_walk (
status = acpi_ds_init_callbacks (walk_state, pass_number); status = acpi_ds_init_callbacks (walk_state, pass_number);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
#endif
/******************************************************************************* /*******************************************************************************
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: excreate - Named object creation * Module Name: excreate - Named object creation
* $Revision: 92 $ * $Revision: 93 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
ACPI_MODULE_NAME ("excreate") ACPI_MODULE_NAME ("excreate")
#ifndef ACPI_NO_METHOD_EXECUTION
/***************************************************************************** /*****************************************************************************
* *
* FUNCTION: Acpi_ex_create_alias * FUNCTION: Acpi_ex_create_alias
...@@ -490,6 +491,7 @@ acpi_ex_create_power_resource ( ...@@ -490,6 +491,7 @@ acpi_ex_create_power_resource (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
#endif
/***************************************************************************** /*****************************************************************************
* *
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exdump - Interpreter debug output routines * Module Name: exdump - Interpreter debug output routines
* $Revision: 156 $ * $Revision: 157 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -575,14 +575,14 @@ acpi_ex_dump_object_descriptor ( ...@@ -575,14 +575,14 @@ acpi_ex_dump_object_descriptor (
{ {
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{ {
return; return_VOID;
} }
} }
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND)
{ {
acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc); acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
return; return_VOID;
} }
/* Common Fields */ /* Common Fields */
......
...@@ -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: 140 $ * $Revision: 141 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -804,16 +804,7 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -804,16 +804,7 @@ acpi_ex_opcode_1A_0T_1R (
switch (operand[0]->reference.target_type) { switch (operand[0]->reference.target_type) {
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
/* Ensure that the Buffer arguments are evaluated */
temp_desc = operand[0]->reference.object; temp_desc = operand[0]->reference.object;
#if 0
status = acpi_ds_get_buffer_arguments (temp_desc);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/* /*
* Create a new object that contains one element of the * Create a new object that contains one element of the
...@@ -841,14 +832,6 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -841,14 +832,6 @@ acpi_ex_opcode_1A_0T_1R (
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
#if 0
/* Ensure that the Package arguments are evaluated */
status = acpi_ds_get_package_arguments (operand[0]->reference.object);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/* /*
* Return the referenced element of the package. We must add * Return the referenced element of the package. We must add
* another reference to the referenced object, however. * another reference to the referenced object, however.
...@@ -884,6 +867,11 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -884,6 +867,11 @@ acpi_ex_opcode_1A_0T_1R (
return_desc = operand[0]->reference.object; return_desc = operand[0]->reference.object;
if (ACPI_GET_DESCRIPTOR_TYPE (return_desc) == ACPI_DESC_TYPE_NAMED) {
return_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) return_desc);
}
/* Add another reference to the object! */ /* Add another reference to the object! */
acpi_ut_add_reference (return_desc); acpi_ut_add_reference (return_desc);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exutils - interpreter/scanner utilities * Module Name: exutils - interpreter/scanner utilities
* $Revision: 100 $ * $Revision: 102 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -50,6 +50,34 @@ ...@@ -50,6 +50,34 @@
ACPI_MODULE_NAME ("exutils") ACPI_MODULE_NAME ("exutils")
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
#ifndef ACPI_NO_METHOD_EXECUTION
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ex_enter_interpreter * FUNCTION: Acpi_ex_enter_interpreter
...@@ -116,33 +144,6 @@ acpi_ex_exit_interpreter (void) ...@@ -116,33 +144,6 @@ acpi_ex_exit_interpreter (void)
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ex_truncate_for32bit_table * FUNCTION: Acpi_ex_truncate_for32bit_table
...@@ -263,6 +264,8 @@ acpi_ex_release_global_lock ( ...@@ -263,6 +264,8 @@ acpi_ex_release_global_lock (
ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n")); ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n"));
} }
} }
return_VOID;
} }
...@@ -378,4 +381,4 @@ acpi_ex_unsigned_integer_to_string ( ...@@ -378,4 +381,4 @@ acpi_ex_unsigned_integer_to_string (
} }
} }
#endif
/****************************************************************************** /******************************************************************************
* *
* Name: acconfig.h - Global configuration constants * Name: acconfig.h - Global configuration constants
* $Revision: 105 $ * $Revision: 107 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20020702 #define ACPI_CA_VERSION 0x20020725
/* Version of ACPI supported */ /* Version of ACPI supported */
...@@ -152,6 +152,15 @@ ...@@ -152,6 +152,15 @@
#define ACPI_MAX_ADDRESS_SPACE 255 #define ACPI_MAX_ADDRESS_SPACE 255
/* Array sizes. Used for range checking also */
#define NUM_ACCESS_TYPES 6
#define NUM_UPDATE_RULES 3
#define NUM_LOCK_RULES 2
#define NUM_MATCH_OPS 6
#define NUM_OPCODES 256
#define NUM_FIELD_NAMES 2
/* RSDP checksums */ /* RSDP checksums */
#define ACPI_RSDP_CHECKSUM_LENGTH 20 #define ACPI_RSDP_CHECKSUM_LENGTH 20
......
/****************************************************************************** /******************************************************************************
* *
* Name: acdebug.h - ACPI/AML debugger * Name: acdebug.h - ACPI/AML debugger
* $Revision: 62 $ * $Revision: 63 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#define ACPI_DEBUG_BUFFER_SIZE 4196 #define ACPI_DEBUG_BUFFER_SIZE 4196
typedef struct command_info typedef struct command_info
{ {
NATIVE_CHAR *name; /* Command Name */ NATIVE_CHAR *name; /* Command Name */
...@@ -185,47 +184,6 @@ acpi_db_walk_for_specific_objects ( ...@@ -185,47 +184,6 @@ acpi_db_walk_for_specific_objects (
void **return_value); void **return_value);
/*
* dbdisasm - AML disassembler
*/
void
acpi_db_display_op (
acpi_walk_state *walk_state,
acpi_parse_object *origin,
u32 num_opcodes);
void
acpi_db_display_namestring (
NATIVE_CHAR *name);
void
acpi_db_display_path (
acpi_parse_object *op);
void
acpi_db_display_opcode (
acpi_walk_state *walk_state,
acpi_parse_object *op);
void
acpi_db_decode_internal_object (
acpi_operand_object *obj_desc);
void
acpi_db_decode_node (
acpi_namespace_node *node);
u32
acpi_db_block_type (
acpi_parse_object *op);
acpi_status
acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op);
/* /*
* dbdisply - debug display commands * dbdisply - debug display commands
*/ */
...@@ -282,6 +240,10 @@ void * ...@@ -282,6 +240,10 @@ void *
acpi_db_get_pointer ( acpi_db_get_pointer (
void *target); void *target);
void
acpi_db_decode_internal_object (
acpi_operand_object *obj_desc);
/* /*
* dbexec - debugger control method execution * dbexec - debugger control method execution
......
/******************************************************************************
*
* Name: acdisasm.h - AML disassembler
* $Revision: 2 $
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2002, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ACDISASM_H__
#define __ACDISASM_H__
#include "amlresrc.h"
#define BLOCK_NONE 0
#define BLOCK_PAREN 1
#define BLOCK_BRACE 2
#define BLOCK_COMMA_LIST 4
extern const char *acpi_gbl_io_decode[2];
extern const char *acpi_gbl_word_decode[4];
extern const char *acpi_gbl_consume_decode[2];
extern const char *acpi_gbl_min_decode[2];
extern const char *acpi_gbl_max_decode[2];
extern const char *acpi_gbl_DECdecode[2];
extern const char *acpi_gbl_RNGdecode[4];
extern const char *acpi_gbl_MEMdecode[4];
extern const char *acpi_gbl_RWdecode[2];
extern const char *acpi_gbl_irq_decode[2];
extern const char *acpi_gbl_HEdecode[2];
extern const char *acpi_gbl_LLdecode[2];
extern const char *acpi_gbl_SHRdecode[2];
extern const char *acpi_gbl_TYPdecode[4];
extern const char *acpi_gbl_BMdecode[2];
extern const char *acpi_gbl_SIZdecode[4];
extern const NATIVE_CHAR *acpi_gbl_lock_rule[NUM_LOCK_RULES];
extern const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES];
extern const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES];
extern const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS];
typedef struct acpi_op_walk_info
{
u32 level;
u32 bit_offset;
} ACPI_OP_WALK_INFO;
typedef
acpi_status (*ASL_WALK_CALLBACK) (
acpi_parse_object *op,
u32 level,
void *context);
/*
* dmwalk
*/
void
acpi_dm_walk_parse_tree (
acpi_parse_object *op,
ASL_WALK_CALLBACK descending_callback,
ASL_WALK_CALLBACK ascending_callback,
void *context);
acpi_status
acpi_dm_descending_op (
acpi_parse_object *op,
u32 level,
void *context);
acpi_status
acpi_dm_ascending_op (
acpi_parse_object *op,
u32 level,
void *context);
/*
* dmopcode
*/
void
acpi_dm_validate_name (
char *name,
acpi_parse_object *op);
u32
acpi_dm_dump_name (
char *name);
void
acpi_dm_string (
char *string);
void
acpi_dm_unicode (
acpi_parse_object *op);
void
acpi_dm_disassemble (
acpi_walk_state *walk_state,
acpi_parse_object *origin,
u32 num_opcodes);
void
acpi_dm_namestring (
NATIVE_CHAR *name);
void
acpi_dm_display_path (
acpi_parse_object *op);
void
acpi_dm_disassemble_one_op (
acpi_walk_state *walk_state,
ACPI_OP_WALK_INFO *info,
acpi_parse_object *op);
void
acpi_dm_decode_internal_object (
acpi_operand_object *obj_desc);
void
acpi_dm_decode_node (
acpi_namespace_node *node);
u32
acpi_dm_block_type (
acpi_parse_object *op);
u32
acpi_dm_list_type (
acpi_parse_object *op);
acpi_status
acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op);
void
acpi_dm_method_flags (
acpi_parse_object *op);
void
acpi_dm_field_flags (
acpi_parse_object *op);
void
acpi_dm_address_space (
u8 space_id);
void
acpi_dm_region_flags (
acpi_parse_object *op);
void
acpi_dm_match_op (
acpi_parse_object *op);
void
acpi_dm_match_keyword (
acpi_parse_object *op);
u8
acpi_dm_comma_if_list_member (
acpi_parse_object *op);
void
acpi_dm_comma_if_field_member (
acpi_parse_object *op);
/*
* dmbuffer
*/
void
acpi_is_eisa_id (
acpi_parse_object *op);
void
acpi_dm_eisa_id (
u32 encoded_id);
u8
acpi_dm_is_unicode_buffer (
acpi_parse_object *op);
u8
acpi_dm_is_string_buffer (
acpi_parse_object *op);
/*
* dmresrc
*/
void
acpi_dm_disasm_byte_list (
u32 level,
u8 *byte_data,
u32 byte_count);
void
acpi_dm_byte_list (
ACPI_OP_WALK_INFO *info,
acpi_parse_object *op);
void
acpi_dm_resource_descriptor (
ACPI_OP_WALK_INFO *info,
u8 *byte_data,
u32 byte_count);
u8
acpi_dm_is_resource_descriptor (
acpi_parse_object *op);
void
acpi_dm_indent (
u32 level);
void
acpi_dm_bit_list (
u16 mask);
/*
* dmresrcl
*/
void
acpi_dm_io_flags (
u8 flags);
void
acpi_dm_memory_flags (
u8 flags,
u8 specific_flags);
void
acpi_dm_word_descriptor (
ASL_WORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_dword_descriptor (
ASL_DWORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_qword_descriptor (
ASL_QWORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_memory24_descriptor (
ASL_MEMORY_24_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_memory32_descriptor (
ASL_MEMORY_32_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_mem32_descriptor (
ASL_FIXED_MEMORY_32_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_generic_register_descriptor (
ASL_GENERAL_REGISTER_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_interrupt_descriptor (
ASL_EXTENDED_XRUPT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_large_descriptor (
ASL_LARGE_VENDOR_DESC *resource,
u32 length,
u32 level);
/*
* dmresrcs
*/
void
acpi_dm_irq_descriptor (
ASL_IRQ_FORMAT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_dma_descriptor (
ASL_DMA_FORMAT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_io_descriptor (
ASL_IO_PORT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_io_descriptor (
ASL_FIXED_IO_PORT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_start_dependent_descriptor (
ASL_START_DEPENDENT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_end_dependent_descriptor (
ASL_START_DEPENDENT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_small_descriptor (
ASL_SMALL_VENDOR_DESC *resource,
u32 length,
u32 level);
#endif /* __ACDISASM_H__ */
/****************************************************************************** /******************************************************************************
* *
* Name: acglobal.h - Declarations for global variables * Name: acglobal.h - Declarations for global variables
* $Revision: 126 $ * $Revision: 128 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -140,8 +140,9 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_present; ...@@ -140,8 +140,9 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_present;
extern u8 acpi_gbl_shutdown; extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags; extern u32 acpi_gbl_startup_flags;
extern const u8 acpi_gbl_decode_to8bit[8]; extern const u8 acpi_gbl_decode_to8bit[8];
extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES]; extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES];
extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
/***************************************************************************** /*****************************************************************************
...@@ -237,6 +238,12 @@ ACPI_EXTERN ACPI_GPE_INDEX_INFO *acpi_gbl_gpe_number_to_index; ...@@ -237,6 +238,12 @@ ACPI_EXTERN ACPI_GPE_INDEX_INFO *acpi_gbl_gpe_number_to_index;
ACPI_EXTERN u8 acpi_gbl_db_output_flags; ACPI_EXTERN u8 acpi_gbl_db_output_flags;
#ifdef ACPI_DISASSEMBLER
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
#endif
#ifdef ENABLE_DEBUGGER #ifdef ENABLE_DEBUGGER
...@@ -247,9 +254,7 @@ ACPI_EXTERN int optind; ...@@ -247,9 +254,7 @@ ACPI_EXTERN int optind;
ACPI_EXTERN NATIVE_CHAR *optarg; ACPI_EXTERN NATIVE_CHAR *optarg;
ACPI_EXTERN u8 acpi_gbl_db_opt_tables; ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_stats; ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
...@@ -261,7 +266,6 @@ ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_debug_filename[40]; ...@@ -261,7 +266,6 @@ ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_debug_filename[40];
ACPI_EXTERN u8 acpi_gbl_db_output_to_file; ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_buffer; ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_buffer;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_filename; ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_filename;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_disasm_indent;
ACPI_EXTERN u32 acpi_gbl_db_debug_level; ACPI_EXTERN u32 acpi_gbl_db_debug_level;
ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
ACPI_EXTERN acpi_table_header *acpi_gbl_db_table_ptr; ACPI_EXTERN acpi_table_header *acpi_gbl_db_table_ptr;
......
/****************************************************************************** /******************************************************************************
* *
* Name: aclocal.h - Internal data types used across the ACPI subsystem * Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 168 $ * $Revision: 172 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -567,8 +567,8 @@ acpi_status (*ACPI_EXECUTE_OP) ( ...@@ -567,8 +567,8 @@ acpi_status (*ACPI_EXECUTE_OP) (
*/ */
typedef struct acpi_opcode_info typedef struct acpi_opcode_info
{ {
#ifdef _OPCODE_NAMES #ifdef ACPI_DISASSEMBLER
NATIVE_CHAR *name; /* Opcode name (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 */
u32 runtime_args; /* Interpret time arguments */ u32 runtime_args; /* Interpret time arguments */
...@@ -603,15 +603,23 @@ typedef union acpi_parse_val ...@@ -603,15 +603,23 @@ typedef union acpi_parse_val
u32 aml_offset; /* offset of declaration in AML */\ u32 aml_offset; /* offset of declaration in AML */\
union acpi_parse_obj *parent; /* parent op */\ union acpi_parse_obj *parent; /* parent op */\
union acpi_parse_obj *next; /* next op */\ union acpi_parse_obj *next; /* next op */\
ACPI_DEBUG_ONLY_MEMBERS (\ ACPI_DISASM_ONLY_MEMBERS (\
u8 disasm_flags; /* Used during AML disassembly */\
u8 disasm_opcode; /* Subtype used for disassembly */\
NATIVE_CHAR aml_op_name[16]) /* op name (debug only) */\ NATIVE_CHAR aml_op_name[16]) /* op name (debug only) */\
/* NON-DEBUG members below: */\ /* NON-DEBUG members below: */\
acpi_namespace_node *node; /* for use by interpreter */\ acpi_namespace_node *node; /* for use by interpreter */\
acpi_parse_value value; /* Value or args associated with the opcode */\ acpi_parse_value value; /* Value or args associated with the opcode */\
#define ACPI_DASM_BUFFER 0x00
#define ACPI_DASM_RESOURCE 0x01
#define ACPI_DASM_STRING 0x02
#define ACPI_DASM_UNICODE 0x03
#define ACPI_DASM_EISAID 0x04
#define ACPI_DASM_MATCHOP 0x05
/* /*
* generic operation (eg. If, While, Store) * generic operation (for example: If, While, Store)
*/ */
typedef struct acpi_parseobj_common typedef struct acpi_parseobj_common
{ {
...@@ -626,6 +634,7 @@ typedef struct acpi_parseobj_common ...@@ -626,6 +634,7 @@ typedef struct acpi_parseobj_common
typedef struct acpi_parseobj_named typedef struct acpi_parseobj_named
{ {
ACPI_PARSE_COMMON ACPI_PARSE_COMMON
u8 *path;
u8 *data; /* AML body or bytelist data */ u8 *data; /* AML body or bytelist data */
u32 length; /* AML length */ u32 length; /* AML length */
u32 name; /* 4-byte name or zero if no name */ u32 name; /* 4-byte name or zero if no name */
...@@ -653,15 +662,15 @@ typedef struct acpi_parseobj_asl ...@@ -653,15 +662,15 @@ typedef struct acpi_parseobj_asl
u32 logical_byte_offset; u32 logical_byte_offset;
u32 end_line; u32 end_line;
u32 end_logical_line; u32 end_logical_line;
u16 parse_opcode;
u32 acpi_btype; u32 acpi_btype;
u32 aml_length; u32 aml_length;
u32 aml_subtree_length; u32 aml_subtree_length;
u32 final_aml_length; u32 final_aml_length;
u32 final_aml_offset; u32 final_aml_offset;
u16 parse_opcode;
u16 compile_flags;
u8 aml_opcode_length; u8 aml_opcode_length;
u8 aml_pkg_len_bytes; u8 aml_pkg_len_bytes;
u16 compile_flags;
u8 extra; u8 extra;
char parse_op_name[12]; char parse_op_name[12];
...@@ -705,6 +714,13 @@ typedef struct acpi_parse_state ...@@ -705,6 +714,13 @@ typedef struct acpi_parse_state
#define ACPI_PARSEOP_BYTELIST 0x08 #define ACPI_PARSEOP_BYTELIST 0x08
#define ACPI_PARSEOP_IN_CACHE 0x80 #define ACPI_PARSEOP_IN_CACHE 0x80
/* Parse object Disasm_flags */
#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMLIST 0x02
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_SPECIAL 0x10
/***************************************************************************** /*****************************************************************************
* *
......
/****************************************************************************** /******************************************************************************
* *
* Name: acmacros.h - C macros for the entire subsystem. * Name: acmacros.h - C macros for the entire subsystem.
* $Revision: 124 $ * $Revision: 125 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -287,10 +287,12 @@ ...@@ -287,10 +287,12 @@
/* /*
* Macros for the master AML opcode table * Macros for the master AML opcode table
*/ */
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) #ifdef ACPI_DISASSEMBLER
#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}
#define ACPI_DISASM_ONLY_MEMBERS(a) a;
#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}
#define ACPI_DISASM_ONLY_MEMBERS(a)
#endif #endif
#define ARG_TYPE_WIDTH 5 #define ARG_TYPE_WIDTH 5
...@@ -435,7 +437,6 @@ ...@@ -435,7 +437,6 @@
#define ACPI_DEBUG_DEFINE(a) a; #define ACPI_DEBUG_DEFINE(a) a;
#define ACPI_DEBUG_ONLY_MEMBERS(a) a; #define ACPI_DEBUG_ONLY_MEMBERS(a) a;
#define _OPCODE_NAMES
#define _VERBOSE_STRUCTURES #define _VERBOSE_STRUCTURES
...@@ -515,10 +516,6 @@ ...@@ -515,10 +516,6 @@
#define return_VALUE(s) return(s) #define return_VALUE(s) return(s)
#define return_PTR(s) return(s) #define return_PTR(s) return(s)
#ifdef ENABLE_DEBUGGER
#define _OPCODE_NAMES
#endif
#endif #endif
/* /*
......
/****************************************************************************** /******************************************************************************
* *
* Name: acnamesp.h - Namespace subcomponent prototypes and defines * Name: acnamesp.h - Namespace subcomponent prototypes and defines
* $Revision: 125 $ * $Revision: 126 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/* Definitions of the predefined namespace names */ /* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
#define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */ #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
#define ACPI_NS_ROOT_PATH "\\" #define ACPI_NS_ROOT_PATH "\\"
......
...@@ -204,7 +204,6 @@ acpi_os_read_port ( ...@@ -204,7 +204,6 @@ acpi_os_read_port (
void *value, void *value,
u32 width); u32 width);
acpi_status acpi_status
acpi_os_write_port ( acpi_os_write_port (
ACPI_IO_ADDRESS address, ACPI_IO_ADDRESS address,
...@@ -222,7 +221,6 @@ acpi_os_read_memory ( ...@@ -222,7 +221,6 @@ acpi_os_read_memory (
void *value, void *value,
u32 width); u32 width);
acpi_status acpi_status
acpi_os_write_memory ( acpi_os_write_memory (
ACPI_PHYSICAL_ADDRESS address, ACPI_PHYSICAL_ADDRESS address,
...@@ -241,7 +239,6 @@ acpi_os_read_pci_configuration ( ...@@ -241,7 +239,6 @@ acpi_os_read_pci_configuration (
void *value, void *value,
u32 width); u32 width);
acpi_status acpi_status
acpi_os_write_pci_configuration ( acpi_os_write_pci_configuration (
acpi_pci_id *pci_id, acpi_pci_id *pci_id,
...@@ -259,7 +256,6 @@ acpi_os_readable ( ...@@ -259,7 +256,6 @@ acpi_os_readable (
void *pointer, void *pointer,
u32 length); u32 length);
u8 u8
acpi_os_writable ( acpi_os_writable (
void *pointer, void *pointer,
...@@ -288,6 +284,10 @@ acpi_os_vprintf ( ...@@ -288,6 +284,10 @@ acpi_os_vprintf (
const NATIVE_CHAR *format, const NATIVE_CHAR *format,
va_list args); va_list args);
void
acpi_os_redirect_output (
void *destination);
/* /*
* Debug input * Debug input
......
/****************************************************************************** /******************************************************************************
* *
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 140 $ * $Revision: 142 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -224,6 +224,9 @@ extern const u8 _acpi_ctype[]; ...@@ -224,6 +224,9 @@ extern const u8 _acpi_ctype[];
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) #define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#define ACPI_IS_ASCII(c) ((c) < 0x80)
#endif /* ACPI_USE_SYSTEM_CLIBRARY */ #endif /* ACPI_USE_SYSTEM_CLIBRARY */
......
...@@ -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: 68 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -474,13 +474,4 @@ typedef enum ...@@ -474,13 +474,4 @@ typedef enum
#define METHOD_FLAGS_SYNCH_LEVEL 0xF0 #define METHOD_FLAGS_SYNCH_LEVEL 0xF0
/* Array sizes. Used for range checking also */
#define NUM_ACCESS_TYPES 6
#define NUM_UPDATE_RULES 3
#define NUM_MATCH_OPS 7
#define NUM_OPCODES 256
#define NUM_FIELD_NAMES 2
#endif /* __AMLCODE_H__ */ #endif /* __AMLCODE_H__ */
/****************************************************************************** /******************************************************************************
* *
* Module Name: aslresource.h - ASL resource descriptors * Module Name: amlresrc.h - AML resource descriptors
* $Revision: 19 $ * $Revision: 20 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
*/ */
#ifndef __ASLRESOURCE_H #ifndef __AMLRESRC_H
#define __ASLRESOURCE_H #define __AMLRESRC_H
#define ASL_RESNAME_ADDRESS "_ADR" #define ASL_RESNAME_ADDRESS "_ADR"
...@@ -80,11 +80,13 @@ typedef struct asl_resource_node ...@@ -80,11 +80,13 @@ typedef struct asl_resource_node
/* /*
* Resource descriptors defined in the ACPI specification * Resource descriptors defined in the ACPI specification.
*
* Alignment must be BYTE because these descriptors
* are used to overlay the AML byte stream.
*/ */
#pragma pack(1) #pragma pack(1)
typedef struct asl_irq_format_desc typedef struct asl_irq_format_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -94,7 +96,6 @@ typedef struct asl_irq_format_desc ...@@ -94,7 +96,6 @@ typedef struct asl_irq_format_desc
} ASL_IRQ_FORMAT_DESC; } ASL_IRQ_FORMAT_DESC;
#pragma pack(1)
typedef struct asl_irq_noflags_desc typedef struct asl_irq_noflags_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -103,7 +104,6 @@ typedef struct asl_irq_noflags_desc ...@@ -103,7 +104,6 @@ typedef struct asl_irq_noflags_desc
} ASL_IRQ_NOFLAGS_DESC; } ASL_IRQ_NOFLAGS_DESC;
#pragma pack(1)
typedef struct asl_dma_format_desc typedef struct asl_dma_format_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -113,7 +113,6 @@ typedef struct asl_dma_format_desc ...@@ -113,7 +113,6 @@ typedef struct asl_dma_format_desc
} ASL_DMA_FORMAT_DESC; } ASL_DMA_FORMAT_DESC;
#pragma pack(1)
typedef struct asl_start_dependent_desc typedef struct asl_start_dependent_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -122,7 +121,6 @@ typedef struct asl_start_dependent_desc ...@@ -122,7 +121,6 @@ typedef struct asl_start_dependent_desc
} ASL_START_DEPENDENT_DESC; } ASL_START_DEPENDENT_DESC;
#pragma pack(1)
typedef struct asl_start_dependent_noprio_desc typedef struct asl_start_dependent_noprio_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -130,7 +128,6 @@ typedef struct asl_start_dependent_noprio_desc ...@@ -130,7 +128,6 @@ typedef struct asl_start_dependent_noprio_desc
} ASL_START_DEPENDENT_NOPRIO_DESC; } ASL_START_DEPENDENT_NOPRIO_DESC;
#pragma pack(1)
typedef struct asl_end_dependent_desc typedef struct asl_end_dependent_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -138,7 +135,6 @@ typedef struct asl_end_dependent_desc ...@@ -138,7 +135,6 @@ typedef struct asl_end_dependent_desc
} ASL_END_DEPENDENT_DESC; } ASL_END_DEPENDENT_DESC;
#pragma pack(1)
typedef struct asl_io_port_desc typedef struct asl_io_port_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -151,7 +147,6 @@ typedef struct asl_io_port_desc ...@@ -151,7 +147,6 @@ typedef struct asl_io_port_desc
} ASL_IO_PORT_DESC; } ASL_IO_PORT_DESC;
#pragma pack(1)
typedef struct asl_fixed_io_port_desc typedef struct asl_fixed_io_port_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -161,7 +156,6 @@ typedef struct asl_fixed_io_port_desc ...@@ -161,7 +156,6 @@ typedef struct asl_fixed_io_port_desc
} ASL_FIXED_IO_PORT_DESC; } ASL_FIXED_IO_PORT_DESC;
#pragma pack(1)
typedef struct asl_small_vendor_desc typedef struct asl_small_vendor_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -170,7 +164,6 @@ typedef struct asl_small_vendor_desc ...@@ -170,7 +164,6 @@ typedef struct asl_small_vendor_desc
} ASL_SMALL_VENDOR_DESC; } ASL_SMALL_VENDOR_DESC;
#pragma pack(1)
typedef struct asl_end_tag_desc typedef struct asl_end_tag_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -181,7 +174,6 @@ typedef struct asl_end_tag_desc ...@@ -181,7 +174,6 @@ typedef struct asl_end_tag_desc
/* LARGE descriptors */ /* LARGE descriptors */
#pragma pack(1)
typedef struct asl_memory_24_desc typedef struct asl_memory_24_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -195,7 +187,6 @@ typedef struct asl_memory_24_desc ...@@ -195,7 +187,6 @@ typedef struct asl_memory_24_desc
} ASL_MEMORY_24_DESC; } ASL_MEMORY_24_DESC;
#pragma pack(1)
typedef struct asl_large_vendor_desc typedef struct asl_large_vendor_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -205,7 +196,6 @@ typedef struct asl_large_vendor_desc ...@@ -205,7 +196,6 @@ typedef struct asl_large_vendor_desc
} ASL_LARGE_VENDOR_DESC; } ASL_LARGE_VENDOR_DESC;
#pragma pack(1)
typedef struct asl_memory_32_desc typedef struct asl_memory_32_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -219,7 +209,6 @@ typedef struct asl_memory_32_desc ...@@ -219,7 +209,6 @@ typedef struct asl_memory_32_desc
} ASL_MEMORY_32_DESC; } ASL_MEMORY_32_DESC;
#pragma pack(1)
typedef struct asl_fixed_memory_32_desc typedef struct asl_fixed_memory_32_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -231,7 +220,6 @@ typedef struct asl_fixed_memory_32_desc ...@@ -231,7 +220,6 @@ typedef struct asl_fixed_memory_32_desc
} ASL_FIXED_MEMORY_32_DESC; } ASL_FIXED_MEMORY_32_DESC;
#pragma pack(1)
typedef struct asl_qword_address_desc typedef struct asl_qword_address_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -249,7 +237,6 @@ typedef struct asl_qword_address_desc ...@@ -249,7 +237,6 @@ typedef struct asl_qword_address_desc
} ASL_QWORD_ADDRESS_DESC; } ASL_QWORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_dword_address_desc typedef struct asl_dword_address_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -267,7 +254,6 @@ typedef struct asl_dword_address_desc ...@@ -267,7 +254,6 @@ typedef struct asl_dword_address_desc
} ASL_DWORD_ADDRESS_DESC; } ASL_DWORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_word_address_desc typedef struct asl_word_address_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -285,7 +271,6 @@ typedef struct asl_word_address_desc ...@@ -285,7 +271,6 @@ typedef struct asl_word_address_desc
} ASL_WORD_ADDRESS_DESC; } ASL_WORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_extended_xrupt_desc typedef struct asl_extended_xrupt_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -298,7 +283,6 @@ typedef struct asl_extended_xrupt_desc ...@@ -298,7 +283,6 @@ typedef struct asl_extended_xrupt_desc
} ASL_EXTENDED_XRUPT_DESC; } ASL_EXTENDED_XRUPT_DESC;
#pragma pack(1)
typedef struct asl_general_register_desc typedef struct asl_general_register_desc
{ {
u8 descriptor_type; u8 descriptor_type;
...@@ -311,6 +295,9 @@ typedef struct asl_general_register_desc ...@@ -311,6 +295,9 @@ typedef struct asl_general_register_desc
} ASL_GENERAL_REGISTER_DESC; } ASL_GENERAL_REGISTER_DESC;
/* restore default alignment */
#pragma pack()
/* Union of all resource descriptors, sow we can allocate the worst case */ /* Union of all resource descriptors, sow we can allocate the worst case */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acenv.h - Generation environment specific items * Name: acenv.h - Generation environment specific items
* $Revision: 95 $ * $Revision: 99 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -32,11 +32,13 @@ ...@@ -32,11 +32,13 @@
*/ */
#ifdef _ACPI_DUMP_APP #ifdef _ACPI_DUMP_APP
#ifndef MSDOS
#define ACPI_DEBUG #define ACPI_DEBUG
#endif
#define ACPI_APPLICATION #define ACPI_APPLICATION
#define ENABLE_DEBUGGER #define ACPI_DISASSEMBLER
#define ACPI_NO_METHOD_EXECUTION
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
#define PARSER_ONLY
#endif #endif
#ifdef _ACPI_EXEC_APP #ifdef _ACPI_EXEC_APP
...@@ -45,13 +47,15 @@ ...@@ -45,13 +47,15 @@
#define ACPI_DEBUG #define ACPI_DEBUG
#define ACPI_APPLICATION #define ACPI_APPLICATION
#define ENABLE_DEBUGGER #define ENABLE_DEBUGGER
#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
#define ACPI_APPLICATION #define ACPI_APPLICATION
/* #define ENABLE_DEBUGGER */ #define ACPI_DISASSEMBLER
#define ACPI_CONSTANT_EVAL_ONLY
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
#endif #endif
...@@ -183,7 +187,6 @@ ...@@ -183,7 +187,6 @@
/* /*
* Use the standard C library headers. * Use the standard C library headers.
* We want to keep these to a minimum. * We want to keep these to a minimum.
*
*/ */
#ifdef ACPI_USE_STANDARD_HEADERS #ifdef ACPI_USE_STANDARD_HEADERS
...@@ -213,12 +216,16 @@ ...@@ -213,12 +216,16 @@
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
#define ACPI_TOUPPER toupper #define ACPI_TOUPPER toupper
#define ACPI_TOLOWER tolower #define ACPI_TOLOWER tolower
#define ACPI_IS_XDIGIT isxdigit #define ACPI_IS_XDIGIT isxdigit
#define ACPI_IS_DIGIT isdigit #define ACPI_IS_DIGIT isdigit
#define ACPI_IS_SPACE isspace #define ACPI_IS_SPACE isspace
#define ACPI_IS_UPPER isupper #define ACPI_IS_UPPER isupper
#define ACPI_IS_PRINT isprint
#define ACPI_IS_ALPHA isalpha
#define ACPI_IS_ASCII isascii
/****************************************************************************** /******************************************************************************
* *
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 136 $ * $Revision: 137 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -619,93 +619,6 @@ acpi_ns_dump_objects ( ...@@ -619,93 +619,6 @@ acpi_ns_dump_objects (
} }
#ifndef _ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_one_device
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
* Context - Passed into Walk_namespace
*
* DESCRIPTION: Dump a single Node that represents a device
* This procedure is a User_function called by Acpi_ns_walk_namespace.
*
******************************************************************************/
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_device_info info;
acpi_status status;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
status = acpi_get_object_info (obj_handle, &info);
if (ACPI_SUCCESS (status)) {
for (i = 0; i < level; i++) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info.hardware_id,
ACPI_HIDWORD (info.address), ACPI_LODWORD (info.address),
info.current_status));
}
return (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_root_devices
*
* PARAMETERS: None
*
* DESCRIPTION: Dump all objects of type "device"
*
******************************************************************************/
void
acpi_ns_dump_root_devices (void)
{
acpi_handle sys_bus_handle;
acpi_status status;
ACPI_FUNCTION_NAME ("Ns_dump_root_devices");
/* Only dump the table if tracing is enabled */
if (!(ACPI_LV_TABLES & acpi_dbg_level)) {
return;
}
status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
if (ACPI_FAILURE (status)) {
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
acpi_ns_dump_one_device, NULL, NULL);
}
#endif
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ns_dump_tables * FUNCTION: Acpi_ns_dump_tables
......
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
* $Revision: 1 $
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2002, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "acpi.h"
#include "acnamesp.h"
#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsdumpdv")
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_one_device
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
* Context - Passed into Walk_namespace
*
* DESCRIPTION: Dump a single Node that represents a device
* This procedure is a User_function called by Acpi_ns_walk_namespace.
*
******************************************************************************/
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_device_info info;
acpi_status status;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
status = acpi_get_object_info (obj_handle, &info);
if (ACPI_SUCCESS (status)) {
for (i = 0; i < level; i++) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info.hardware_id,
ACPI_HIDWORD (info.address), ACPI_LODWORD (info.address),
info.current_status));
}
return (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_root_devices
*
* PARAMETERS: None
*
* DESCRIPTION: Dump all objects of type "device"
*
******************************************************************************/
void
acpi_ns_dump_root_devices (void)
{
acpi_handle sys_bus_handle;
acpi_status status;
ACPI_FUNCTION_NAME ("Ns_dump_root_devices");
/* Only dump the table if tracing is enabled */
if (!(ACPI_LV_TABLES & acpi_dbg_level)) {
return;
}
status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
if (ACPI_FAILURE (status)) {
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
acpi_ns_dump_one_device, NULL, NULL);
}
#endif
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsload - namespace loading/expanding/contracting procedures * Module Name: nsload - namespace loading/expanding/contracting procedures
* $Revision: 56 $ * $Revision: 57 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -37,59 +37,7 @@ ...@@ -37,59 +37,7 @@
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_load_namespace * FUNCTION: Ns_one_complete_parse
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Load the name space from what ever is pointed to by DSDT.
* (DSDT points to either the BIOS or a buffer.)
*
******************************************************************************/
acpi_status
acpi_ns_load_namespace (
void)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("Acpi_load_name_space");
/* There must be at least a DSDT installed */
if (acpi_gbl_DSDT == NULL) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DSDT is not in memory\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
/*
* Load the namespace. The DSDT is required,
* but the SSDT and PSDT tables are optional.
*/
status = acpi_ns_load_table_by_type (ACPI_TABLE_DSDT);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Ignore exceptions from these */
(void) acpi_ns_load_table_by_type (ACPI_TABLE_SSDT);
(void) acpi_ns_load_table_by_type (ACPI_TABLE_PSDT);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"ACPI Namespace successfully loaded at root %p\n",
acpi_gbl_root_node));
return_ACPI_STATUS (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_one_parse_pass
* *
* PARAMETERS: Pass_number - 1 or 2 * PARAMETERS: Pass_number - 1 or 2
* Table_desc - The table to be parsed. * Table_desc - The table to be parsed.
...@@ -203,6 +151,7 @@ acpi_ns_parse_table ( ...@@ -203,6 +151,7 @@ acpi_ns_parse_table (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
#ifndef ACPI_NO_METHOD_EXECUTION
/******************************************************************************* /*******************************************************************************
* *
...@@ -419,6 +368,58 @@ acpi_ns_load_table_by_type ( ...@@ -419,6 +368,58 @@ acpi_ns_load_table_by_type (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_load_namespace
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Load the name space from what ever is pointed to by DSDT.
* (DSDT points to either the BIOS or a buffer.)
*
******************************************************************************/
acpi_status
acpi_ns_load_namespace (
void)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("Acpi_load_name_space");
/* There must be at least a DSDT installed */
if (acpi_gbl_DSDT == NULL) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DSDT is not in memory\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
/*
* Load the namespace. The DSDT is required,
* but the SSDT and PSDT tables are optional.
*/
status = acpi_ns_load_table_by_type (ACPI_TABLE_DSDT);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Ignore exceptions from these */
(void) acpi_ns_load_table_by_type (ACPI_TABLE_SSDT);
(void) acpi_ns_load_table_by_type (ACPI_TABLE_PSDT);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"ACPI Namespace successfully loaded at root %p\n",
acpi_gbl_root_node));
return_ACPI_STATUS (status);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ns_delete_subtree * FUNCTION: Acpi_ns_delete_subtree
...@@ -550,4 +551,5 @@ acpi_ns_unload_namespace ( ...@@ -550,4 +551,5 @@ acpi_ns_unload_namespace (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
#endif
This diff is collapsed.
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: psargs - Parse AML opcode arguments * Module Name: psargs - Parse AML opcode arguments
* $Revision: 61 $ * $Revision: 62 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -332,7 +332,7 @@ acpi_ps_get_next_namepath ( ...@@ -332,7 +332,7 @@ acpi_ps_get_next_namepath (
NATIVE_CHAR *path; NATIVE_CHAR *path;
acpi_parse_object *name_op; acpi_parse_object *name_op;
acpi_status status; acpi_status status;
acpi_namespace_node *method_node = NULL; acpi_operand_object *method_desc;
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_generic_state scope_info; acpi_generic_state scope_info;
...@@ -369,30 +369,36 @@ acpi_ps_get_next_namepath ( ...@@ -369,30 +369,36 @@ acpi_ps_get_next_namepath (
&node); &node);
if (ACPI_SUCCESS (status)) { if (ACPI_SUCCESS (status)) {
if (node->type == ACPI_TYPE_METHOD) { if (node->type == ACPI_TYPE_METHOD) {
method_node = node; method_desc = acpi_ns_get_attached_object (node);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p Desc %p Path=%p\n",
method_node, path)); node, method_desc, path));
name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP); name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
if (name_op) { if (!name_op) {
/* Change arg into a METHOD CALL and attach name to it */ return_VOID;
}
acpi_ps_init_op (arg, AML_INT_METHODCALL_OP); /* Change arg into a METHOD CALL and attach name to it */
name_op->common.value.name = path; acpi_ps_init_op (arg, AML_INT_METHODCALL_OP);
/* Point METHODCALL/NAME to the METHOD Node */ name_op->common.value.name = path;
name_op->common.node = method_node; /* Point METHODCALL/NAME to the METHOD Node */
acpi_ps_append_arg (arg, name_op);
if (!acpi_ns_get_attached_object (method_node)) { name_op->common.node = node;
return_VOID; acpi_ps_append_arg (arg, name_op);
}
*arg_count = (acpi_ns_get_attached_object (method_node))->method.param_count; if (!method_desc) {
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p has no attached object\n",
node));
return_VOID;
} }
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p Args %X\n",
node, method_desc->method.param_count));
*arg_count = method_desc->method.param_count;
return_VOID; return_VOID;
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psopcode - Parser/Interpreter opcode information table * Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 70 $ * $Revision: 71 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -734,7 +734,7 @@ NATIVE_CHAR * ...@@ -734,7 +734,7 @@ NATIVE_CHAR *
acpi_ps_get_opcode_name ( acpi_ps_get_opcode_name (
u16 opcode) u16 opcode)
{ {
#ifdef ACPI_DEBUG #ifdef ACPI_DISASSEMBLER
const acpi_opcode_info *op; const acpi_opcode_info *op;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psparse - Parser top level AML parse routines * Module Name: psparse - Parser top level AML parse routines
* $Revision: 128 $ * $Revision: 129 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -473,7 +473,7 @@ acpi_ps_parse_loop ( ...@@ -473,7 +473,7 @@ acpi_ps_parse_loop (
parser_state = &walk_state->parser_state; parser_state = &walk_state->parser_state;
walk_state->arg_types = 0; walk_state->arg_types = 0;
#ifndef PARSER_ONLY #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) { if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
/* We are restarting a preempted control method */ /* We are restarting a preempted control method */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psutils - Parser miscellaneous utilities (Parser only) * Module Name: psutils - Parser miscellaneous utilities (Parser only)
* $Revision: 52 $ * $Revision: 53 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -186,7 +186,7 @@ acpi_ps_free_op ( ...@@ -186,7 +186,7 @@ acpi_ps_free_op (
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", op)); ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", op));
} }
if (op->common.flags == ACPI_PARSEOP_GENERIC) { if (op->common.flags & ACPI_PARSEOP_GENERIC) {
acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op); acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op);
} }
else { else {
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rsio - IO and DMA resource descriptors * Module Name: rsio - IO and DMA resource descriptors
* $Revision: 21 $ * $Revision: 22 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -399,7 +399,7 @@ acpi_rs_dma_resource ( ...@@ -399,7 +399,7 @@ acpi_rs_dma_resource (
buffer += 1; buffer += 1;
temp8 = *buffer; temp8 = *buffer;
/* Decode the IRQ bits */ /* Decode the DMA channel bits */
for (i = 0, index = 0; index < 8; index++) { for (i = 0, index = 0; index < 8; index++) {
if ((temp8 >> index) & 0x01) { if ((temp8 >> index) & 0x01) {
...@@ -407,19 +407,16 @@ acpi_rs_dma_resource ( ...@@ -407,19 +407,16 @@ acpi_rs_dma_resource (
i++; i++;
} }
} }
if (i == 0) {
/* Zero channels is invalid! */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found Zero DMA channels in resource list\n"));
return_ACPI_STATUS (AE_BAD_DATA);
}
output_struct->data.dma.number_of_channels = i;
/* Zero DMA channels is valid */
/* output_struct->data.dma.number_of_channels = i;
* Calculate the structure size based upon the number of interrupts if (i > 0) {
*/ /*
struct_size += ((ACPI_SIZE) output_struct->data.dma.number_of_channels - 1) * 4; * Calculate the structure size based upon the number of interrupts
*/
struct_size += ((ACPI_SIZE) i - 1) * 4;
}
/* /*
* Point to Byte 2 * Point to Byte 2
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rsirq - IRQ resource descriptors * Module Name: rsirq - IRQ resource descriptors
* $Revision: 29 $ * $Revision: 30 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -96,18 +96,15 @@ acpi_rs_irq_resource ( ...@@ -96,18 +96,15 @@ acpi_rs_irq_resource (
} }
} }
if (i == 0) { /* Zero interrupts is valid */
/* Zero interrupts is invalid! */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found Zero interrupt levels in resource list\n"));
return_ACPI_STATUS (AE_BAD_DATA);
}
output_struct->data.irq.number_of_interrupts = i; output_struct->data.irq.number_of_interrupts = i;
if (i > 0) {
/* /*
* Calculate the structure size based upon the number of interrupts * Calculate the structure size based upon the number of interrupts
*/ */
struct_size += ((ACPI_SIZE) output_struct->data.irq.number_of_interrupts - 1) * 4; struct_size += ((ACPI_SIZE) i - 1) * 4;
}
/* /*
* Point to Byte 3 if it is used * Point to Byte 3 if it is used
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbrsdt - ACPI RSDT table utilities * Module Name: tbrsdt - ACPI RSDT table utilities
* $Revision: 1 $ * $Revision: 2 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -271,12 +271,6 @@ acpi_tb_get_table_rsdt ( ...@@ -271,12 +271,6 @@ acpi_tb_get_table_rsdt (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/*
* Valid RSDT signature, verify the checksum. If it fails, just
* print a warning and ignore it.
*/
status = acpi_tb_verify_table_checksum (table_info.pointer);
/* Get the number of tables defined in the RSDT or XSDT */ /* Get the number of tables defined in the RSDT or XSDT */
acpi_gbl_rsdt_table_count = acpi_tb_get_table_count (acpi_gbl_RSDP, table_info.pointer); acpi_gbl_rsdt_table_count = acpi_tb_get_table_count (acpi_gbl_RSDP, table_info.pointer);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utglobal - Global variables for the ACPI subsystem * Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 164 $ * $Revision: 165 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "acpi.h" #include "acpi.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "amlcode.h"
#define _COMPONENT ACPI_UTILITIES #define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utglobal") ACPI_MODULE_NAME ("utglobal")
...@@ -357,15 +358,15 @@ acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = ...@@ -357,15 +358,15 @@ acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
/* Region type decoding */ /* Region type decoding */
static const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] =
{ {
"System_memory", "System_memory",
"System_iO", "System_iO",
"PCIConfig", "PCI_Config",
"Embedded_control", "Embedded_control",
"SMBus", "SMBus",
"CMOS", "CMOS",
"PCIBar_target", "PCIBARTarget",
"Data_table", "Data_table",
}; };
...@@ -555,55 +556,6 @@ acpi_ut_get_mutex_name ( ...@@ -555,55 +556,6 @@ acpi_ut_get_mutex_name (
} }
/* Various strings for future use */
#if 0
#include "amlcode.h"
/* Data used in keeping track of fields */
static const NATIVE_CHAR *acpi_gbl_FEnames[NUM_FIELD_NAMES] =
{
"skip",
"?access?"
}; /* FE = Field Element */
static const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS] =
{
"Error",
"MTR",
"MEQ",
"MLE",
"MLT",
"MGE",
"MGT"
};
/* Access type decoding */
static const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES] =
{
"Any_acc",
"Byte_acc",
"Word_acc",
"DWord_acc",
"QWord_acc",
"Buffer_acc",
};
/* Update rule decoding */
static const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES] =
{
"Preserve",
"Write_as_ones",
"Write_as_zeros"
};
#endif /* Future use */
#endif #endif
......
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