Commit 96e1676b authored by Andy Grover's avatar Andy Grover

ACPI: Interpreter update to 20020918

parent 23224c29
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsfield - Dispatcher field routines * Module Name: dsfield - Dispatcher field routines
* $Revision: 66 $ * $Revision: 67 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -250,7 +250,7 @@ acpi_ds_get_field_names ( ...@@ -250,7 +250,7 @@ acpi_ds_get_field_names (
} }
ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n",
&arg->named.name)); (char *) &arg->named.name));
} }
else { else {
arg->common.node = info->field_node; arg->common.node = info->field_node;
...@@ -271,7 +271,7 @@ acpi_ds_get_field_names ( ...@@ -271,7 +271,7 @@ acpi_ds_get_field_names (
if (position > ACPI_UINT32_MAX) { if (position > ACPI_UINT32_MAX) {
ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n",
&info->field_node->name)); (char *) &info->field_node->name));
return_ACPI_STATUS (AE_SUPPORT); return_ACPI_STATUS (AE_SUPPORT);
} }
...@@ -417,7 +417,7 @@ acpi_ds_init_field_objects ( ...@@ -417,7 +417,7 @@ acpi_ds_init_field_objects (
} }
ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n",
&arg->named.name)); (char *) &arg->named.name));
/* Name already exists, just ignore this error */ /* Name already exists, just ignore this error */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsobject - Dispatcher object management routines * Module Name: dsobject - Dispatcher object management routines
* $Revision: 106 $ * $Revision: 107 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -746,9 +746,10 @@ acpi_ds_init_object_from_op ( ...@@ -746,9 +746,10 @@ acpi_ds_init_object_from_op (
obj_desc->reference.opcode = AML_LOCAL_OP; obj_desc->reference.opcode = AML_LOCAL_OP;
obj_desc->reference.offset = opcode - AML_LOCAL_OP; obj_desc->reference.offset = opcode - AML_LOCAL_OP;
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
acpi_ds_method_data_get_node (AML_LOCAL_OP, obj_desc->reference.offset, status = acpi_ds_method_data_get_node (AML_LOCAL_OP, obj_desc->reference.offset,
walk_state, (acpi_namespace_node **) &obj_desc->reference.object); walk_state, (acpi_namespace_node **) &obj_desc->reference.object);
#endif #endif
break; break;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswload - Dispatcher namespace load callbacks * Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 71 $ * $Revision: 73 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -202,7 +202,26 @@ acpi_ds_load1_begin_op ( ...@@ -202,7 +202,26 @@ acpi_ds_load1_begin_op (
/* These are acceptable types */ /* These are acceptable types */
break; break;
default: case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
/*
* These types we will allow, but we will change the type. This
* enables some existing code of the form:
*
* Name (DEB, 0)
* Scope (DEB) { ... }
*/
ACPI_REPORT_WARNING (("Invalid type (%s) for target of Scope operator [%4.4s], changing type to ANY\n",
acpi_ut_get_type_name (node->type), path));
node->type = ACPI_TYPE_ANY;
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;
default:
/* All other types are an error */ /* All other types are an error */
...@@ -440,6 +459,51 @@ acpi_ds_load2_begin_op ( ...@@ -440,6 +459,51 @@ acpi_ds_load2_begin_op (
} }
if (ACPI_SUCCESS (status)) { if (ACPI_SUCCESS (status)) {
/*
* For the scope op, we must check to make sure that the target is
* one of the opcodes that actually opens a scope
*/
if (walk_state->opcode == AML_SCOPE_OP) {
switch (node->type) {
case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_METHOD:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:
/* These are acceptable types */
break;
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
/*
* These types we will allow, but we will change the type. This
* enables some existing code of the form:
*
* Name (DEB, 0)
* Scope (DEB) { ... }
*/
ACPI_REPORT_WARNING (("Invalid type (%s) for target of Scope operator [%4.4s], changing type to ANY\n",
acpi_ut_get_type_name (node->type), buffer_ptr));
node->type = ACPI_TYPE_ANY;
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;
default:
/* All other types are an error */
ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s]\n",
acpi_ut_get_type_name (node->type), buffer_ptr));
return (AE_AML_OPERAND_TYPE);
}
}
if (!op) { if (!op) {
/* Create a new op */ /* Create a new op */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconvrt - Object conversion routines * Module Name: exconvrt - Object conversion routines
* $Revision: 37 $ * $Revision: 38 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -230,7 +230,33 @@ acpi_ex_convert_to_buffer ( ...@@ -230,7 +230,33 @@ acpi_ex_convert_to_buffer (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
*result_desc = obj_desc; /*
* Create a new Buffer object
*/
ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
if (!ret_desc) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Need enough space for one integer */
new_buf = ACPI_MEM_CALLOCATE (obj_desc->string.length);
if (!new_buf) {
ACPI_REPORT_ERROR
(("Ex_convert_to_buffer: Buffer allocation failure\n"));
acpi_ut_remove_reference (ret_desc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
ACPI_STRNCPY ((char *) new_buf, (char *) obj_desc->string.pointer, obj_desc->string.length);
ret_desc->buffer.flags |= AOPOBJ_DATA_VALID;
ret_desc->buffer.pointer = new_buf;
ret_desc->buffer.length = obj_desc->string.length;
/* Return the new buffer descriptor */
*result_desc = ret_desc;
break; break;
......
...@@ -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: 108 $ * $Revision: 109 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "acpi.h" #include "acpi.h"
#include "acinterp.h" #include "acinterp.h"
#include "amlcode.h" #include "amlcode.h"
#include "acdispat.h"
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
......
...@@ -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: 142 $ * $Revision: 143 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
* fully resolved operands. * fully resolved operands.
!*/ !*/
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ex_opcode_1A_0T_0R * FUNCTION: Acpi_ex_opcode_1A_0T_0R
...@@ -561,73 +560,11 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -561,73 +560,11 @@ acpi_ex_opcode_1A_0T_1R (
case AML_TYPE_OP: /* Object_type (Source_object) */ case AML_TYPE_OP: /* Object_type (Source_object) */
if (ACPI_GET_OBJECT_TYPE (operand[0]) == INTERNAL_TYPE_REFERENCE) { /* Get the type of the base object */
/*
* Not a Name -- an indirect name pointer would have
* been converted to a direct name pointer in Resolve_operands
*/
switch (operand[0]->reference.opcode) {
case AML_DEBUG_OP:
/* The Debug Object is of type "Debug_object" */
type = ACPI_TYPE_DEBUG_OBJECT;
break;
case AML_INDEX_OP:
/* Get the type of this reference (index into another object) */
type = operand[0]->reference.target_type;
if (type == ACPI_TYPE_PACKAGE) {
/*
* The main object is a package, we want to get the type
* of the individual package element that is referenced by
* the index.
*/
type = ACPI_GET_OBJECT_TYPE (*(operand[0]->reference.where));
}
break;
case AML_LOCAL_OP:
case AML_ARG_OP:
type = acpi_ds_method_data_get_type (operand[0]->reference.opcode,
operand[0]->reference.offset, walk_state);
break;
default:
ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Unknown Reference subtype %X\n",
operand[0]->reference.opcode));
status = AE_AML_INTERNAL;
goto cleanup;
}
}
else {
/*
* It's not a Reference, so it must be a direct name pointer.
*/
type = acpi_ns_get_type ((acpi_namespace_node *) operand[0]);
/* Convert internal types to external types */
switch (type) {
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
type = ACPI_TYPE_FIELD_UNIT;
break;
default:
/* No change to Type required */
break;
}
status = acpi_ex_resolve_multiple (walk_state, operand[0], &type, NULL);
if (ACPI_FAILURE (status)) {
goto cleanup;
} }
/* Allocate a descriptor to hold the type. */ /* Allocate a descriptor to hold the type. */
...@@ -644,39 +581,36 @@ acpi_ex_opcode_1A_0T_1R ( ...@@ -644,39 +581,36 @@ acpi_ex_opcode_1A_0T_1R (
case AML_SIZE_OF_OP: /* Size_of (Source_object) */ case AML_SIZE_OF_OP: /* Size_of (Source_object) */
temp_desc = operand[0]; /* Get the base object */
if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_NAMED) {
temp_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) operand[0]);
}
if (!temp_desc) { status = acpi_ex_resolve_multiple (walk_state, operand[0], &type, &temp_desc);
value = 0; if (ACPI_FAILURE (status)) {
goto cleanup;
} }
else {
/*
* Type is guaranteed to be a buffer, string, or package at this
* point (even if the original operand was an object reference, it
* will be resolved and typechecked during operand resolution.)
*/
switch (ACPI_GET_OBJECT_TYPE (temp_desc)) {
case ACPI_TYPE_BUFFER:
value = temp_desc->buffer.length;
break;
case ACPI_TYPE_STRING: /*
value = temp_desc->string.length; * Type is guaranteed to be a buffer, string, or package at this
break; * point (even if the original operand was an object reference, it
* will be resolved and typechecked during operand resolution.)
*/
switch (type) {
case ACPI_TYPE_BUFFER:
value = temp_desc->buffer.length;
break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_STRING:
value = temp_desc->package.count; value = temp_desc->string.length;
break; break;
default: case ACPI_TYPE_PACKAGE:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Size_of, Not Buf/Str/Pkg - found type %s\n", value = temp_desc->package.count;
acpi_ut_get_object_type_name (temp_desc))); break;
status = AE_AML_OPERAND_TYPE;
goto cleanup; default:
} ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Size_of, Not Buf/Str/Pkg - found type %s\n",
acpi_ut_get_type_name (type)));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
} }
/* /*
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresnte - AML Interpreter object resolution * Module Name: exresnte - AML Interpreter object resolution
* $Revision: 57 $ * $Revision: 58 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "acpi.h" #include "acpi.h"
#include "amlcode.h"
#include "acdispat.h" #include "acdispat.h"
#include "acinterp.h" #include "acinterp.h"
#include "acnamesp.h" #include "acnamesp.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresolv - AML Interpreter object resolution * Module Name: exresolv - AML Interpreter object resolution
* $Revision: 115 $ * $Revision: 116 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "amlcode.h" #include "amlcode.h"
#include "acdispat.h" #include "acdispat.h"
#include "acinterp.h" #include "acinterp.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
...@@ -280,3 +281,169 @@ acpi_ex_resolve_object_to_value ( ...@@ -280,3 +281,169 @@ acpi_ex_resolve_object_to_value (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ex_resolve_multiple
*
* PARAMETERS: Walk_state - Current state (contains AML opcode)
* Operand - Starting point for resolution
* Return_type - Where the object type is returned
* Return_desc - Where the resolved object is returned
*
* RETURN: Status
*
* DESCRIPTION: Return the base object and type. Traverse a reference list if
* necessary to get to the base object.
*
******************************************************************************/
acpi_status
acpi_ex_resolve_multiple (
acpi_walk_state *walk_state,
acpi_operand_object *operand,
acpi_object_type *return_type,
acpi_operand_object **return_desc)
{
acpi_operand_object *obj_desc = (void *) operand;
acpi_namespace_node *node;
acpi_object_type type;
ACPI_FUNCTION_TRACE ("Ex_get_object_type");
/*
* For reference objects created via the Ref_of or Index operators,
* we need to get to the base object (as per the ACPI specification
* of the Object_type and Size_of operators). This means traversing
* the list of possibly many nested references.
*/
while (ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_REFERENCE) {
switch (obj_desc->reference.opcode) {
case AML_REF_OF_OP:
/* Dereference the reference pointer */
node = obj_desc->reference.object;
/* All "References" point to a NS node */
if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* Get the attached object */
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
/* No object, use the NS node type */
type = acpi_ns_get_type (node);
goto exit;
}
/* Check for circular references */
if (obj_desc == operand) {
return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE);
}
break;
case AML_INDEX_OP:
/* Get the type of this reference (index into another object) */
type = obj_desc->reference.target_type;
if (type != ACPI_TYPE_PACKAGE) {
goto exit;
}
/*
* The main object is a package, we want to get the type
* of the individual package element that is referenced by
* the index.
*
* This could of course in turn be another reference object.
*/
obj_desc = *(obj_desc->reference.where);
break;
case AML_INT_NAMEPATH_OP:
/* Dereference the reference pointer */
node = obj_desc->reference.node;
/* All "References" point to a NS node */
if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* Get the attached object */
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
/* No object, use the NS node type */
type = acpi_ns_get_type (node);
goto exit;
}
/* Check for circular references */
if (obj_desc == operand) {
return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE);
}
break;
case AML_DEBUG_OP:
/* The Debug Object is of type "Debug_object" */
type = ACPI_TYPE_DEBUG_OBJECT;
goto exit;
default:
ACPI_REPORT_ERROR (("Acpi_ex_resolve_multiple: Unknown Reference subtype %X\n",
obj_desc->reference.opcode));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
}
/*
* Now we are guaranteed to have an object that has not been created
* via the Ref_of or Index operators.
*/
type = ACPI_GET_OBJECT_TYPE (obj_desc);
exit:
/* Convert internal types to external types */
switch (type) {
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
type = ACPI_TYPE_FIELD_UNIT;
break;
default:
/* No change to Type required */
break;
}
*return_type = type;
if (return_desc) {
*return_desc = obj_desc;
}
return_ACPI_STATUS (AE_OK);
}
...@@ -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: 55 $ * $Revision: 57 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "amlcode.h" #include "amlcode.h"
#include "acparser.h" #include "acparser.h"
#include "acinterp.h" #include "acinterp.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
...@@ -463,11 +462,12 @@ acpi_ex_resolve_operands ( ...@@ -463,11 +462,12 @@ acpi_ex_resolve_operands (
case ARGI_DATAOBJECT: case ARGI_DATAOBJECT:
/* /*
* ARGI_DATAOBJECT is only used by the Size_of operator. * ARGI_DATAOBJECT is only used by the Size_of operator.
* Need a buffer, string, package, or Node reference. * Need a buffer, string, package, or Ref_of reference.
* *
* The only reference allowed here is a direct reference to * The only reference allowed here is a direct reference to
* a namespace node. * a namespace node.
*/ */
#if 0
if (ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) { if (ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) {
if (!(*stack_ptr)->reference.node) { if (!(*stack_ptr)->reference.node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
...@@ -497,13 +497,14 @@ acpi_ex_resolve_operands ( ...@@ -497,13 +497,14 @@ acpi_ex_resolve_operands (
acpi_ut_remove_reference (*stack_ptr); acpi_ut_remove_reference (*stack_ptr);
(*stack_ptr) = temp_node; (*stack_ptr) = temp_node;
} }
#endif
/* Need a buffer, string, package */ /* Need a buffer, string, package */
switch (ACPI_GET_OBJECT_TYPE (*stack_ptr)) { switch (ACPI_GET_OBJECT_TYPE (*stack_ptr)) {
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case INTERNAL_TYPE_REFERENCE:
/* Valid operand */ /* Valid operand */
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exstore - AML Interpreter object store support * Module Name: exstore - AML Interpreter object store support
* $Revision: 169 $ * $Revision: 171 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -103,7 +103,7 @@ acpi_ex_store ( ...@@ -103,7 +103,7 @@ acpi_ex_store (
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/*lint: -fallthrough */ /*lint -fallthrough */
default: default:
...@@ -286,6 +286,12 @@ acpi_ex_store_object_to_index ( ...@@ -286,6 +286,12 @@ acpi_ex_store_object_to_index (
if (new_desc != obj_desc) { if (new_desc != obj_desc) {
acpi_ut_remove_reference (obj_desc); acpi_ut_remove_reference (obj_desc);
*(index_desc->reference.where) = new_desc; *(index_desc->reference.where) = new_desc;
/* If same as the original source, add a reference */
if (new_desc == source_desc) {
acpi_ut_add_reference (new_desc);
}
} }
break; break;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Module Name: exstoren - AML Interpreter object store support, * Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object) * Store to Node (namespace object)
* $Revision: 50 $ * $Revision: 51 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -210,6 +210,15 @@ acpi_ex_store_object_to_object ( ...@@ -210,6 +210,15 @@ acpi_ex_store_object_to_object (
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
if (source_desc == actual_src_desc) {
/*
* No conversion was performed. Return the Source_desc as the
* new object.
*/
*new_desc = source_desc;
return_ACPI_STATUS (AE_OK);
}
} }
/* /*
......
/****************************************************************************** /******************************************************************************
* *
* Name: acconfig.h - Global configuration constants * Name: acconfig.h - Global configuration constants
* $Revision: 110 $ * $Revision: 111 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20020829 #define ACPI_CA_VERSION 0x20020918
/* Version of ACPI supported */ /* Version of ACPI supported */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acdebug.h - ACPI/AML debugger * Name: acdebug.h - ACPI/AML debugger
* $Revision: 63 $ * $Revision: 64 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -197,6 +197,10 @@ acpi_db_decode_and_display_object ( ...@@ -197,6 +197,10 @@ acpi_db_decode_and_display_object (
NATIVE_CHAR *target, NATIVE_CHAR *target,
NATIVE_CHAR *output_type); NATIVE_CHAR *output_type);
void
acpi_db_decode_node (
acpi_namespace_node *node);
void void
acpi_db_display_result_object ( acpi_db_display_result_object (
acpi_operand_object *obj_desc, acpi_operand_object *obj_desc,
......
/****************************************************************************** /******************************************************************************
* *
* Name: acexcep.h - Exception codes returned by the ACPI subsystem * Name: acexcep.h - Exception codes returned by the ACPI subsystem
* $Revision: 63 $ * $Revision: 64 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -142,8 +142,9 @@ ...@@ -142,8 +142,9 @@
#define AE_AML_ALIGNMENT (acpi_status) (0x001D | AE_CODE_AML) #define AE_AML_ALIGNMENT (acpi_status) (0x001D | AE_CODE_AML)
#define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001E | AE_CODE_AML) #define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001E | AE_CODE_AML)
#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML)
#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML)
#define AE_CODE_AML_MAX 0x001F #define AE_CODE_AML_MAX 0x0020
/* /*
* Internal exceptions used for control * Internal exceptions used for control
...@@ -158,8 +159,9 @@ ...@@ -158,8 +159,9 @@
#define AE_CTRL_TRANSFER (acpi_status) (0x0008 | AE_CODE_CONTROL) #define AE_CTRL_TRANSFER (acpi_status) (0x0008 | AE_CODE_CONTROL)
#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL) #define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL) #define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
#define AE_CODE_CTRL_MAX 0x000A #define AE_CODE_CTRL_MAX 0x000B
#ifdef DEFINE_ACPI_GLOBALS #ifdef DEFINE_ACPI_GLOBALS
...@@ -255,7 +257,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_aml[] = ...@@ -255,7 +257,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_aml[] =
"AE_AML_NO_WHILE", "AE_AML_NO_WHILE",
"AE_AML_ALIGNMENT", "AE_AML_ALIGNMENT",
"AE_AML_NO_RESOURCE_END_TAG", "AE_AML_NO_RESOURCE_END_TAG",
"AE_AML_BAD_RESOURCE_VALUE" "AE_AML_BAD_RESOURCE_VALUE",
"AE_AML_CIRCULAR_REFERENCE"
}; };
NATIVE_CHAR const *acpi_gbl_exception_names_ctrl[] = NATIVE_CHAR const *acpi_gbl_exception_names_ctrl[] =
...@@ -269,7 +272,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_ctrl[] = ...@@ -269,7 +272,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_ctrl[] =
"AE_CTRL_END", "AE_CTRL_END",
"AE_CTRL_TRANSFER", "AE_CTRL_TRANSFER",
"AE_CTRL_BREAK", "AE_CTRL_BREAK",
"AE_CTRL_CONTINUE" "AE_CTRL_CONTINUE",
"AE_CTRL_SKIP"
}; };
#endif /* ACPI GLOBALS */ #endif /* ACPI GLOBALS */
......
/****************************************************************************** /******************************************************************************
* *
* Name: acinterp.h - Interpreter subcomponent prototypes and defines * Name: acinterp.h - Interpreter subcomponent prototypes and defines
* $Revision: 138 $ * $Revision: 139 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -194,6 +194,13 @@ acpi_ex_get_object_reference ( ...@@ -194,6 +194,13 @@ acpi_ex_get_object_reference (
acpi_operand_object **return_desc, acpi_operand_object **return_desc,
acpi_walk_state *walk_state); acpi_walk_state *walk_state);
acpi_status
acpi_ex_resolve_multiple (
acpi_walk_state *walk_state,
acpi_operand_object *operand,
acpi_object_type *return_type,
acpi_operand_object **return_desc);
acpi_status acpi_status
acpi_ex_concat_template ( acpi_ex_concat_template (
acpi_operand_object *obj_desc, acpi_operand_object *obj_desc,
......
...@@ -261,6 +261,10 @@ acpi_os_writable ( ...@@ -261,6 +261,10 @@ acpi_os_writable (
void *pointer, void *pointer,
u32 length); u32 length);
u32
acpi_os_get_timer (
void);
acpi_status acpi_status
acpi_os_signal ( acpi_os_signal (
u32 function, u32 function,
...@@ -280,6 +284,10 @@ acpi_os_vprintf ( ...@@ -280,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
...@@ -290,4 +298,16 @@ acpi_os_get_line ( ...@@ -290,4 +298,16 @@ acpi_os_get_line (
NATIVE_CHAR *buffer); NATIVE_CHAR *buffer);
/*
* Debug
*/
void
acpi_os_dbg_assert(
void *failed_assertion,
void *file_name,
u32 line_number,
NATIVE_CHAR *message);
#endif /* __ACPIOSXF_H__ */ #endif /* __ACPIOSXF_H__ */
/****************************************************************************** /******************************************************************************
* *
* Name: actypes.h - Common data types for the entire ACPI subsystem * Name: actypes.h - Common data types for the entire ACPI subsystem
* $Revision: 238 $ * $Revision: 239 $
* *
*****************************************************************************/ *****************************************************************************/
......
/****************************************************************************** /******************************************************************************
* *
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 143 $ * $Revision: 144 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -138,7 +138,7 @@ acpi_ut_allocate_owner_id ( ...@@ -138,7 +138,7 @@ acpi_ut_allocate_owner_id (
#ifndef ACPI_USE_SYSTEM_CLIBRARY #ifndef ACPI_USE_SYSTEM_CLIBRARY
u32 ACPI_SIZE
acpi_ut_strlen ( acpi_ut_strlen (
const NATIVE_CHAR *string); const NATIVE_CHAR *string);
...@@ -151,15 +151,15 @@ NATIVE_CHAR * ...@@ -151,15 +151,15 @@ NATIVE_CHAR *
acpi_ut_strncpy ( acpi_ut_strncpy (
NATIVE_CHAR *dst_string, NATIVE_CHAR *dst_string,
const NATIVE_CHAR *src_string, const NATIVE_CHAR *src_string,
NATIVE_UINT count); ACPI_SIZE count);
int int
acpi_ut_strncmp ( acpi_ut_strncmp (
const NATIVE_CHAR *string1, const NATIVE_CHAR *string1,
const NATIVE_CHAR *string2, const NATIVE_CHAR *string2,
NATIVE_UINT count); ACPI_SIZE count);
u32 int
acpi_ut_strcmp ( acpi_ut_strcmp (
const NATIVE_CHAR *string1, const NATIVE_CHAR *string1,
const NATIVE_CHAR *string2); const NATIVE_CHAR *string2);
...@@ -173,7 +173,7 @@ NATIVE_CHAR * ...@@ -173,7 +173,7 @@ NATIVE_CHAR *
acpi_ut_strncat ( acpi_ut_strncat (
NATIVE_CHAR *dst_string, NATIVE_CHAR *dst_string,
const NATIVE_CHAR *src_string, const NATIVE_CHAR *src_string,
NATIVE_UINT count); ACPI_SIZE count);
u32 u32
acpi_ut_strtoul ( acpi_ut_strtoul (
...@@ -190,13 +190,13 @@ void * ...@@ -190,13 +190,13 @@ void *
acpi_ut_memcpy ( acpi_ut_memcpy (
void *dest, void *dest,
const void *src, const void *src,
NATIVE_UINT count); ACPI_SIZE count);
void * void *
acpi_ut_memset ( acpi_ut_memset (
void *dest, void *dest,
NATIVE_UINT value, NATIVE_UINT value,
NATIVE_UINT count); ACPI_SIZE count);
int int
acpi_ut_to_upper ( acpi_ut_to_upper (
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 139 $ * $Revision: 140 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -116,7 +116,7 @@ acpi_ns_dump_pathname ( ...@@ -116,7 +116,7 @@ acpi_ns_dump_pathname (
status = acpi_ns_handle_to_pathname (handle, &buffer); status = acpi_ns_handle_to_pathname (handle, &buffer);
if (ACPI_SUCCESS (status)) { if (ACPI_SUCCESS (status)) {
acpi_os_printf ("%s %s (Node %p)\n", msg, buffer.pointer, handle); acpi_os_printf ("%s %s (Node %p)\n", msg, (char *) buffer.pointer, handle);
ACPI_MEM_FREE (buffer.pointer); ACPI_MEM_FREE (buffer.pointer);
} }
...@@ -254,10 +254,10 @@ acpi_ns_dump_one_object ( ...@@ -254,10 +254,10 @@ acpi_ns_dump_one_object (
switch (type) { switch (type) {
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
acpi_os_printf (" ID %hd Addr %.4X Len %.4X\n", acpi_os_printf (" ID %X Len %.4X Addr %p\n",
obj_desc->processor.proc_id, obj_desc->processor.proc_id,
obj_desc->processor.address, obj_desc->processor.length,
obj_desc->processor.length); (char *) obj_desc->processor.address);
break; break;
...@@ -269,8 +269,8 @@ acpi_ns_dump_one_object ( ...@@ -269,8 +269,8 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
acpi_os_printf (" Args %hd Len %.4X Aml %p \n", acpi_os_printf (" Args %X Len %.4X Aml %p\n",
obj_desc->method.param_count, (u32) obj_desc->method.param_count,
obj_desc->method.aml_length, obj_desc->method.aml_length,
obj_desc->method.aml_start); obj_desc->method.aml_start);
break; break;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsdump - table dumping routines for debug * Module Name: nsdump - table dumping routines for debug
* $Revision: 3 $ * $Revision: 4 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "acpi.h" #include "acpi.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE #define _COMPONENT ACPI_NAMESPACE
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: nsload - namespace loading/expanding/contracting procedures * Module Name: nsload - namespace loading/expanding/contracting procedures
* $Revision: 58 $ * $Revision: 59 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "acpi.h" #include "acpi.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "amlcode.h"
#include "acparser.h" #include "acparser.h"
#include "acdispat.h" #include "acdispat.h"
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psxface - Parser external interfaces * Module Name: psxface - Parser external interfaces
* $Revision: 65 $ * $Revision: 66 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "acparser.h" #include "acparser.h"
#include "acdispat.h" #include "acdispat.h"
#include "acinterp.h" #include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h" #include "acnamesp.h"
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: rsdump - Functions to display the resource structures. * Module Name: rsdump - Functions to display the resource structures.
* $Revision: 33 $ * $Revision: 34 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -865,20 +865,25 @@ acpi_rs_dump_address64 ( ...@@ -865,20 +865,25 @@ acpi_rs_dump_address64 (
ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ? ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
"" : "not "); "" : "not ");
acpi_os_printf (" Granularity: %16X\n", acpi_os_printf (" Granularity: %8.8X%8.8X\n",
address64_data->granularity); ACPI_HIDWORD (address64_data->granularity),
ACPI_LODWORD (address64_data->granularity));
acpi_os_printf (" Address range min: %16X\n", acpi_os_printf (" Address range min: %8.8X%8.8X\n",
address64_data->min_address_range); ACPI_HIDWORD (address64_data->min_address_range),
ACPI_HIDWORD (address64_data->min_address_range));
acpi_os_printf (" Address range max: %16X\n", acpi_os_printf (" Address range max: %8.8X%8.8X\n",
address64_data->max_address_range); ACPI_HIDWORD (address64_data->max_address_range),
ACPI_HIDWORD (address64_data->max_address_range));
acpi_os_printf (" Address translation offset: %16X\n", acpi_os_printf (" Address translation offset: %8.8X%8.8X\n",
address64_data->address_translation_offset); ACPI_HIDWORD (address64_data->address_translation_offset),
ACPI_HIDWORD (address64_data->address_translation_offset));
acpi_os_printf (" Address Length: %16X\n", acpi_os_printf (" Address Length: %8.8X%8.8X\n",
address64_data->address_length); ACPI_HIDWORD (address64_data->address_length),
ACPI_HIDWORD (address64_data->address_length));
if(0xFF != address64_data->resource_source.index) { if(0xFF != address64_data->resource_source.index) {
acpi_os_printf (" Resource Source Index: %X\n", acpi_os_printf (" Resource Source Index: %X\n",
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: tbget - ACPI Table get* routines * Module Name: tbget - ACPI Table get* routines
* $Revision: 79 $ * $Revision: 80 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -129,8 +129,10 @@ acpi_tb_get_table_header ( ...@@ -129,8 +129,10 @@ acpi_tb_get_table_header (
status = acpi_os_map_memory (address->pointer.physical, sizeof (acpi_table_header), status = acpi_os_map_memory (address->pointer.physical, sizeof (acpi_table_header),
(void **) &header); (void **) &header);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Could not map memory at %p for length %X\n", ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n",
address->pointer.physical, sizeof (acpi_table_header))); ACPI_HIDWORD (address->pointer.physical),
ACPI_LODWORD (address->pointer.physical),
sizeof (acpi_table_header)));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -343,8 +345,10 @@ acpi_tb_get_this_table ( ...@@ -343,8 +345,10 @@ acpi_tb_get_this_table (
status = acpi_os_map_memory (address->pointer.physical, (ACPI_SIZE) header->length, status = acpi_os_map_memory (address->pointer.physical, (ACPI_SIZE) header->length,
(void **) &full_table); (void **) &full_table);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %p for length %X\n", ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
header->signature, address->pointer.physical, header->length)); header->signature,
ACPI_HIDWORD (address->pointer.physical),
ACPI_LODWORD (address->pointer.physical), header->length));
return (status); return (status);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utcopy - Internal to external object translation utilities * Module Name: utcopy - Internal to external object translation utilities
* $Revision: 103 $ * $Revision: 104 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "acpi.h" #include "acpi.h"
#include "acnamesp.h"
#include "amlcode.h" #include "amlcode.h"
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utdebug - Debug print routines * Module Name: utdebug - Debug print routines
* $Revision: 104 $ * $Revision: 105 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -152,7 +152,7 @@ acpi_ut_debug_print ( ...@@ -152,7 +152,7 @@ acpi_ut_debug_print (
acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number); acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number);
if (ACPI_LV_THREADS & acpi_dbg_level) { if (ACPI_LV_THREADS & acpi_dbg_level) {
acpi_os_printf ("[%04lX] ", thread_id, acpi_gbl_nesting_level, dbg_info->proc_name); acpi_os_printf ("[%04lX] ", thread_id);
} }
acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name); acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name);
...@@ -516,7 +516,7 @@ acpi_ut_dump_buffer ( ...@@ -516,7 +516,7 @@ acpi_ut_dump_buffer (
while (i < count) { while (i < count) {
/* Print current offset */ /* Print current offset */
acpi_os_printf ("%05X ", i); acpi_os_printf ("%05X ", (u32) i);
/* Print 16 hex chars */ /* Print 16 hex chars */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utglobal - Global variables for the ACPI subsystem * Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 170 $ * $Revision: 171 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#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")
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utinit - Common ACPI subsystem initialization * Module Name: utinit - Common ACPI subsystem initialization
* $Revision: 113 $ * $Revision: 114 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -56,7 +56,7 @@ acpi_ut_fadt_register_error ( ...@@ -56,7 +56,7 @@ acpi_ut_fadt_register_error (
ACPI_REPORT_WARNING ( ACPI_REPORT_WARNING (
("Invalid FADT value %s=%X at offset %X FADT=%p\n", ("Invalid FADT value %s=%X at offset %X FADT=%p\n",
register_name, value, offset, acpi_gbl_FADT)); register_name, value, (u32) offset, acpi_gbl_FADT));
} }
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: utmisc - common utility procedures * Module Name: utmisc - common utility procedures
* $Revision: 80 $ * $Revision: 81 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include "acpi.h" #include "acpi.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "amlcode.h"
#include "acinterp.h"
#define _COMPONENT ACPI_UTILITIES #define _COMPONENT ACPI_UTILITIES
......
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