2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: exresolv - AML Interpreter object resolution
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2006-01-13 16:22:00 -05:00
|
|
|
* Copyright (C) 2000 - 2006, R. Byron Moore
|
2005-04-16 18:20:36 -04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
|
|
|
* without modification.
|
|
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
|
|
* including a substantially similar Disclaimer requirement for further
|
|
|
|
* binary redistribution.
|
|
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
|
|
* of any contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
|
|
|
*
|
|
|
|
* NO WARRANTY
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <acpi/acpi.h>
|
|
|
|
#include <acpi/amlcode.h>
|
|
|
|
#include <acpi/acdispat.h>
|
|
|
|
#include <acpi/acinterp.h>
|
|
|
|
#include <acpi/acnamesp.h>
|
|
|
|
#include <acpi/acparser.h>
|
|
|
|
|
|
|
|
#define _COMPONENT ACPI_EXECUTER
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_MODULE_NAME("exresolv")
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* Local prototypes */
|
|
|
|
static acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ex_resolve_to_value
|
|
|
|
*
|
|
|
|
* PARAMETERS: **stack_ptr - Points to entry on obj_stack, which can
|
|
|
|
* be either an (union acpi_operand_object *)
|
|
|
|
* or an acpi_handle.
|
|
|
|
* walk_state - Current method state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Convert Reference objects to values
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status status;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE_PTR(ex_resolve_to_value, stack_ptr);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (!stack_ptr || !*stack_ptr) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO, "Internal - null pointer"));
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The entity pointed to by the stack_ptr can be either
|
|
|
|
* 1) A valid union acpi_operand_object, or
|
|
|
|
* 2) A struct acpi_namespace_node (named_obj)
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
if (ACPI_GET_DESCRIPTOR_TYPE(*stack_ptr) == ACPI_DESC_TYPE_OPERAND) {
|
|
|
|
status = acpi_ex_resolve_object_to_value(stack_ptr, walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
2005-04-18 22:49:35 -04:00
|
|
|
|
|
|
|
if (!*stack_ptr) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO, "Internal - null pointer"));
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
2005-04-18 22:49:35 -04:00
|
|
|
}
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Object on the stack may have changed if acpi_ex_resolve_object_to_value()
|
|
|
|
* was called (i.e., we can't use an _else_ here.)
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
if (ACPI_GET_DESCRIPTOR_TYPE(*stack_ptr) == ACPI_DESC_TYPE_NAMED) {
|
|
|
|
status =
|
|
|
|
acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR
|
|
|
|
(struct acpi_namespace_node,
|
|
|
|
stack_ptr), walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr));
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ex_resolve_object_to_value
|
|
|
|
*
|
2005-04-18 22:49:35 -04:00
|
|
|
* PARAMETERS: stack_ptr - Pointer to an internal object
|
2005-04-16 18:20:36 -04:00
|
|
|
* walk_state - Current method state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2005-04-18 22:49:35 -04:00
|
|
|
* DESCRIPTION: Retrieve the value from an internal object. The Reference type
|
2005-04-16 18:20:36 -04:00
|
|
|
* uses the associated AML opcode to determine the value.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
static acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status status = AE_OK;
|
|
|
|
union acpi_operand_object *stack_desc;
|
|
|
|
void *temp_node;
|
|
|
|
union acpi_operand_object *obj_desc;
|
|
|
|
u16 opcode;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
stack_desc = *stack_ptr;
|
|
|
|
|
|
|
|
/* This is an union acpi_operand_object */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
switch (ACPI_GET_OBJECT_TYPE(stack_desc)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
|
|
|
|
|
|
|
opcode = stack_desc->reference.opcode;
|
|
|
|
|
|
|
|
switch (opcode) {
|
|
|
|
case AML_NAME_OP:
|
|
|
|
|
|
|
|
/*
|
2005-04-18 22:49:35 -04:00
|
|
|
* Convert name reference to a namespace node
|
2005-04-16 18:20:36 -04:00
|
|
|
* Then, acpi_ex_resolve_node_to_value can be used to get the value
|
|
|
|
*/
|
|
|
|
temp_node = stack_desc->reference.object;
|
|
|
|
|
|
|
|
/* Delete the Reference Object */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* Return the namespace node */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
(*stack_ptr) = temp_node;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_LOCAL_OP:
|
|
|
|
case AML_ARG_OP:
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the local from the method's state info
|
|
|
|
* Note: this increments the local's object reference count
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_ds_method_data_get_value(opcode,
|
|
|
|
stack_desc->
|
|
|
|
reference.offset,
|
|
|
|
walk_state,
|
|
|
|
&obj_desc);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
"[Arg/Local %X] ValueObj is %p\n",
|
2005-08-05 00:44:28 -04:00
|
|
|
stack_desc->reference.offset,
|
|
|
|
obj_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Now we can delete the original Reference Object and
|
|
|
|
* replace it with the resolved value
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
*stack_ptr = obj_desc;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_INDEX_OP:
|
|
|
|
|
|
|
|
switch (stack_desc->reference.target_type) {
|
|
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
|
|
|
|
|
|
|
/* Just return - leave the Reference on the stack */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_PACKAGE:
|
|
|
|
|
|
|
|
obj_desc = *stack_desc->reference.where;
|
|
|
|
if (obj_desc) {
|
|
|
|
/*
|
|
|
|
* Valid obj descriptor, copy pointer to return value
|
|
|
|
* (i.e., dereference the package index)
|
|
|
|
* Delete the ref object, increment the returned object
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
|
|
|
acpi_ut_add_reference(obj_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
*stack_ptr = obj_desc;
|
2005-08-05 00:44:28 -04:00
|
|
|
} else {
|
2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* A NULL object descriptor means an unitialized element of
|
|
|
|
* the package, can't dereference it
|
|
|
|
*/
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Attempt to deref an Index to NULL pkg element Idx=%p",
|
|
|
|
stack_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
status = AE_AML_UNINITIALIZED_ELEMENT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
/* Invalid reference object */
|
|
|
|
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
"Unknown TargetType %X in Index/Reference obj %p",
|
2006-01-27 16:43:00 -05:00
|
|
|
stack_desc->reference.target_type,
|
|
|
|
stack_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
status = AE_AML_INTERNAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_REF_OF_OP:
|
|
|
|
case AML_DEBUG_OP:
|
|
|
|
case AML_LOAD_OP:
|
|
|
|
|
|
|
|
/* Just leave the object as-is */
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
case AML_INT_NAMEPATH_OP: /* Reference to a named object */
|
2005-04-18 22:49:35 -04:00
|
|
|
|
|
|
|
/* Get the object pointed to by the namespace node */
|
|
|
|
|
|
|
|
*stack_ptr = (stack_desc->reference.node)->object;
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ut_add_reference(*stack_ptr);
|
|
|
|
acpi_ut_remove_reference(stack_desc);
|
2005-04-18 22:49:35 -04:00
|
|
|
break;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
default:
|
|
|
|
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Unknown Reference opcode %X (%s) in %p",
|
|
|
|
opcode, acpi_ps_get_opcode_name(opcode),
|
|
|
|
stack_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
status = AE_AML_INTERNAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_BUFFER:
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_ds_get_buffer_arguments(stack_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_PACKAGE:
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_ds_get_package_arguments(stack_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
break;
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
/* These cases may never happen here, but just in case.. */
|
2005-04-18 22:49:35 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
|
|
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
|
|
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
|
|
|
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
"FieldRead SourceDesc=%p Type=%X\n",
|
2005-08-05 00:44:28 -04:00
|
|
|
stack_desc,
|
|
|
|
ACPI_GET_OBJECT_TYPE(stack_desc)));
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status =
|
|
|
|
acpi_ex_read_data_from_field(walk_state, stack_desc,
|
|
|
|
&obj_desc);
|
|
|
|
*stack_ptr = (void *)obj_desc;
|
2005-04-16 18:20:36 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* 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
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_operand_object *operand,
|
|
|
|
acpi_object_type * return_type,
|
|
|
|
union acpi_operand_object **return_desc)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
union acpi_operand_object *obj_desc = (void *)operand;
|
|
|
|
struct acpi_namespace_node *node;
|
|
|
|
acpi_object_type type;
|
|
|
|
acpi_status status;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(acpi_ex_resolve_multiple);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* Operand can be either a namespace node or an operand descriptor */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
case ACPI_DESC_TYPE_OPERAND:
|
|
|
|
type = obj_desc->common.type;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_DESC_TYPE_NAMED:
|
2005-08-05 00:44:28 -04:00
|
|
|
type = ((struct acpi_namespace_node *)obj_desc)->type;
|
|
|
|
obj_desc =
|
|
|
|
acpi_ns_get_attached_object((struct acpi_namespace_node *)
|
|
|
|
obj_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* If we had an Alias node, use the attached object for type info */
|
|
|
|
|
|
|
|
if (type == ACPI_TYPE_LOCAL_ALIAS) {
|
2005-08-05 00:44:28 -04:00
|
|
|
type = ((struct acpi_namespace_node *)obj_desc)->type;
|
|
|
|
obj_desc =
|
|
|
|
acpi_ns_get_attached_object((struct
|
|
|
|
acpi_namespace_node *)
|
|
|
|
obj_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* If type is anything other than a reference, we are done */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (type != ACPI_TYPE_LOCAL_REFERENCE) {
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
|
2005-04-16 18:20:36 -04:00
|
|
|
switch (obj_desc->reference.opcode) {
|
|
|
|
case AML_REF_OF_OP:
|
2006-10-02 00:00:00 -04:00
|
|
|
case AML_INT_NAMEPATH_OP:
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Dereference the reference pointer */
|
|
|
|
|
2006-10-02 00:00:00 -04:00
|
|
|
if (obj_desc->reference.opcode == AML_REF_OF_OP) {
|
|
|
|
node = obj_desc->reference.object;
|
|
|
|
} else { /* AML_INT_NAMEPATH_OP */
|
|
|
|
|
|
|
|
node = obj_desc->reference.node;
|
|
|
|
}
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* All "References" point to a NS node */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
|
|
|
|
ACPI_DESC_TYPE_NAMED) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
|
|
|
|
node,
|
|
|
|
acpi_ut_get_descriptor_name(node)));
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_INTERNAL);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the attached object */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
obj_desc = acpi_ns_get_attached_object(node);
|
2005-04-16 18:20:36 -04:00
|
|
|
if (!obj_desc) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* No object, use the NS node type */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
type = acpi_ns_get_type(node);
|
2005-04-16 18:20:36 -04:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for circular references */
|
|
|
|
|
|
|
|
if (obj_desc == operand) {
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
if (!obj_desc) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* NULL package elements are allowed */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
type = 0; /* Uninitialized */
|
2005-04-16 18:20:36 -04:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_LOCAL_OP:
|
|
|
|
case AML_ARG_OP:
|
|
|
|
|
|
|
|
if (return_desc) {
|
2005-08-05 00:44:28 -04:00
|
|
|
status =
|
|
|
|
acpi_ds_method_data_get_value(obj_desc->
|
|
|
|
reference.
|
|
|
|
opcode,
|
|
|
|
obj_desc->
|
|
|
|
reference.
|
|
|
|
offset,
|
|
|
|
walk_state,
|
|
|
|
&obj_desc);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_ut_remove_reference(obj_desc);
|
|
|
|
} else {
|
|
|
|
status =
|
|
|
|
acpi_ds_method_data_get_node(obj_desc->
|
|
|
|
reference.
|
|
|
|
opcode,
|
|
|
|
obj_desc->
|
|
|
|
reference.
|
|
|
|
offset,
|
|
|
|
walk_state,
|
|
|
|
&node);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
obj_desc = acpi_ns_get_attached_object(node);
|
2005-04-16 18:20:36 -04:00
|
|
|
if (!obj_desc) {
|
|
|
|
type = ACPI_TYPE_ANY;
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_DEBUG_OP:
|
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
/* The Debug Object is of type "DebugObject" */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
type = ACPI_TYPE_DEBUG_OBJECT;
|
|
|
|
goto exit;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Unknown Reference subtype %X",
|
|
|
|
obj_desc->reference.opcode));
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_INTERNAL);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now we are guaranteed to have an object that has not been created
|
|
|
|
* via the ref_of or Index operators.
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
type = ACPI_GET_OBJECT_TYPE(obj_desc);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
exit:
|
2005-04-16 18:20:36 -04:00
|
|
|
/* Convert internal types to external types */
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
|
|
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
|
|
|
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
|
|
|
|
|
|
|
type = ACPI_TYPE_FIELD_UNIT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_LOCAL_SCOPE:
|
|
|
|
|
|
|
|
/* Per ACPI Specification, Scope is untyped */
|
|
|
|
|
|
|
|
type = ACPI_TYPE_ANY;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* No change to Type required */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
*return_type = type;
|
|
|
|
if (return_desc) {
|
|
|
|
*return_desc = obj_desc;
|
|
|
|
}
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|