2005-04-17 05:20:36 +07:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: dswexec - Dispatcher method execution callbacks;
|
|
|
|
* dispatch to interpreter.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2015-02-05 14:20:45 +07:00
|
|
|
* Copyright (C) 2000 - 2015, 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 "acparser.h"
|
|
|
|
#include "amlcode.h"
|
|
|
|
#include "acdispat.h"
|
|
|
|
#include "acinterp.h"
|
|
|
|
#include "acnamesp.h"
|
|
|
|
#include "acdebug.h"
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#define _COMPONENT ACPI_DISPATCHER
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_MODULE_NAME("dswexec")
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Dispatch table for opcode classes
|
|
|
|
*/
|
2012-10-31 09:25:36 +07:00
|
|
|
static acpi_execute_op acpi_gbl_op_type_dispatch[] = {
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ex_opcode_0A_0T_1R,
|
|
|
|
acpi_ex_opcode_1A_0T_0R,
|
|
|
|
acpi_ex_opcode_1A_0T_1R,
|
|
|
|
acpi_ex_opcode_1A_1T_0R,
|
|
|
|
acpi_ex_opcode_1A_1T_1R,
|
|
|
|
acpi_ex_opcode_2A_0T_0R,
|
|
|
|
acpi_ex_opcode_2A_0T_1R,
|
|
|
|
acpi_ex_opcode_2A_1T_1R,
|
|
|
|
acpi_ex_opcode_2A_2T_1R,
|
|
|
|
acpi_ex_opcode_3A_0T_0R,
|
|
|
|
acpi_ex_opcode_3A_1T_1R,
|
|
|
|
acpi_ex_opcode_6A_0T_1R
|
|
|
|
};
|
2005-04-19 09:49:35 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_get_predicate_value
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - Current state of the parse tree walk
|
2005-04-19 09:49:35 +07:00
|
|
|
* result_obj - if non-zero, pop result from result stack
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Get the result of a predicate evaluation
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_operand_object *result_obj)
|
|
|
|
{
|
|
|
|
acpi_status status = AE_OK;
|
|
|
|
union acpi_operand_object *obj_desc;
|
|
|
|
union acpi_operand_object *local_obj_desc = NULL;
|
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(ds_get_predicate_value, walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
walk_state->control_state->common.state = 0;
|
|
|
|
|
|
|
|
if (result_obj) {
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_result_pop(&obj_desc, walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status,
|
|
|
|
"Could not get result from predicate evaluation"));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
2005-08-05 11:44:28 +07:00
|
|
|
} else {
|
|
|
|
status = acpi_ds_create_operand(walk_state, walk_state->op, 0);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ex_resolve_to_value(&walk_state->operands[0],
|
|
|
|
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
|
|
|
obj_desc = walk_state->operands[0];
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!obj_desc) {
|
2006-01-28 04:43:00 +07: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-22 04:15:00 +07:00
|
|
|
"No predicate ObjDesc=%p State=%p",
|
2006-01-28 04:43:00 +07:00
|
|
|
obj_desc, walk_state));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Result of predicate evaluation must be an Integer
|
|
|
|
* object. Implicitly convert the argument if necessary.
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc, 16);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2009-02-18 13:44:03 +07:00
|
|
|
if (local_obj_desc->common.type != ACPI_TYPE_INTEGER) {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2010-03-05 16:56:40 +07:00
|
|
|
"Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
|
2009-02-18 13:44:03 +07:00
|
|
|
obj_desc, walk_state, obj_desc->common.type));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
status = AE_AML_OPERAND_TYPE;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Truncate the predicate to 32-bits if necessary */
|
|
|
|
|
2012-12-31 07:07:18 +07:00
|
|
|
(void)acpi_ex_truncate_for32bit_table(local_obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Save the result of the predicate evaluation on
|
|
|
|
* the control stack
|
|
|
|
*/
|
|
|
|
if (local_obj_desc->integer.value) {
|
|
|
|
walk_state->control_state->common.value = TRUE;
|
2005-08-05 11:44:28 +07:00
|
|
|
} else {
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Predicate is FALSE, we will just toss the
|
|
|
|
* rest of the package
|
|
|
|
*/
|
|
|
|
walk_state->control_state->common.value = FALSE;
|
|
|
|
status = AE_CTRL_FALSE;
|
|
|
|
}
|
|
|
|
|
ACPICA: Fix for implicit return compatibility
Predicate can be used for an implicit return value.
This change improves the implicit return mechanism to be more
compatible with the MS interpreter.
http://www.acpica.org/bugzilla/show_bug.cgi?id=349
Below AML code from http://bugzilla.kernel.org/show_bug.cgi?id=10686
Store(0x07D6, OSYS)
Method (_CRT, 0, Serialized)
{
If (LLess (OSYS, 0x07D6))
{
If (LEqual (\_SB.TJ85, Zero))
{
Return (Add (0x0AAC, Multiply (TPC, 0x0A)))
}
Else
{
Return (Add (0x0AAC, Multiply (TP85, 0x0A)))
}
}
}
Previously _CRT returns 0x07D6, now it returns 0 (predicate value of LLess)
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-09-27 11:01:12 +07:00
|
|
|
/* Predicate can be used for an implicit return value */
|
|
|
|
|
|
|
|
(void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE);
|
|
|
|
|
2013-10-29 08:30:02 +07:00
|
|
|
cleanup:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
|
|
|
|
walk_state->control_state->common.value,
|
|
|
|
walk_state->op));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
/* Break to debugger to display result */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUGGER_EXEC(acpi_db_display_result_object
|
|
|
|
(local_obj_desc, walk_state));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Delete the predicate result object (we know that
|
|
|
|
* we don't need it anymore)
|
|
|
|
*/
|
|
|
|
if (local_obj_desc != obj_desc) {
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(local_obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_remove_reference(obj_desc);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
walk_state->control_state->common.state = ACPI_CONTROL_NORMAL;
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_exec_begin_op
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - Current state of the parse tree walk
|
2005-04-19 09:49:35 +07:00
|
|
|
* out_op - Where to return op if a new one is created
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Descending callback used during the execution of control
|
2012-10-31 09:26:55 +07:00
|
|
|
* methods. This is where most operators and operands are
|
2005-04-17 05:20:36 +07:00
|
|
|
* dispatched to the interpreter.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_parse_object **out_op)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2005-08-05 11:44:28 +07:00
|
|
|
union acpi_parse_object *op;
|
|
|
|
acpi_status status = AE_OK;
|
|
|
|
u32 opcode_class;
|
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(ds_exec_begin_op, walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
op = walk_state->op;
|
|
|
|
if (!op) {
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_load2_begin_op(walk_state, out_op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2007-02-02 23:48:21 +07:00
|
|
|
goto error_exit;
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
op = *out_op;
|
|
|
|
walk_state->op = op;
|
|
|
|
walk_state->opcode = op->common.aml_opcode;
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state->op_info =
|
|
|
|
acpi_ps_get_opcode_info(op->common.aml_opcode);
|
|
|
|
|
|
|
|
if (acpi_ns_opens_scope(walk_state->op_info->object_type)) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
|
|
|
"(%s) Popping scope for Op %p\n",
|
|
|
|
acpi_ut_get_type_name(walk_state->
|
|
|
|
op_info->
|
|
|
|
object_type),
|
|
|
|
op));
|
|
|
|
|
|
|
|
status = acpi_ds_scope_stack_pop(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2007-02-02 23:48:21 +07:00
|
|
|
goto error_exit;
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (op == walk_state->origin) {
|
|
|
|
if (out_op) {
|
|
|
|
*out_op = op;
|
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the previous opcode was a conditional, this opcode
|
|
|
|
* must be the beginning of the associated predicate.
|
|
|
|
* Save this knowledge in the current scope descriptor
|
|
|
|
*/
|
|
|
|
if ((walk_state->control_state) &&
|
2005-08-05 11:44:28 +07:00
|
|
|
(walk_state->control_state->common.state ==
|
|
|
|
ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
|
|
"Exec predicate Op=%p State=%p\n", op,
|
|
|
|
walk_state));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state->control_state->common.state =
|
|
|
|
ACPI_CONTROL_PREDICATE_EXECUTING;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Save start of predicate */
|
|
|
|
|
|
|
|
walk_state->control_state->control.predicate_op = op;
|
|
|
|
}
|
|
|
|
|
|
|
|
opcode_class = walk_state->op_info->class;
|
|
|
|
|
|
|
|
/* We want to send namepaths to the load code */
|
|
|
|
|
|
|
|
if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
|
|
|
|
opcode_class = AML_CLASS_NAMED_OBJECT;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle the opcode based upon the opcode type
|
|
|
|
*/
|
|
|
|
switch (opcode_class) {
|
|
|
|
case AML_CLASS_CONTROL:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_exec_begin_control_op(walk_state, op);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_CLASS_NAMED_OBJECT:
|
|
|
|
|
2006-05-27 03:36:00 +07:00
|
|
|
if (walk_state->walk_type & ACPI_WALK_METHOD) {
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2005-04-19 09:49:35 +07:00
|
|
|
* Found a named object declaration during method execution;
|
2012-10-31 09:26:55 +07:00
|
|
|
* we must enter this object into the namespace. The created
|
2005-04-19 09:49:35 +07:00
|
|
|
* object is temporary and will be deleted upon completion of
|
|
|
|
* the execution of this method.
|
2010-10-23 12:36:40 +07:00
|
|
|
*
|
|
|
|
* Note 10/2010: Except for the Scope() op. This opcode does
|
|
|
|
* not actually create a new object, it refers to an existing
|
|
|
|
* object. However, for Scope(), we want to indeed open a
|
|
|
|
* new scope.
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
2010-10-23 12:36:40 +07:00
|
|
|
if (op->common.aml_opcode != AML_SCOPE_OP) {
|
|
|
|
status =
|
|
|
|
acpi_ds_load2_begin_op(walk_state, NULL);
|
|
|
|
} else {
|
|
|
|
status =
|
|
|
|
acpi_ds_scope_stack_push(op->named.node,
|
|
|
|
op->named.node->
|
|
|
|
type, walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
|
|
|
}
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_CLASS_EXECUTE:
|
|
|
|
case AML_CLASS_CREATE:
|
2008-04-10 22:06:36 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-06-08 07:58:14 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Nothing to do here during method execution */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2007-02-02 23:48:21 +07:00
|
|
|
|
2013-10-29 08:30:02 +07:00
|
|
|
error_exit:
|
2007-02-02 23:48:21 +07:00
|
|
|
status = acpi_ds_method_error(status, walk_state);
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_exec_end_op
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - Current state of the parse tree walk
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Ascending callback used during the execution of control
|
2012-10-31 09:26:55 +07:00
|
|
|
* methods. The only thing we really need to do here is to
|
2005-04-17 05:20:36 +07:00
|
|
|
* notice the beginning of IF, ELSE, and WHILE blocks.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2005-08-05 11:44:28 +07:00
|
|
|
union acpi_parse_object *op;
|
|
|
|
acpi_status status = AE_OK;
|
|
|
|
u32 op_type;
|
|
|
|
u32 op_class;
|
|
|
|
union acpi_parse_object *next_op;
|
|
|
|
union acpi_parse_object *first_arg;
|
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(ds_exec_end_op, walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
op = walk_state->op;
|
2005-04-17 05:20:36 +07:00
|
|
|
op_type = walk_state->op_info->type;
|
|
|
|
op_class = walk_state->op_info->class;
|
|
|
|
|
|
|
|
if (op_class == AML_CLASS_UNKNOWN) {
|
2010-03-05 16:56:40 +07:00
|
|
|
ACPI_ERROR((AE_INFO, "Unknown opcode 0x%X",
|
2006-01-28 04:43:00 +07:00
|
|
|
op->common.aml_opcode));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
first_arg = op->common.value.arg;
|
|
|
|
|
|
|
|
/* Init the walk state */
|
|
|
|
|
|
|
|
walk_state->num_operands = 0;
|
2008-04-10 22:06:36 +07:00
|
|
|
walk_state->operand_index = 0;
|
2005-04-17 05:20:36 +07:00
|
|
|
walk_state->return_desc = NULL;
|
|
|
|
walk_state->result_obj = NULL;
|
|
|
|
|
|
|
|
/* Call debugger for single step support (DEBUG build only) */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUGGER_EXEC(status =
|
|
|
|
acpi_db_single_step(walk_state, op, op_class));
|
|
|
|
ACPI_DEBUGGER_EXEC(if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);}
|
|
|
|
) ;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Decode the Opcode Class */
|
|
|
|
|
|
|
|
switch (op_class) {
|
2008-04-10 22:06:37 +07:00
|
|
|
case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
|
|
|
|
|
|
|
|
if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
|
|
|
|
status = acpi_ds_evaluate_name_path(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
2008-04-10 22:06:37 +07:00
|
|
|
case AML_CLASS_EXECUTE: /* Most operators with arguments */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Build resolved operand stack */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_create_operands(walk_state, first_arg);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* All opcodes require operand resolution, with the only exceptions
|
|
|
|
* being the object_type and size_of operators.
|
|
|
|
*/
|
|
|
|
if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) {
|
2006-10-02 11:00:00 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* Resolve all operands */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ex_resolve_operands(walk_state->opcode,
|
|
|
|
&(walk_state->
|
|
|
|
operands
|
|
|
|
[walk_state->
|
|
|
|
num_operands - 1]),
|
|
|
|
walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
if (ACPI_SUCCESS(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Dispatch the request to the appropriate interpreter handler
|
2012-10-31 09:26:55 +07:00
|
|
|
* routine. There is one routine per opcode "type" based upon the
|
2005-04-17 05:20:36 +07:00
|
|
|
* number of opcode arguments and return type.
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_gbl_op_type_dispatch[op_type] (walk_state);
|
|
|
|
} else {
|
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
|
|
|
* Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
|
2005-04-17 05:20:36 +07:00
|
|
|
* Local is uninitialized.
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
if ((status == AE_AML_UNINITIALIZED_LOCAL) &&
|
|
|
|
(walk_state->opcode == AML_STORE_OP) &&
|
|
|
|
(walk_state->operands[0]->common.type ==
|
|
|
|
ACPI_TYPE_LOCAL_REFERENCE)
|
|
|
|
&& (walk_state->operands[1]->common.type ==
|
|
|
|
ACPI_TYPE_LOCAL_REFERENCE)
|
2008-09-27 10:08:41 +07:00
|
|
|
&& (walk_state->operands[0]->reference.class ==
|
|
|
|
walk_state->operands[1]->reference.class)
|
|
|
|
&& (walk_state->operands[0]->reference.value ==
|
|
|
|
walk_state->operands[1]->reference.value)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
status = AE_OK;
|
2005-08-05 11:44:28 +07:00
|
|
|
} else {
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status,
|
|
|
|
"While resolving operands for [%s]",
|
|
|
|
acpi_ps_get_opcode_name
|
|
|
|
(walk_state->opcode)));
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Always delete the argument objects and clear the operand stack */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ds_clear_operands(walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If a result object was returned from above, push it on the
|
|
|
|
* current result stack
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
if (ACPI_SUCCESS(status) && walk_state->result_obj) {
|
|
|
|
status =
|
|
|
|
acpi_ds_result_push(walk_state->result_obj,
|
|
|
|
walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
switch (op_type) {
|
2005-08-05 11:44:28 +07:00
|
|
|
case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* 1 Operand, 0 external_result, 0 internal_result */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_exec_end_control_op(walk_state, op);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_TYPE_METHOD_CALL:
|
|
|
|
/*
|
|
|
|
* If the method is referenced from within a package
|
|
|
|
* declaration, it is not a invocation of the method, just
|
|
|
|
* a reference to it.
|
|
|
|
*/
|
|
|
|
if ((op->asl.parent) &&
|
2005-08-05 11:44:28 +07:00
|
|
|
((op->asl.parent->asl.aml_opcode == AML_PACKAGE_OP)
|
|
|
|
|| (op->asl.parent->asl.aml_opcode ==
|
|
|
|
AML_VAR_PACKAGE_OP))) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
|
|
|
"Method Reference in a Package, Op=%p\n",
|
|
|
|
op));
|
2006-06-24 04:04:00 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
op->common.node =
|
|
|
|
(struct acpi_namespace_node *)op->asl.value.
|
2008-04-10 22:06:40 +07:00
|
|
|
arg->asl.node;
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ut_add_reference(op->asl.value.arg->asl.
|
|
|
|
node->object);
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
|
|
|
"Method invocation, Op=%p\n", op));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
|
|
|
|
* the method Node pointer
|
|
|
|
*/
|
|
|
|
/* next_op points to the op that holds the method name */
|
|
|
|
|
|
|
|
next_op = first_arg;
|
|
|
|
|
|
|
|
/* next_op points to first argument op */
|
|
|
|
|
|
|
|
next_op = next_op->common.next;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the method's arguments and put them on the operand stack
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_create_operands(walk_state, next_op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Since the operands will be passed to another control method,
|
|
|
|
* we must resolve all local references here (Local variables,
|
|
|
|
* arguments to *this* method, etc.)
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_resolve_operands(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-10-02 11:00:00 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* On error, clear all resolved operands */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ds_clear_operands(walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Tell the walk loop to preempt this running method and
|
|
|
|
* execute the new method
|
|
|
|
*/
|
|
|
|
status = AE_CTRL_TRANSFER;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return now; we don't want to disturb anything,
|
|
|
|
* especially the operand count!
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
case AML_TYPE_CREATE_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
|
|
|
"Executing CreateField Buffer/Index Op=%p\n",
|
2005-08-05 11:44:28 +07:00
|
|
|
op));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_load2_end_op(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ds_eval_buffer_field_operands(walk_state, op);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_TYPE_CREATE_OBJECT:
|
|
|
|
|
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
|
|
|
"Executing CreateObject (Buffer/Package) Op=%p\n",
|
2005-08-05 11:44:28 +07:00
|
|
|
op));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
switch (op->common.parent->common.aml_opcode) {
|
|
|
|
case AML_NAME_OP:
|
|
|
|
/*
|
2005-04-19 09:49:35 +07:00
|
|
|
* Put the Node on the object stack (Contains the ACPI Name
|
|
|
|
* of this object)
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
walk_state->operands[0] =
|
|
|
|
(void *)op->common.parent->common.node;
|
2005-04-17 05:20:36 +07:00
|
|
|
walk_state->num_operands = 1;
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_create_node(walk_state,
|
|
|
|
op->common.parent->
|
|
|
|
common.node,
|
|
|
|
op->common.parent);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fall through */
|
|
|
|
/*lint -fallthrough */
|
|
|
|
|
|
|
|
case AML_INT_EVAL_SUBTREE_OP:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ds_eval_data_object_operands
|
|
|
|
(walk_state, op,
|
|
|
|
acpi_ns_get_attached_object(op->common.
|
|
|
|
parent->common.
|
|
|
|
node));
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ds_eval_data_object_operands
|
|
|
|
(walk_state, op, NULL);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If a result object was returned from above, push it on the
|
|
|
|
* current result stack
|
|
|
|
*/
|
2005-04-19 09:49:35 +07:00
|
|
|
if (walk_state->result_obj) {
|
2005-08-05 11:44:28 +07:00
|
|
|
status =
|
|
|
|
acpi_ds_result_push(walk_state->result_obj,
|
|
|
|
walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_TYPE_NAMED_FIELD:
|
|
|
|
case AML_TYPE_NAMED_COMPLEX:
|
|
|
|
case AML_TYPE_NAMED_SIMPLE:
|
|
|
|
case AML_TYPE_NAMED_NO_OBJ:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
status = acpi_ds_load2_end_op(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (op->common.aml_opcode == AML_REGION_OP) {
|
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
|
|
|
"Executing OpRegion Address/Length Op=%p\n",
|
2005-08-05 11:44:28 +07:00
|
|
|
op));
|
|
|
|
|
|
|
|
status =
|
|
|
|
acpi_ds_eval_region_operands(walk_state,
|
|
|
|
op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
}
|
2008-04-10 22:06:41 +07:00
|
|
|
} else if (op->common.aml_opcode == AML_DATA_REGION_OP) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
|
|
"Executing DataTableRegion Strings Op=%p\n",
|
|
|
|
op));
|
|
|
|
|
|
|
|
status =
|
|
|
|
acpi_ds_eval_table_region_operands
|
|
|
|
(walk_state, op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
break;
|
|
|
|
}
|
2008-04-10 22:06:41 +07:00
|
|
|
} else if (op->common.aml_opcode == AML_BANK_FIELD_OP) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
|
|
"Executing BankField Op=%p\n",
|
|
|
|
op));
|
|
|
|
|
|
|
|
status =
|
|
|
|
acpi_ds_eval_bank_field_operands(walk_state,
|
|
|
|
op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
break;
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_TYPE_UNDEFINED:
|
|
|
|
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Undefined opcode type Op=%p", op));
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
case AML_TYPE_BOGUS:
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
|
|
|
"Internal opcode=%X type Op=%p\n",
|
|
|
|
walk_state->opcode, op));
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2006-01-28 04:43:00 +07:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2013-04-12 07:25:04 +07:00
|
|
|
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
|
2006-01-28 04:43:00 +07:00
|
|
|
op_class, op_type, op->common.aml_opcode,
|
|
|
|
op));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
status = AE_NOT_IMPLEMENTED;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ACPI 2.0 support for 64-bit integers: Truncate numeric
|
|
|
|
* result value if we are executing from a 32-bit ACPI table
|
|
|
|
*/
|
2012-12-31 07:07:18 +07:00
|
|
|
(void)acpi_ex_truncate_for32bit_table(walk_state->result_obj);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Check if we just completed the evaluation of a
|
|
|
|
* conditional predicate
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
if ((ACPI_SUCCESS(status)) &&
|
|
|
|
(walk_state->control_state) &&
|
|
|
|
(walk_state->control_state->common.state ==
|
|
|
|
ACPI_CONTROL_PREDICATE_EXECUTING) &&
|
|
|
|
(walk_state->control_state->control.predicate_op == op)) {
|
|
|
|
status =
|
|
|
|
acpi_ds_get_predicate_value(walk_state,
|
|
|
|
walk_state->result_obj);
|
2005-04-17 05:20:36 +07:00
|
|
|
walk_state->result_obj = NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-29 08:30:02 +07:00
|
|
|
cleanup:
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
if (walk_state->result_obj) {
|
2006-10-02 11:00:00 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* Break to debugger to display result */
|
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
ACPI_DEBUGGER_EXEC(acpi_db_display_result_object
|
|
|
|
(walk_state->result_obj, walk_state));
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Delete the result op if and only if:
|
|
|
|
* Parent will not use the result -- such as any
|
|
|
|
* non-nested type2 op in a method (parent will be method)
|
|
|
|
*/
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_ds_delete_result_if_not_used(op, walk_state->result_obj,
|
|
|
|
walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
#ifdef _UNDER_DEVELOPMENT
|
|
|
|
|
|
|
|
if (walk_state->parser_state.aml == walk_state->parser_state.aml_end) {
|
2005-08-05 11:44:28 +07:00
|
|
|
acpi_db_method_end(walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-12-17 05:05:00 +07:00
|
|
|
/* Invoke exception handler on error */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-08-05 11:44:28 +07:00
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-12-17 05:05:00 +07:00
|
|
|
status = acpi_ds_method_error(status, walk_state);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-12-17 05:05:00 +07:00
|
|
|
/* Always clear the object stack */
|
|
|
|
|
|
|
|
walk_state->num_operands = 0;
|
2005-08-05 11:44:28 +07:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|