2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: exresolv - AML Interpreter object resolution
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2010-01-22 18:07:36 +07:00
|
|
|
* Copyright (C) 2000 - 2010, Intel Corp.
|
2005-04-17 05:20:36 +07: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>
|
2009-01-09 12:30:03 +07:00
|
|
|
#include "accommon.h"
|
|
|
|
#include "amlcode.h"
|
|
|
|
#include "acdispat.h"
|
|
|
|
#include "acinterp.h"
|
|
|
|
#include "acnamesp.h"
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#define _COMPONENT ACPI_EXECUTER
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_MODULE_NAME("exresolv")
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-04-19 09:49:35 +07:00
|
|
|
/* Local prototypes */
|
|
|
|
static acpi_status
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state);
|
2005-04-17 05:20:36 +07: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 11:44:28 +07:00
|
|
|
acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_status status;
|
2005-04-17 05:20:36 +07: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-22 04:15:00 +07:00
|
|
|
ACPI_FUNCTION_TRACE_PTR(ex_resolve_to_value, stack_ptr);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
if (!stack_ptr || !*stack_ptr) {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO, "Internal - null pointer"));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
2005-04-17 05:20:36 +07: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 11:44:28 +07: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-17 05:20:36 +07:00
|
|
|
}
|
2005-04-19 09:49:35 +07:00
|
|
|
|
|
|
|
if (!*stack_ptr) {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO, "Internal - null pointer"));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
2005-04-19 09:49:35 +07:00
|
|
|
}
|
2005-04-17 05:20:36 +07: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 11:44:28 +07: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-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr));
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ex_resolve_object_to_value
|
|
|
|
*
|
2005-04-19 09:49:35 +07:00
|
|
|
* PARAMETERS: stack_ptr - Pointer to an internal object
|
2005-04-17 05:20:36 +07:00
|
|
|
* walk_state - Current method state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2005-04-19 09:49:35 +07:00
|
|
|
* DESCRIPTION: Retrieve the value from an internal object. The Reference type
|
2005-04-17 05:20:36 +07:00
|
|
|
* uses the associated AML opcode to determine the value.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-04-19 09:49:35 +07:00
|
|
|
static acpi_status
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_status status = AE_OK;
|
|
|
|
union acpi_operand_object *stack_desc;
|
2007-02-02 23:48:21 +07:00
|
|
|
union acpi_operand_object *obj_desc = NULL;
|
2008-09-27 10:08:41 +07:00
|
|
|
u8 ref_type;
|
2005-04-17 05:20:36 +07: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-22 04:15:00 +07:00
|
|
|
ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
stack_desc = *stack_ptr;
|
|
|
|
|
2008-12-30 04:14:56 +07:00
|
|
|
/* This is a union acpi_operand_object */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2009-02-18 13:44:03 +07:00
|
|
|
switch (stack_desc->common.type) {
|
2005-04-17 05:20:36 +07:00
|
|
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
ref_type = stack_desc->reference.class;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
switch (ref_type) {
|
|
|
|
case ACPI_REFCLASS_LOCAL:
|
|
|
|
case ACPI_REFCLASS_ARG:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the local from the method's state info
|
|
|
|
* Note: this increments the local's object reference count
|
|
|
|
*/
|
2008-09-27 10:08:41 +07:00
|
|
|
status = acpi_ds_method_data_get_value(ref_type,
|
2005-08-05 11:44:28 +07:00
|
|
|
stack_desc->
|
2008-09-27 10:08:41 +07:00
|
|
|
reference.value,
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state,
|
|
|
|
&obj_desc);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07: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-22 04:15:00 +07:00
|
|
|
"[Arg/Local %X] ValueObj is %p\n",
|
2008-09-27 10:08:41 +07:00
|
|
|
stack_desc->reference.value,
|
2005-08-05 11:44:28 +07:00
|
|
|
obj_desc));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Now we can delete the original Reference Object and
|
|
|
|
* replace it with the resolved value
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
*stack_ptr = obj_desc;
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_INDEX:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
switch (stack_desc->reference.target_type) {
|
|
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
|
|
|
|
2008-04-10 22:06:41 +07:00
|
|
|
/* Just return - do not dereference */
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_PACKAGE:
|
|
|
|
|
2008-04-10 22:06:41 +07:00
|
|
|
/* If method call or copy_object - do not dereference */
|
2008-04-10 22:06:41 +07:00
|
|
|
|
2008-04-10 22:06:41 +07:00
|
|
|
if ((walk_state->opcode ==
|
|
|
|
AML_INT_METHODCALL_OP)
|
|
|
|
|| (walk_state->opcode == AML_COPY_OP)) {
|
2008-04-10 22:06:41 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-10 22:06:41 +07:00
|
|
|
/* Otherwise, dereference the package_index to a package element */
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
obj_desc = *stack_desc->reference.where;
|
|
|
|
if (obj_desc) {
|
|
|
|
/*
|
2008-04-10 22:06:41 +07:00
|
|
|
* Valid object descriptor, copy pointer to return value
|
2005-04-17 05:20:36 +07:00
|
|
|
* (i.e., dereference the package index)
|
|
|
|
* Delete the ref object, increment the returned object
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
|
|
|
acpi_ut_add_reference(obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
*stack_ptr = obj_desc;
|
2005-08-05 11:44:28 +07:00
|
|
|
} else {
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2008-04-10 22:06:41 +07:00
|
|
|
* A NULL object descriptor means an uninitialized element of
|
2005-04-17 05:20:36 +07:00
|
|
|
* the package, can't dereference it
|
|
|
|
*/
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2008-04-10 22:06:41 +07:00
|
|
|
"Attempt to dereference an Index to NULL package element Idx=%p",
|
2006-01-28 04:43:00 +07:00
|
|
|
stack_desc));
|
2005-04-17 05:20:36 +07:00
|
|
|
status = AE_AML_UNINITIALIZED_ELEMENT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
/* Invalid reference object */
|
|
|
|
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2008-04-10 22:06:41 +07:00
|
|
|
"Unknown TargetType %X in Index/Reference object %p",
|
2006-01-28 04:43:00 +07:00
|
|
|
stack_desc->reference.target_type,
|
|
|
|
stack_desc));
|
2005-04-17 05:20:36 +07:00
|
|
|
status = AE_AML_INTERNAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_REFOF:
|
|
|
|
case ACPI_REFCLASS_DEBUG:
|
|
|
|
case ACPI_REFCLASS_TABLE:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2008-04-10 22:06:41 +07:00
|
|
|
/* Just leave the object as-is, do not dereference */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_NAME: /* Reference to a named object */
|
2005-04-19 09:49:35 +07:00
|
|
|
|
2006-06-09 03:29:00 +07:00
|
|
|
/* Dereference the name */
|
|
|
|
|
|
|
|
if ((stack_desc->reference.node->type ==
|
|
|
|
ACPI_TYPE_DEVICE)
|
|
|
|
|| (stack_desc->reference.node->type ==
|
|
|
|
ACPI_TYPE_THERMAL)) {
|
|
|
|
|
|
|
|
/* These node types do not have 'real' subobjects */
|
|
|
|
|
|
|
|
*stack_ptr = (void *)stack_desc->reference.node;
|
|
|
|
} else {
|
|
|
|
/* Get the object pointed to by the namespace node */
|
|
|
|
|
|
|
|
*stack_ptr =
|
|
|
|
(stack_desc->reference.node)->object;
|
|
|
|
acpi_ut_add_reference(*stack_ptr);
|
|
|
|
}
|
2005-04-19 09:49:35 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(stack_desc);
|
2005-04-19 09:49:35 +07:00
|
|
|
break;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
default:
|
|
|
|
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2008-09-27 10:08:41 +07:00
|
|
|
"Unknown Reference type %X in %p", ref_type,
|
2006-01-28 04:43:00 +07:00
|
|
|
stack_desc));
|
2005-04-17 05:20:36 +07:00
|
|
|
status = AE_AML_INTERNAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_BUFFER:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_get_buffer_arguments(stack_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_PACKAGE:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_get_package_arguments(stack_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
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 11:44:28 +07: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-22 04:15:00 +07:00
|
|
|
"FieldRead SourceDesc=%p Type=%X\n",
|
2009-02-18 13:44:03 +07:00
|
|
|
stack_desc, stack_desc->common.type));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ex_read_data_from_field(walk_state, stack_desc,
|
|
|
|
&obj_desc);
|
2007-02-02 23:48:21 +07:00
|
|
|
|
|
|
|
/* Remove a reference to the original operand, then override */
|
|
|
|
|
|
|
|
acpi_ut_remove_reference(*stack_ptr);
|
2005-08-05 11:44:28 +07:00
|
|
|
*stack_ptr = (void *)obj_desc;
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07: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 11:44:28 +07: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-17 05:20:36 +07:00
|
|
|
{
|
2005-08-05 11:44:28 +07:00
|
|
|
union acpi_operand_object *obj_desc = (void *)operand;
|
|
|
|
struct acpi_namespace_node *node;
|
|
|
|
acpi_object_type type;
|
|
|
|
acpi_status status;
|
2005-04-17 05:20:36 +07: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-22 04:15:00 +07:00
|
|
|
ACPI_FUNCTION_TRACE(acpi_ex_resolve_multiple);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-04-19 09:49:35 +07:00
|
|
|
/* Operand can be either a namespace node or an operand descriptor */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
case ACPI_DESC_TYPE_OPERAND:
|
|
|
|
type = obj_desc->common.type;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_DESC_TYPE_NAMED:
|
2005-08-05 11:44:28 +07:00
|
|
|
type = ((struct acpi_namespace_node *)obj_desc)->type;
|
|
|
|
obj_desc =
|
|
|
|
acpi_ns_get_attached_object((struct acpi_namespace_node *)
|
|
|
|
obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* If we had an Alias node, use the attached object for type info */
|
|
|
|
|
|
|
|
if (type == ACPI_TYPE_LOCAL_ALIAS) {
|
2005-08-05 11:44:28 +07:00
|
|
|
type = ((struct acpi_namespace_node *)obj_desc)->type;
|
|
|
|
obj_desc =
|
|
|
|
acpi_ns_get_attached_object((struct
|
|
|
|
acpi_namespace_node *)
|
|
|
|
obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-04-19 09:49:35 +07:00
|
|
|
/* If type is anything other than a reference, we are done */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
if (type != ACPI_TYPE_LOCAL_REFERENCE) {
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-04-10 22:06:42 +07:00
|
|
|
* For reference objects created via the ref_of, Index, or Load/load_table
|
|
|
|
* 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-04-17 05:20:36 +07:00
|
|
|
*/
|
2009-02-18 13:44:03 +07:00
|
|
|
while (obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) {
|
2008-09-27 10:08:41 +07:00
|
|
|
switch (obj_desc->reference.class) {
|
|
|
|
case ACPI_REFCLASS_REFOF:
|
|
|
|
case ACPI_REFCLASS_NAME:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Dereference the reference pointer */
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
if (obj_desc->reference.class == ACPI_REFCLASS_REFOF) {
|
2006-10-02 11:00:00 +07:00
|
|
|
node = obj_desc->reference.object;
|
|
|
|
} else { /* AML_INT_NAMEPATH_OP */
|
|
|
|
|
|
|
|
node = obj_desc->reference.node;
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* All "References" point to a NS node */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
|
|
|
|
ACPI_DESC_TYPE_NAMED) {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
|
|
|
|
node,
|
|
|
|
acpi_ut_get_descriptor_name(node)));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_INTERNAL);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the attached object */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
obj_desc = acpi_ns_get_attached_object(node);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (!obj_desc) {
|
2006-10-02 11:00:00 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* No object, use the NS node type */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
type = acpi_ns_get_type(node);
|
2005-04-17 05:20:36 +07:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for circular references */
|
|
|
|
|
|
|
|
if (obj_desc == operand) {
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_INDEX:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* 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 11:00:00 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* NULL package elements are allowed */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
type = 0; /* Uninitialized */
|
2005-04-17 05:20:36 +07:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_TABLE:
|
2008-04-10 22:06:42 +07:00
|
|
|
|
|
|
|
type = ACPI_TYPE_DDB_HANDLE;
|
|
|
|
goto exit;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_LOCAL:
|
|
|
|
case ACPI_REFCLASS_ARG:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
if (return_desc) {
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ds_method_data_get_value(obj_desc->
|
|
|
|
reference.
|
2008-09-27 10:08:41 +07:00
|
|
|
class,
|
2005-08-05 11:44:28 +07:00
|
|
|
obj_desc->
|
|
|
|
reference.
|
2008-09-27 10:08:41 +07:00
|
|
|
value,
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state,
|
|
|
|
&obj_desc);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(obj_desc);
|
|
|
|
} else {
|
|
|
|
status =
|
|
|
|
acpi_ds_method_data_get_node(obj_desc->
|
|
|
|
reference.
|
2008-09-27 10:08:41 +07:00
|
|
|
class,
|
2005-08-05 11:44:28 +07:00
|
|
|
obj_desc->
|
|
|
|
reference.
|
2008-09-27 10:08:41 +07:00
|
|
|
value,
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state,
|
|
|
|
&node);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
obj_desc = acpi_ns_get_attached_object(node);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (!obj_desc) {
|
|
|
|
type = ACPI_TYPE_ANY;
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-09-27 10:08:41 +07:00
|
|
|
case ACPI_REFCLASS_DEBUG:
|
2005-04-17 05:20:36 +07: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-22 04:15:00 +07:00
|
|
|
/* The Debug Object is of type "DebugObject" */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
type = ACPI_TYPE_DEBUG_OBJECT;
|
|
|
|
goto exit;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2008-09-27 10:08:41 +07:00
|
|
|
"Unknown Reference Class %2.2X",
|
|
|
|
obj_desc->reference.class));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_INTERNAL);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now we are guaranteed to have an object that has not been created
|
|
|
|
* via the ref_of or Index operators.
|
|
|
|
*/
|
2009-02-18 13:44:03 +07:00
|
|
|
type = obj_desc->common.type;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
exit:
|
2005-04-17 05:20:36 +07: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 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|