2000-10-28 05:01:06 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: dswexec - Dispatcher method execution callbacks;
|
|
|
|
* dispatch to interpreter.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2011-01-13 16:12:34 +00:00
|
|
|
/*
|
2015-02-18 20:33:00 +00:00
|
|
|
* Copyright (C) 2000 - 2015, Intel Corp.
|
2000-12-21 06:56:46 +00:00
|
|
|
* All rights reserved.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2011-01-13 16:12:34 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2009-06-02 20:02:58 +00:00
|
|
|
#include <contrib/dev/acpica/include/acpi.h>
|
|
|
|
#include <contrib/dev/acpica/include/accommon.h>
|
|
|
|
#include <contrib/dev/acpica/include/acparser.h>
|
|
|
|
#include <contrib/dev/acpica/include/amlcode.h>
|
|
|
|
#include <contrib/dev/acpica/include/acdispat.h>
|
|
|
|
#include <contrib/dev/acpica/include/acinterp.h>
|
|
|
|
#include <contrib/dev/acpica/include/acnamesp.h>
|
|
|
|
#include <contrib/dev/acpica/include/acdebug.h>
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2001-05-29 19:52:40 +00:00
|
|
|
#define _COMPONENT ACPI_DISPATCHER
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_MODULE_NAME ("dswexec")
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
2001-11-28 04:29:40 +00:00
|
|
|
* Dispatch table for opcode classes
|
2001-10-31 02:32:29 +00:00
|
|
|
*/
|
2007-03-22 17:24:05 +00:00
|
|
|
static ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] =
|
|
|
|
{
|
|
|
|
AcpiExOpcode_0A_0T_1R,
|
|
|
|
AcpiExOpcode_1A_0T_0R,
|
|
|
|
AcpiExOpcode_1A_0T_1R,
|
|
|
|
AcpiExOpcode_1A_1T_0R,
|
|
|
|
AcpiExOpcode_1A_1T_1R,
|
|
|
|
AcpiExOpcode_2A_0T_0R,
|
|
|
|
AcpiExOpcode_2A_0T_1R,
|
|
|
|
AcpiExOpcode_2A_1T_1R,
|
|
|
|
AcpiExOpcode_2A_2T_1R,
|
|
|
|
AcpiExOpcode_3A_0T_0R,
|
|
|
|
AcpiExOpcode_3A_1T_1R,
|
|
|
|
AcpiExOpcode_6A_0T_1R
|
|
|
|
};
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDsGetPredicateValue
|
|
|
|
*
|
|
|
|
* PARAMETERS: WalkState - Current state of the parse tree walk
|
2005-11-01 22:11:18 +00:00
|
|
|
* ResultObj - if non-zero, pop result from result stack
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2001-01-31 09:17:50 +00:00
|
|
|
* DESCRIPTION: Get the result of a predicate evaluation
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
|
|
|
AcpiDsGetPredicateValue (
|
|
|
|
ACPI_WALK_STATE *WalkState,
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_OPERAND_OBJECT *ResultObj)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
ACPI_STATUS Status = AE_OK;
|
|
|
|
ACPI_OPERAND_OBJECT *ObjDesc;
|
2005-11-01 22:11:18 +00:00
|
|
|
ACPI_OPERAND_OBJECT *LocalObjDesc = NULL;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE_PTR (DsGetPredicateValue, WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
WalkState->ControlState->Common.State = 0;
|
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
if (ResultObj)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2000-12-08 09:20:40 +00:00
|
|
|
Status = AcpiDsResultPop (&ObjDesc, WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_EXCEPTION ((AE_INFO, Status,
|
|
|
|
"Could not get result from predicate evaluation"));
|
2000-12-01 09:36:25 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-10-04 23:12:13 +00:00
|
|
|
Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
|
2000-10-28 05:01:06 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
|
2001-05-29 19:52:40 +00:00
|
|
|
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
|
|
|
|
ObjDesc = WalkState->Operands [0];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ObjDesc)
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO,
|
|
|
|
"No predicate ObjDesc=%p State=%p",
|
2000-10-28 05:01:06 +00:00
|
|
|
ObjDesc, WalkState));
|
|
|
|
|
|
|
|
return_ACPI_STATUS (AE_AML_NO_OPERAND);
|
|
|
|
}
|
|
|
|
|
2000-12-01 09:36:25 +00:00
|
|
|
/*
|
2005-11-01 22:11:18 +00:00
|
|
|
* Result of predicate evaluation must be an Integer
|
|
|
|
* object. Implicitly convert the argument if necessary.
|
2000-10-28 05:01:06 +00:00
|
|
|
*/
|
2005-11-01 22:11:18 +00:00
|
|
|
Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO,
|
2010-03-05 19:58:45 +00:00
|
|
|
"Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
|
2009-06-01 21:02:40 +00:00
|
|
|
ObjDesc, WalkState, ObjDesc->Common.Type));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
Status = AE_AML_OPERAND_TYPE;
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
2001-01-31 09:17:50 +00:00
|
|
|
/* Truncate the predicate to 32-bits if necessary */
|
2000-12-01 09:36:25 +00:00
|
|
|
|
2013-01-02 19:01:21 +00:00
|
|
|
(void) AcpiExTruncateFor32bitTable (LocalObjDesc);
|
2000-12-01 09:36:25 +00:00
|
|
|
|
|
|
|
/*
|
2000-10-28 05:01:06 +00:00
|
|
|
* Save the result of the predicate evaluation on
|
2000-12-01 09:36:25 +00:00
|
|
|
* the control stack
|
2000-10-28 05:01:06 +00:00
|
|
|
*/
|
2005-11-01 22:11:18 +00:00
|
|
|
if (LocalObjDesc->Integer.Value)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
WalkState->ControlState->Common.Value = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-12-01 09:36:25 +00:00
|
|
|
/*
|
2000-10-28 05:01:06 +00:00
|
|
|
* Predicate is FALSE, we will just toss the
|
2000-12-01 09:36:25 +00:00
|
|
|
* rest of the package
|
2000-10-28 05:01:06 +00:00
|
|
|
*/
|
|
|
|
WalkState->ControlState->Common.Value = FALSE;
|
|
|
|
Status = AE_CTRL_FALSE;
|
|
|
|
}
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
/* Predicate can be used for an implicit return value */
|
|
|
|
|
|
|
|
(void) AcpiDsDoImplicitReturn (LocalObjDesc, WalkState, TRUE);
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
Cleanup:
|
|
|
|
|
2001-11-28 04:29:40 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
|
2001-10-04 23:12:13 +00:00
|
|
|
WalkState->ControlState->Common.Value, WalkState->Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/* Break to debugger to display result */
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2000-12-01 09:36:25 +00:00
|
|
|
/*
|
2000-10-28 05:01:06 +00:00
|
|
|
* Delete the predicate result object (we know that
|
|
|
|
* we don't need it anymore)
|
|
|
|
*/
|
2005-11-01 22:11:18 +00:00
|
|
|
if (LocalObjDesc != ObjDesc)
|
|
|
|
{
|
|
|
|
AcpiUtRemoveReference (LocalObjDesc);
|
|
|
|
}
|
2001-05-29 19:52:40 +00:00
|
|
|
AcpiUtRemoveReference (ObjDesc);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
|
2000-10-28 05:01:06 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDsExecBeginOp
|
|
|
|
*
|
|
|
|
* PARAMETERS: WalkState - Current state of the parse tree walk
|
2005-11-01 22:11:18 +00:00
|
|
|
* OutOp - Where to return op if a new one is created
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Descending callback used during the execution of control
|
2012-10-19 18:47:57 +00:00
|
|
|
* methods. This is where most operators and operands are
|
2000-10-28 05:01:06 +00:00
|
|
|
* dispatched to the interpreter.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
|
|
|
AcpiDsExecBeginOp (
|
|
|
|
ACPI_WALK_STATE *WalkState,
|
|
|
|
ACPI_PARSE_OBJECT **OutOp)
|
|
|
|
{
|
2001-10-04 23:12:13 +00:00
|
|
|
ACPI_PARSE_OBJECT *Op;
|
2000-10-28 05:01:06 +00:00
|
|
|
ACPI_STATUS Status = AE_OK;
|
2001-10-31 02:32:29 +00:00
|
|
|
UINT32 OpcodeClass;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2001-10-04 23:12:13 +00:00
|
|
|
Op = WalkState->Op;
|
2000-10-28 05:01:06 +00:00
|
|
|
if (!Op)
|
|
|
|
{
|
2001-10-04 23:12:13 +00:00
|
|
|
Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
|
2000-10-28 05:01:06 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
goto ErrorExit;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Op = *OutOp;
|
2001-10-04 23:12:13 +00:00
|
|
|
WalkState->Op = Op;
|
2002-07-09 17:51:31 +00:00
|
|
|
WalkState->Opcode = Op->Common.AmlOpcode;
|
|
|
|
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
|
2002-02-23 05:10:40 +00:00
|
|
|
|
|
|
|
if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
|
|
|
|
{
|
2005-11-01 22:11:18 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
|
|
|
"(%s) Popping scope for Op %p\n",
|
2002-02-23 05:10:40 +00:00
|
|
|
AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
|
2002-07-09 17:51:31 +00:00
|
|
|
|
|
|
|
Status = AcpiDsScopeStackPop (WalkState);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
goto ErrorExit;
|
2002-07-09 17:51:31 +00:00
|
|
|
}
|
2002-02-23 05:10:40 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (Op == WalkState->Origin)
|
|
|
|
{
|
|
|
|
if (OutOp)
|
|
|
|
{
|
|
|
|
*OutOp = Op;
|
|
|
|
}
|
|
|
|
|
|
|
|
return_ACPI_STATUS (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 ((WalkState->ControlState) &&
|
|
|
|
(WalkState->ControlState->Common.State ==
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2001-10-31 02:32:29 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
|
2000-10-28 05:01:06 +00:00
|
|
|
Op, WalkState));
|
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/* Save start of predicate */
|
|
|
|
|
|
|
|
WalkState->ControlState->Control.PredicateOp = Op;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
OpcodeClass = WalkState->OpInfo->Class;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/* We want to send namepaths to the load code */
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2001-10-31 02:32:29 +00:00
|
|
|
OpcodeClass = AML_CLASS_NAMED_OBJECT;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle the opcode based upon the opcode type
|
|
|
|
*/
|
2001-09-07 01:22:25 +00:00
|
|
|
switch (OpcodeClass)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_CLASS_CONTROL:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
Status = AcpiDsExecBeginControlOp (WalkState, Op);
|
|
|
|
break;
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_CLASS_NAMED_OBJECT:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (WalkState->WalkType & ACPI_WALK_METHOD)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
/*
|
2005-11-01 22:11:18 +00:00
|
|
|
* Found a named object declaration during method execution;
|
2012-10-19 18:47:57 +00:00
|
|
|
* we must enter this object into the namespace. The created
|
2005-11-01 22:11:18 +00:00
|
|
|
* object is temporary and will be deleted upon completion of
|
|
|
|
* the execution of this method.
|
2010-12-09 20:04:14 +00: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.
|
2000-10-28 05:01:06 +00:00
|
|
|
*/
|
2010-12-09 20:04:14 +00:00
|
|
|
if (Op->Common.AmlOpcode != AML_SCOPE_OP)
|
|
|
|
{
|
|
|
|
Status = AcpiDsLoad2BeginOp (WalkState, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Status = AcpiDsScopeStackPush (Op->Named.Node,
|
|
|
|
Op->Named.Node->Type, WalkState);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
2000-12-08 09:20:40 +00:00
|
|
|
break;
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_CLASS_EXECUTE:
|
|
|
|
case AML_CLASS_CREATE:
|
2000-12-08 09:20:40 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Nothing to do here during method execution */
|
|
|
|
|
|
|
|
return_ACPI_STATUS (Status);
|
2007-03-22 17:24:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
ErrorExit:
|
|
|
|
Status = AcpiDsMethodError (Status, WalkState);
|
|
|
|
return_ACPI_STATUS (Status);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDsExecEndOp
|
|
|
|
*
|
|
|
|
* PARAMETERS: WalkState - Current state of the parse tree walk
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Ascending callback used during the execution of control
|
2012-10-19 18:47:57 +00:00
|
|
|
* methods. The only thing we really need to do here is to
|
2000-10-28 05:01:06 +00:00
|
|
|
* notice the beginning of IF, ELSE, and WHILE blocks.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
|
|
|
AcpiDsExecEndOp (
|
2001-10-04 23:12:13 +00:00
|
|
|
ACPI_WALK_STATE *WalkState)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2001-10-04 23:12:13 +00:00
|
|
|
ACPI_PARSE_OBJECT *Op;
|
2000-10-28 05:01:06 +00:00
|
|
|
ACPI_STATUS Status = AE_OK;
|
2001-10-31 02:32:29 +00:00
|
|
|
UINT32 OpType;
|
|
|
|
UINT32 OpClass;
|
2000-10-28 05:01:06 +00:00
|
|
|
ACPI_PARSE_OBJECT *NextOp;
|
|
|
|
ACPI_PARSE_OBJECT *FirstArg;
|
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Op = WalkState->Op;
|
|
|
|
OpType = WalkState->OpInfo->Type;
|
|
|
|
OpClass = WalkState->OpInfo->Class;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
if (OpClass == AML_CLASS_UNKNOWN)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2010-03-05 19:58:45 +00:00
|
|
|
ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%X", Op->Common.AmlOpcode));
|
2000-10-28 05:01:06 +00:00
|
|
|
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
|
|
|
|
}
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
FirstArg = Op->Common.Value.Arg;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/* Init the walk state */
|
|
|
|
|
|
|
|
WalkState->NumOperands = 0;
|
2007-03-22 17:24:05 +00:00
|
|
|
WalkState->OperandIndex = 0;
|
2000-10-28 05:01:06 +00:00
|
|
|
WalkState->ReturnDesc = NULL;
|
2001-10-04 23:12:13 +00:00
|
|
|
WalkState->ResultObj = NULL;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/* Call debugger for single step support (DEBUG build only) */
|
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
|
|
|
|
ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-11-28 04:29:40 +00:00
|
|
|
/* Decode the Opcode Class */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
switch (OpClass)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
|
|
|
|
|
|
|
|
if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
|
|
|
|
{
|
|
|
|
Status = AcpiDsEvaluateNamePath (WalkState);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
case AML_CLASS_EXECUTE: /* Most operators with arguments */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2000-12-08 09:20:40 +00:00
|
|
|
/* Build resolved operand stack */
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
Status = AcpiDsCreateOperands (WalkState, FirstArg);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
/*
|
|
|
|
* All opcodes require operand resolution, with the only exceptions
|
|
|
|
* being the ObjectType and SizeOf operators.
|
|
|
|
*/
|
|
|
|
if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
|
|
|
|
{
|
|
|
|
/* Resolve all operands */
|
2001-09-07 01:22:25 +00:00
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
Status = AcpiExResolveOperands (WalkState->Opcode,
|
2001-11-28 04:29:40 +00:00
|
|
|
&(WalkState->Operands [WalkState->NumOperands -1]),
|
2001-09-07 01:22:25 +00:00
|
|
|
WalkState);
|
2005-11-01 22:11:18 +00:00
|
|
|
}
|
|
|
|
|
2001-11-28 04:29:40 +00:00
|
|
|
if (ACPI_SUCCESS (Status))
|
2001-09-07 01:22:25 +00:00
|
|
|
{
|
|
|
|
/*
|
2001-11-28 04:29:40 +00:00
|
|
|
* Dispatch the request to the appropriate interpreter handler
|
2012-10-19 18:47:57 +00:00
|
|
|
* routine. There is one routine per opcode "type" based upon the
|
2001-11-28 04:29:40 +00:00
|
|
|
* number of opcode arguments and return type.
|
2001-09-07 01:22:25 +00:00
|
|
|
*/
|
2004-12-01 23:14:10 +00:00
|
|
|
Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
|
2001-11-28 04:29:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-12-09 02:45:16 +00:00
|
|
|
/*
|
|
|
|
* Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
|
|
|
|
* Local is uninitialized.
|
|
|
|
*/
|
|
|
|
if ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
|
|
|
|
(WalkState->Opcode == AML_STORE_OP) &&
|
|
|
|
(WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
|
|
|
(WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
2009-06-01 21:02:40 +00:00
|
|
|
(WalkState->Operands[0]->Reference.Class ==
|
|
|
|
WalkState->Operands[1]->Reference.Class) &&
|
|
|
|
(WalkState->Operands[0]->Reference.Value ==
|
|
|
|
WalkState->Operands[1]->Reference.Value))
|
2003-12-09 02:45:16 +00:00
|
|
|
{
|
|
|
|
Status = AE_OK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_EXCEPTION ((AE_INFO, Status,
|
|
|
|
"While resolving operands for [%s]",
|
|
|
|
AcpiPsGetOpcodeName (WalkState->Opcode)));
|
2003-12-09 02:45:16 +00:00
|
|
|
}
|
2001-09-07 01:22:25 +00:00
|
|
|
}
|
|
|
|
|
2001-11-28 04:29:40 +00:00
|
|
|
/* Always delete the argument objects and clear the operand stack */
|
2001-09-07 01:22:25 +00:00
|
|
|
|
2002-11-27 18:07:48 +00:00
|
|
|
AcpiDsClearOperands (WalkState);
|
2001-09-07 01:22:25 +00:00
|
|
|
|
2000-12-08 09:20:40 +00:00
|
|
|
/*
|
|
|
|
* If a result object was returned from above, push it on the
|
|
|
|
* current result stack
|
|
|
|
*/
|
|
|
|
if (ACPI_SUCCESS (Status) &&
|
2001-10-04 23:12:13 +00:00
|
|
|
WalkState->ResultObj)
|
2000-12-08 09:20:40 +00:00
|
|
|
{
|
2001-10-04 23:12:13 +00:00
|
|
|
Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
|
2000-12-08 09:20:40 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
default:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
switch (OpType)
|
|
|
|
{
|
|
|
|
case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/* 1 Operand, 0 ExternalResult, 0 InternalResult */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Status = AcpiDsExecEndControlOp (WalkState, Op);
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_TYPE_METHOD_CALL:
|
2005-11-01 22:11:18 +00:00
|
|
|
/*
|
|
|
|
* 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) &&
|
|
|
|
((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
|
|
|
|
(Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
|
|
|
|
{
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
|
|
|
"Method Reference in a Package, Op=%p\n", Op));
|
2007-03-22 17:24:05 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
|
|
|
|
return_ACPI_STATUS (AE_OK);
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:51:01 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
|
|
|
"Method invocation, Op=%p\n", Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
2005-11-01 22:11:18 +00:00
|
|
|
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
|
2001-10-31 02:32:29 +00:00
|
|
|
* the method Node pointer
|
|
|
|
*/
|
|
|
|
/* NextOp points to the op that holds the method name */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
NextOp = FirstArg;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/* NextOp points to first argument op */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
NextOp = NextOp->Common.Next;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
|
|
|
* Get the method's arguments and put them on the operand stack
|
|
|
|
*/
|
|
|
|
Status = AcpiDsCreateOperands (WalkState, NextOp);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
2002-02-23 05:10:40 +00:00
|
|
|
* Since the operands will be passed to another control method,
|
|
|
|
* we must resolve all local references here (Local variables,
|
2001-11-28 04:29:40 +00:00
|
|
|
* arguments to *this* method, etc.)
|
2001-10-31 02:32:29 +00:00
|
|
|
*/
|
|
|
|
Status = AcpiDsResolveOperands (WalkState);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2002-11-27 18:07:48 +00:00
|
|
|
/* On error, clear all resolved operands */
|
|
|
|
|
|
|
|
AcpiDsClearOperands (WalkState);
|
2001-10-31 02:32:29 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
|
|
|
* Tell the walk loop to preempt this running method and
|
|
|
|
* execute the new method
|
|
|
|
*/
|
|
|
|
Status = AE_CTRL_TRANSFER;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
/*
|
|
|
|
* Return now; we don't want to disturb anything,
|
|
|
|
* especially the operand count!
|
|
|
|
*/
|
|
|
|
return_ACPI_STATUS (Status);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_TYPE_CREATE_FIELD:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
|
|
|
"Executing CreateField Buffer/Index Op=%p\n", Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Status = AcpiDsLoad2EndOp (WalkState);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
2002-06-30 17:50:46 +00:00
|
|
|
case AML_TYPE_CREATE_OBJECT:
|
|
|
|
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
|
|
|
"Executing CreateObject (Buffer/Package) Op=%p\n", Op));
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
switch (Op->Common.Parent->Common.AmlOpcode)
|
2002-06-30 17:50:46 +00:00
|
|
|
{
|
|
|
|
case AML_NAME_OP:
|
|
|
|
/*
|
2005-11-01 22:11:18 +00:00
|
|
|
* Put the Node on the object stack (Contains the ACPI Name
|
|
|
|
* of this object)
|
2002-06-30 17:50:46 +00:00
|
|
|
*/
|
2002-07-09 17:51:31 +00:00
|
|
|
WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
|
2002-06-30 17:50:46 +00:00
|
|
|
WalkState->NumOperands = 1;
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
Status = AcpiDsCreateNode (WalkState,
|
|
|
|
Op->Common.Parent->Common.Node,
|
|
|
|
Op->Common.Parent);
|
2002-06-30 17:50:46 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fall through */
|
2002-07-09 17:51:31 +00:00
|
|
|
/*lint -fallthrough */
|
2002-06-30 17:50:46 +00:00
|
|
|
|
|
|
|
case AML_INT_EVAL_SUBTREE_OP:
|
|
|
|
|
2002-08-29 01:51:24 +00:00
|
|
|
Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
|
2002-06-30 17:50:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If a result object was returned from above, push it on the
|
|
|
|
* current result stack
|
|
|
|
*/
|
2005-11-01 22:11:18 +00:00
|
|
|
if (WalkState->ResultObj)
|
2002-06-30 17:50:46 +00:00
|
|
|
{
|
|
|
|
Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_TYPE_NAMED_FIELD:
|
|
|
|
case AML_TYPE_NAMED_COMPLEX:
|
|
|
|
case AML_TYPE_NAMED_SIMPLE:
|
2002-02-23 05:10:40 +00:00
|
|
|
case AML_TYPE_NAMED_NO_OBJ:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Status = AcpiDsLoad2EndOp (WalkState);
|
2000-12-08 09:20:40 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
2001-10-31 02:32:29 +00:00
|
|
|
{
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
|
|
|
"Executing OpRegion Address/Length Op=%p\n", Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Status = AcpiDsEvalRegionOperands (WalkState, Op);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-06-01 21:02:40 +00:00
|
|
|
else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
|
|
|
|
{
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
|
|
|
"Executing DataTableRegion Strings Op=%p\n", Op));
|
|
|
|
|
|
|
|
Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
|
|
|
|
{
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
|
|
|
"Executing BankField Op=%p\n", Op));
|
|
|
|
|
|
|
|
Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-10-31 02:32:29 +00:00
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_TYPE_UNDEFINED:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO,
|
|
|
|
"Undefined opcode type Op=%p", Op));
|
2001-10-31 02:32:29 +00:00
|
|
|
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
case AML_TYPE_BOGUS:
|
2001-11-28 04:29:40 +00:00
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
2001-11-28 04:29:40 +00:00
|
|
|
"Internal opcode=%X type Op=%p\n",
|
2001-10-31 02:32:29 +00:00
|
|
|
WalkState->Opcode, Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
default:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO,
|
2013-04-04 21:18:57 +00:00
|
|
|
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
|
2002-07-09 17:51:31 +00:00
|
|
|
OpClass, OpType, Op->Common.AmlOpcode, Op));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-10-31 02:32:29 +00:00
|
|
|
Status = AE_NOT_IMPLEMENTED;
|
|
|
|
break;
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2000-12-01 09:36:25 +00:00
|
|
|
/*
|
2002-02-23 05:10:40 +00:00
|
|
|
* ACPI 2.0 support for 64-bit integers: Truncate numeric
|
2001-11-28 04:29:40 +00:00
|
|
|
* result value if we are executing from a 32-bit ACPI table
|
2000-12-01 09:36:25 +00:00
|
|
|
*/
|
2013-01-02 19:01:21 +00:00
|
|
|
(void) AcpiExTruncateFor32bitTable (WalkState->ResultObj);
|
2000-12-01 09:36:25 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/*
|
|
|
|
* Check if we just completed the evaluation of a
|
|
|
|
* conditional predicate
|
|
|
|
*/
|
2004-12-01 23:14:10 +00:00
|
|
|
if ((ACPI_SUCCESS (Status)) &&
|
|
|
|
(WalkState->ControlState) &&
|
2000-10-28 05:01:06 +00:00
|
|
|
(WalkState->ControlState->Common.State ==
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_CONTROL_PREDICATE_EXECUTING) &&
|
2000-10-28 05:01:06 +00:00
|
|
|
(WalkState->ControlState->Control.PredicateOp == Op))
|
|
|
|
{
|
2002-02-23 05:10:40 +00:00
|
|
|
Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
|
2001-10-04 23:12:13 +00:00
|
|
|
WalkState->ResultObj = NULL;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Cleanup:
|
2004-12-01 23:14:10 +00:00
|
|
|
|
2001-10-04 23:12:13 +00:00
|
|
|
if (WalkState->ResultObj)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
/* Break to debugger to display result */
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
|
|
|
|
WalkState));
|
2000-10-28 05:01:06 +00: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)
|
|
|
|
*/
|
2001-10-04 23:12:13 +00:00
|
|
|
AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
#ifdef _UNDER_DEVELOPMENT
|
2003-04-29 18:39:29 +00:00
|
|
|
|
|
|
|
if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
|
|
|
|
{
|
|
|
|
AcpiDbMethodEnd (WalkState);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Invoke exception handler on error */
|
2003-07-13 22:44:13 +00:00
|
|
|
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiDsMethodError (Status, WalkState);
|
2003-07-13 22:44:13 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Always clear the object stack */
|
|
|
|
|
|
|
|
WalkState->NumOperands = 0;
|
2000-10-28 05:01:06 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|