Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:02

0001 /******************************************************************************
0002  *
0003  * Module Name: dswexec - Dispatcher method execution callbacks;
0004  *                        dispatch to interpreter.
0005  *
0006  *****************************************************************************/
0007 
0008 /******************************************************************************
0009  *
0010  * 1. Copyright Notice
0011  *
0012  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0013  * All rights reserved.
0014  *
0015  * 2. License
0016  *
0017  * 2.1. This is your license from Intel Corp. under its intellectual property
0018  * rights. You may have additional license terms from the party that provided
0019  * you this software, covering your right to use that party's intellectual
0020  * property rights.
0021  *
0022  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0023  * copy of the source code appearing in this file ("Covered Code") an
0024  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0025  * base code distributed originally by Intel ("Original Intel Code") to copy,
0026  * make derivatives, distribute, use and display any portion of the Covered
0027  * Code in any form, with the right to sublicense such rights; and
0028  *
0029  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0030  * license (with the right to sublicense), under only those claims of Intel
0031  * patents that are infringed by the Original Intel Code, to make, use, sell,
0032  * offer to sell, and import the Covered Code and derivative works thereof
0033  * solely to the minimum extent necessary to exercise the above copyright
0034  * license, and in no event shall the patent license extend to any additions
0035  * to or modifications of the Original Intel Code. No other license or right
0036  * is granted directly or by implication, estoppel or otherwise;
0037  *
0038  * The above copyright and patent license is granted only if the following
0039  * conditions are met:
0040  *
0041  * 3. Conditions
0042  *
0043  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0044  * Redistribution of source code of any substantial portion of the Covered
0045  * Code or modification with rights to further distribute source must include
0046  * the above Copyright Notice, the above License, this list of Conditions,
0047  * and the following Disclaimer and Export Compliance provision. In addition,
0048  * Licensee must cause all Covered Code to which Licensee contributes to
0049  * contain a file documenting the changes Licensee made to create that Covered
0050  * Code and the date of any change. Licensee must include in that file the
0051  * documentation of any changes made by any predecessor Licensee. Licensee
0052  * must include a prominent statement that the modification is derived,
0053  * directly or indirectly, from Original Intel Code.
0054  *
0055  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0056  * Redistribution of source code of any substantial portion of the Covered
0057  * Code or modification without rights to further distribute source must
0058  * include the following Disclaimer and Export Compliance provision in the
0059  * documentation and/or other materials provided with distribution. In
0060  * addition, Licensee may not authorize further sublicense of source of any
0061  * portion of the Covered Code, and must include terms to the effect that the
0062  * license from Licensee to its licensee is limited to the intellectual
0063  * property embodied in the software Licensee provides to its licensee, and
0064  * not to intellectual property embodied in modifications its licensee may
0065  * make.
0066  *
0067  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0068  * substantial portion of the Covered Code or modification must reproduce the
0069  * above Copyright Notice, and the following Disclaimer and Export Compliance
0070  * provision in the documentation and/or other materials provided with the
0071  * distribution.
0072  *
0073  * 3.4. Intel retains all right, title, and interest in and to the Original
0074  * Intel Code.
0075  *
0076  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0077  * Intel shall be used in advertising or otherwise to promote the sale, use or
0078  * other dealings in products derived from or relating to the Covered Code
0079  * without prior written authorization from Intel.
0080  *
0081  * 4. Disclaimer and Export Compliance
0082  *
0083  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0084  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0085  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0086  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0087  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0088  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0089  * PARTICULAR PURPOSE.
0090  *
0091  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0092  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0093  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0094  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0095  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0096  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0097  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0098  * LIMITED REMEDY.
0099  *
0100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0101  * software or system incorporating such software without first obtaining any
0102  * required license or other approval from the U. S. Department of Commerce or
0103  * any other agency or department of the United States Government. In the
0104  * event Licensee exports any such software from the United States or
0105  * re-exports any such software from a foreign destination, Licensee shall
0106  * ensure that the distribution and export/re-export of the software is in
0107  * compliance with all laws, regulations, orders, or other restrictions of the
0108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0109  * any of its subsidiaries will export/re-export any technical data, process,
0110  * software, or service, directly or indirectly, to any country for which the
0111  * United States government or any agency thereof requires an export license,
0112  * other governmental approval, or letter of assurance, without first obtaining
0113  * such license, approval or letter.
0114  *
0115  *****************************************************************************
0116  *
0117  * Alternatively, you may choose to be licensed under the terms of the
0118  * following license:
0119  *
0120  * Redistribution and use in source and binary forms, with or without
0121  * modification, are permitted provided that the following conditions
0122  * are met:
0123  * 1. Redistributions of source code must retain the above copyright
0124  *    notice, this list of conditions, and the following disclaimer,
0125  *    without modification.
0126  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0127  *    substantially similar to the "NO WARRANTY" disclaimer below
0128  *    ("Disclaimer") and any redistribution must be conditioned upon
0129  *    including a substantially similar Disclaimer requirement for further
0130  *    binary redistribution.
0131  * 3. Neither the names of the above-listed copyright holders nor the names
0132  *    of any contributors may be used to endorse or promote products derived
0133  *    from this software without specific prior written permission.
0134  *
0135  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0136  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0137  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0138  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0139  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0140  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0141  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0142  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0143  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0144  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0145  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0146  *
0147  * Alternatively, you may choose to be licensed under the terms of the
0148  * GNU General Public License ("GPL") version 2 as published by the Free
0149  * Software Foundation.
0150  *
0151  *****************************************************************************/
0152 
0153 #include "acpi.h"
0154 #include "accommon.h"
0155 #include "acparser.h"
0156 #include "amlcode.h"
0157 #include "acdispat.h"
0158 #include "acinterp.h"
0159 #include "acnamesp.h"
0160 #include "acdebug.h"
0161 #ifdef ACPI_EXEC_APP
0162 #include "aecommon.h"
0163 #endif
0164 
0165 #define _COMPONENT          ACPI_DISPATCHER
0166         ACPI_MODULE_NAME    ("dswexec")
0167 
0168 /*
0169  * Dispatch table for opcode classes
0170  */
0171 static ACPI_EXECUTE_OP      AcpiGbl_OpTypeDispatch [] =
0172 {
0173     AcpiExOpcode_0A_0T_1R,
0174     AcpiExOpcode_1A_0T_0R,
0175     AcpiExOpcode_1A_0T_1R,
0176     NULL,   /* Was: AcpiExOpcode_1A_0T_0R (Was for Load operator) */
0177     AcpiExOpcode_1A_1T_1R,
0178     AcpiExOpcode_2A_0T_0R,
0179     AcpiExOpcode_2A_0T_1R,
0180     AcpiExOpcode_2A_1T_1R,
0181     AcpiExOpcode_2A_2T_1R,
0182     AcpiExOpcode_3A_0T_0R,
0183     AcpiExOpcode_3A_1T_1R,
0184     AcpiExOpcode_6A_0T_1R
0185 };
0186 
0187 
0188 /*****************************************************************************
0189  *
0190  * FUNCTION:    AcpiDsGetPredicateValue
0191  *
0192  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0193  *              ResultObj       - if non-zero, pop result from result stack
0194  *
0195  * RETURN:      Status
0196  *
0197  * DESCRIPTION: Get the result of a predicate evaluation
0198  *
0199  ****************************************************************************/
0200 
0201 ACPI_STATUS
0202 AcpiDsGetPredicateValue (
0203     ACPI_WALK_STATE         *WalkState,
0204     ACPI_OPERAND_OBJECT     *ResultObj)
0205 {
0206     ACPI_STATUS             Status = AE_OK;
0207     ACPI_OPERAND_OBJECT     *ObjDesc;
0208     ACPI_OPERAND_OBJECT     *LocalObjDesc = NULL;
0209 
0210 
0211     ACPI_FUNCTION_TRACE_PTR (DsGetPredicateValue, WalkState);
0212 
0213 
0214     WalkState->ControlState->Common.State = 0;
0215 
0216     if (ResultObj)
0217     {
0218         Status = AcpiDsResultPop (&ObjDesc, WalkState);
0219         if (ACPI_FAILURE (Status))
0220         {
0221             ACPI_EXCEPTION ((AE_INFO, Status,
0222                 "Could not get result from predicate evaluation"));
0223 
0224             return_ACPI_STATUS (Status);
0225         }
0226     }
0227     else
0228     {
0229         Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
0230         if (ACPI_FAILURE (Status))
0231         {
0232             return_ACPI_STATUS (Status);
0233         }
0234 
0235         Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
0236         if (ACPI_FAILURE (Status))
0237         {
0238             return_ACPI_STATUS (Status);
0239         }
0240 
0241         ObjDesc = WalkState->Operands [0];
0242     }
0243 
0244     if (!ObjDesc)
0245     {
0246         ACPI_ERROR ((AE_INFO,
0247             "No predicate ObjDesc=%p State=%p",
0248             ObjDesc, WalkState));
0249 
0250         return_ACPI_STATUS (AE_AML_NO_OPERAND);
0251     }
0252 
0253     /*
0254      * Result of predicate evaluation must be an Integer
0255      * object. Implicitly convert the argument if necessary.
0256      */
0257     Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc,
0258         ACPI_IMPLICIT_CONVERSION);
0259     if (ACPI_FAILURE (Status))
0260     {
0261         goto Cleanup;
0262     }
0263 
0264     if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
0265     {
0266         ACPI_ERROR ((AE_INFO,
0267             "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
0268             ObjDesc, WalkState, ObjDesc->Common.Type));
0269 
0270         Status = AE_AML_OPERAND_TYPE;
0271         goto Cleanup;
0272     }
0273 
0274     /* Truncate the predicate to 32-bits if necessary */
0275 
0276     (void) AcpiExTruncateFor32bitTable (LocalObjDesc);
0277 
0278     /*
0279      * Save the result of the predicate evaluation on
0280      * the control stack
0281      */
0282     if (LocalObjDesc->Integer.Value)
0283     {
0284         WalkState->ControlState->Common.Value = TRUE;
0285     }
0286     else
0287     {
0288         /*
0289          * Predicate is FALSE, we will just toss the
0290          * rest of the package
0291          */
0292         WalkState->ControlState->Common.Value = FALSE;
0293         Status = AE_CTRL_FALSE;
0294     }
0295 
0296     /* Predicate can be used for an implicit return value */
0297 
0298     (void) AcpiDsDoImplicitReturn (LocalObjDesc, WalkState, TRUE);
0299 
0300 
0301 Cleanup:
0302 
0303     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0304         "Completed a predicate eval=%X Op=%p\n",
0305         WalkState->ControlState->Common.Value, WalkState->Op));
0306 
0307     /* Break to debugger to display result */
0308 
0309     AcpiDbDisplayResultObject (LocalObjDesc, WalkState);
0310 
0311     /*
0312      * Delete the predicate result object (we know that
0313      * we don't need it anymore)
0314      */
0315     if (LocalObjDesc != ObjDesc)
0316     {
0317         AcpiUtRemoveReference (LocalObjDesc);
0318     }
0319     AcpiUtRemoveReference (ObjDesc);
0320 
0321     WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
0322     return_ACPI_STATUS (Status);
0323 }
0324 
0325 
0326 /*****************************************************************************
0327  *
0328  * FUNCTION:    AcpiDsExecBeginOp
0329  *
0330  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0331  *              OutOp           - Where to return op if a new one is created
0332  *
0333  * RETURN:      Status
0334  *
0335  * DESCRIPTION: Descending callback used during the execution of control
0336  *              methods. This is where most operators and operands are
0337  *              dispatched to the interpreter.
0338  *
0339  ****************************************************************************/
0340 
0341 ACPI_STATUS
0342 AcpiDsExecBeginOp (
0343     ACPI_WALK_STATE         *WalkState,
0344     ACPI_PARSE_OBJECT       **OutOp)
0345 {
0346     ACPI_PARSE_OBJECT       *Op;
0347     ACPI_STATUS             Status = AE_OK;
0348     UINT32                  OpcodeClass;
0349 
0350 
0351     ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
0352 
0353 
0354     Op = WalkState->Op;
0355     if (!Op)
0356     {
0357         Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
0358         if (ACPI_FAILURE (Status))
0359         {
0360             goto ErrorExit;
0361         }
0362 
0363         Op = *OutOp;
0364         WalkState->Op = Op;
0365         WalkState->Opcode = Op->Common.AmlOpcode;
0366         WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
0367 
0368         if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
0369         {
0370             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0371                 "(%s) Popping scope for Op %p\n",
0372                 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
0373 
0374             Status = AcpiDsScopeStackPop (WalkState);
0375             if (ACPI_FAILURE (Status))
0376             {
0377                 goto ErrorExit;
0378             }
0379         }
0380     }
0381 
0382     if (Op == WalkState->Origin)
0383     {
0384         if (OutOp)
0385         {
0386             *OutOp = Op;
0387         }
0388 
0389         return_ACPI_STATUS (AE_OK);
0390     }
0391 
0392     /*
0393      * If the previous opcode was a conditional, this opcode
0394      * must be the beginning of the associated predicate.
0395      * Save this knowledge in the current scope descriptor
0396      */
0397     if ((WalkState->ControlState) &&
0398         (WalkState->ControlState->Common.State ==
0399             ACPI_CONTROL_CONDITIONAL_EXECUTING))
0400     {
0401         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0402             "Exec predicate Op=%p State=%p\n",
0403             Op, WalkState));
0404 
0405         WalkState->ControlState->Common.State =
0406             ACPI_CONTROL_PREDICATE_EXECUTING;
0407 
0408         /* Save start of predicate */
0409 
0410         WalkState->ControlState->Control.PredicateOp = Op;
0411     }
0412 
0413 
0414     OpcodeClass = WalkState->OpInfo->Class;
0415 
0416     /* We want to send namepaths to the load code */
0417 
0418     if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
0419     {
0420         OpcodeClass = AML_CLASS_NAMED_OBJECT;
0421     }
0422 
0423     /*
0424      * Handle the opcode based upon the opcode type
0425      */
0426     switch (OpcodeClass)
0427     {
0428     case AML_CLASS_CONTROL:
0429 
0430         Status = AcpiDsExecBeginControlOp (WalkState, Op);
0431         break;
0432 
0433     case AML_CLASS_NAMED_OBJECT:
0434 
0435         if (WalkState->WalkType & ACPI_WALK_METHOD)
0436         {
0437             /*
0438              * Found a named object declaration during method execution;
0439              * we must enter this object into the namespace. The created
0440              * object is temporary and will be deleted upon completion of
0441              * the execution of this method.
0442              *
0443              * Note 10/2010: Except for the Scope() op. This opcode does
0444              * not actually create a new object, it refers to an existing
0445              * object. However, for Scope(), we want to indeed open a
0446              * new scope.
0447              */
0448             if (Op->Common.AmlOpcode != AML_SCOPE_OP)
0449             {
0450                 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
0451             }
0452             else
0453             {
0454                 Status = AcpiDsScopeStackPush (
0455                     Op->Named.Node, Op->Named.Node->Type, WalkState);
0456                 if (ACPI_FAILURE (Status))
0457                 {
0458                     return_ACPI_STATUS (Status);
0459                 }
0460             }
0461         }
0462         break;
0463 
0464     case AML_CLASS_EXECUTE:
0465     case AML_CLASS_CREATE:
0466 
0467         break;
0468 
0469     default:
0470 
0471         break;
0472     }
0473 
0474     /* Nothing to do here during method execution */
0475 
0476     return_ACPI_STATUS (Status);
0477 
0478 
0479 ErrorExit:
0480     Status = AcpiDsMethodError (Status, WalkState);
0481     return_ACPI_STATUS (Status);
0482 }
0483 
0484 
0485 /*****************************************************************************
0486  *
0487  * FUNCTION:    AcpiDsExecEndOp
0488  *
0489  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0490  *
0491  * RETURN:      Status
0492  *
0493  * DESCRIPTION: Ascending callback used during the execution of control
0494  *              methods. The only thing we really need to do here is to
0495  *              notice the beginning of IF, ELSE, and WHILE blocks.
0496  *
0497  ****************************************************************************/
0498 
0499 ACPI_STATUS
0500 AcpiDsExecEndOp (
0501     ACPI_WALK_STATE         *WalkState)
0502 {
0503     ACPI_PARSE_OBJECT       *Op;
0504     ACPI_STATUS             Status = AE_OK;
0505     UINT32                  OpType;
0506     UINT32                  OpClass;
0507     ACPI_PARSE_OBJECT       *NextOp;
0508     ACPI_PARSE_OBJECT       *FirstArg;
0509 #ifdef ACPI_EXEC_APP
0510     char                    *Namepath;
0511     ACPI_OPERAND_OBJECT     *ObjDesc;
0512 #endif
0513 
0514     ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
0515 
0516 
0517     Op = WalkState->Op;
0518     OpType = WalkState->OpInfo->Type;
0519     OpClass = WalkState->OpInfo->Class;
0520 
0521     if (OpClass == AML_CLASS_UNKNOWN)
0522     {
0523         ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%X", Op->Common.AmlOpcode));
0524         return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
0525     }
0526 
0527     FirstArg = Op->Common.Value.Arg;
0528 
0529     /* Init the walk state */
0530 
0531     WalkState->NumOperands = 0;
0532     WalkState->OperandIndex = 0;
0533     WalkState->ReturnDesc = NULL;
0534     WalkState->ResultObj = NULL;
0535 
0536     /* Call debugger for single step support (DEBUG build only) */
0537 
0538     Status = AcpiDbSingleStep (WalkState, Op, OpClass);
0539     if (ACPI_FAILURE (Status))
0540     {
0541         return_ACPI_STATUS (Status);
0542     }
0543 
0544     /* Decode the Opcode Class */
0545 
0546     switch (OpClass)
0547     {
0548     case AML_CLASS_ARGUMENT:    /* Constants, literals, etc. */
0549 
0550         if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
0551         {
0552             Status = AcpiDsEvaluateNamePath (WalkState);
0553             if (ACPI_FAILURE (Status))
0554             {
0555                 goto Cleanup;
0556             }
0557         }
0558         break;
0559 
0560     case AML_CLASS_EXECUTE:     /* Most operators with arguments */
0561 
0562         /* Build resolved operand stack */
0563 
0564         Status = AcpiDsCreateOperands (WalkState, FirstArg);
0565         if (ACPI_FAILURE (Status))
0566         {
0567             goto Cleanup;
0568         }
0569 
0570         /*
0571          * All opcodes require operand resolution, with the only exceptions
0572          * being the ObjectType and SizeOf operators as well as opcodes that
0573          * take no arguments.
0574          */
0575         if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE) &&
0576             (WalkState->OpInfo->Flags & AML_HAS_ARGS))
0577         {
0578             /* Resolve all operands */
0579 
0580             Status = AcpiExResolveOperands (WalkState->Opcode,
0581                 &(WalkState->Operands [WalkState->NumOperands -1]),
0582                 WalkState);
0583         }
0584 
0585         if (ACPI_SUCCESS (Status))
0586         {
0587             /*
0588              * Dispatch the request to the appropriate interpreter handler
0589              * routine. There is one routine per opcode "type" based upon the
0590              * number of opcode arguments and return type.
0591              */
0592             Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
0593         }
0594         else
0595         {
0596             /*
0597              * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
0598              * Local is uninitialized.
0599              */
0600             if  ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
0601                 (WalkState->Opcode == AML_STORE_OP) &&
0602                 (WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
0603                 (WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
0604                 (WalkState->Operands[0]->Reference.Class ==
0605                  WalkState->Operands[1]->Reference.Class) &&
0606                 (WalkState->Operands[0]->Reference.Value ==
0607                  WalkState->Operands[1]->Reference.Value))
0608             {
0609                 Status = AE_OK;
0610             }
0611             else
0612             {
0613                 ACPI_EXCEPTION ((AE_INFO, Status,
0614                     "While resolving operands for [%s]",
0615                     AcpiPsGetOpcodeName (WalkState->Opcode)));
0616             }
0617         }
0618 
0619         /* Always delete the argument objects and clear the operand stack */
0620 
0621         AcpiDsClearOperands (WalkState);
0622 
0623         /*
0624          * If a result object was returned from above, push it on the
0625          * current result stack
0626          */
0627         if (ACPI_SUCCESS (Status) &&
0628             WalkState->ResultObj)
0629         {
0630             Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
0631         }
0632         break;
0633 
0634     default:
0635 
0636         switch (OpType)
0637         {
0638         case AML_TYPE_CONTROL:    /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
0639 
0640             /* 1 Operand, 0 ExternalResult, 0 InternalResult */
0641 
0642             Status = AcpiDsExecEndControlOp (WalkState, Op);
0643 
0644             break;
0645 
0646         case AML_TYPE_METHOD_CALL:
0647             /*
0648              * If the method is referenced from within a package
0649              * declaration, it is not a invocation of the method, just
0650              * a reference to it.
0651              */
0652             if ((Op->Asl.Parent) &&
0653                ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
0654                 (Op->Asl.Parent->Asl.AmlOpcode == AML_VARIABLE_PACKAGE_OP)))
0655             {
0656                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0657                     "Method Reference in a Package, Op=%p\n", Op));
0658 
0659                 Op->Common.Node = (ACPI_NAMESPACE_NODE *)
0660                     Op->Asl.Value.Arg->Asl.Node;
0661                 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
0662                 return_ACPI_STATUS (AE_OK);
0663             }
0664 
0665             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0666                 "Method invocation, Op=%p\n", Op));
0667 
0668             /*
0669              * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
0670              * the method Node pointer
0671              */
0672             /* NextOp points to the op that holds the method name */
0673 
0674             NextOp = FirstArg;
0675 
0676             /* NextOp points to first argument op */
0677 
0678             NextOp = NextOp->Common.Next;
0679 
0680             /*
0681              * Get the method's arguments and put them on the operand stack
0682              */
0683             Status = AcpiDsCreateOperands (WalkState, NextOp);
0684             if (ACPI_FAILURE (Status))
0685             {
0686                 break;
0687             }
0688 
0689             /*
0690              * Since the operands will be passed to another control method,
0691              * we must resolve all local references here (Local variables,
0692              * arguments to *this* method, etc.)
0693              */
0694             Status = AcpiDsResolveOperands (WalkState);
0695             if (ACPI_FAILURE (Status))
0696             {
0697                 /* On error, clear all resolved operands */
0698 
0699                 AcpiDsClearOperands (WalkState);
0700                 break;
0701             }
0702 
0703             /*
0704              * Tell the walk loop to preempt this running method and
0705              * execute the new method
0706              */
0707             Status = AE_CTRL_TRANSFER;
0708 
0709             /*
0710              * Return now; we don't want to disturb anything,
0711              * especially the operand count!
0712              */
0713             return_ACPI_STATUS (Status);
0714 
0715         case AML_TYPE_CREATE_FIELD:
0716 
0717             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0718                 "Executing CreateField Buffer/Index Op=%p\n", Op));
0719 
0720             Status = AcpiDsLoad2EndOp (WalkState);
0721             if (ACPI_FAILURE (Status))
0722             {
0723                 break;
0724             }
0725 
0726             Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
0727             if (ACPI_FAILURE (Status))
0728             {
0729                 break;
0730             }
0731 
0732 #ifdef ACPI_EXEC_APP
0733             /*
0734              * AcpiExec support for namespace initialization file (initialize
0735              * BufferFields in this code.)
0736              */
0737             Namepath = AcpiNsGetExternalPathname (Op->Common.Node);
0738             Status = AeLookupInitFileEntry (Namepath, &ObjDesc);
0739             if (ACPI_SUCCESS (Status))
0740             {
0741                 Status = AcpiExWriteDataToField (ObjDesc, Op->Common.Node->Object, NULL);
0742                 if (ACPI_FAILURE (Status))
0743                 {
0744                     ACPI_EXCEPTION ((AE_INFO, Status, "While writing to buffer field"));
0745                 }
0746             }
0747             ACPI_FREE (Namepath);
0748             Status = AE_OK;
0749 #endif
0750             break;
0751 
0752 
0753         case AML_TYPE_CREATE_OBJECT:
0754 
0755             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0756                 "Executing CreateObject (Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",
0757                 Op, Op->Named.Value.Arg, Op->Common.Parent->Common.AmlOpcode));
0758 
0759             switch (Op->Common.Parent->Common.AmlOpcode)
0760             {
0761             case AML_NAME_OP:
0762                 /*
0763                  * Put the Node on the object stack (Contains the ACPI Name
0764                  * of this object)
0765                  */
0766                 WalkState->Operands[0] = (void *)
0767                     Op->Common.Parent->Common.Node;
0768                 WalkState->NumOperands = 1;
0769 
0770                 Status = AcpiDsCreateNode (WalkState,
0771                     Op->Common.Parent->Common.Node, Op->Common.Parent);
0772                 if (ACPI_FAILURE (Status))
0773                 {
0774                     break;
0775                 }
0776 
0777                 ACPI_FALLTHROUGH;
0778 
0779             case AML_INT_EVAL_SUBTREE_OP:
0780 
0781                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
0782                     AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
0783                 break;
0784 
0785             default:
0786 
0787                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
0788                 break;
0789             }
0790 
0791             /*
0792              * If a result object was returned from above, push it on the
0793              * current result stack
0794              */
0795             if (WalkState->ResultObj)
0796             {
0797                 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
0798             }
0799             break;
0800 
0801         case AML_TYPE_NAMED_FIELD:
0802         case AML_TYPE_NAMED_COMPLEX:
0803         case AML_TYPE_NAMED_SIMPLE:
0804         case AML_TYPE_NAMED_NO_OBJ:
0805 
0806             Status = AcpiDsLoad2EndOp (WalkState);
0807             if (ACPI_FAILURE (Status))
0808             {
0809                 break;
0810             }
0811 
0812             if (Op->Common.AmlOpcode == AML_REGION_OP)
0813             {
0814                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0815                     "Executing OpRegion Address/Length Op=%p\n", Op));
0816 
0817                 Status = AcpiDsEvalRegionOperands (WalkState, Op);
0818                 if (ACPI_FAILURE (Status))
0819                 {
0820                     break;
0821                 }
0822             }
0823             else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
0824             {
0825                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0826                     "Executing DataTableRegion Strings Op=%p\n", Op));
0827 
0828                 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
0829                 if (ACPI_FAILURE (Status))
0830                 {
0831                     break;
0832                 }
0833             }
0834             else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
0835             {
0836                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0837                     "Executing BankField Op=%p\n", Op));
0838 
0839                 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
0840                 if (ACPI_FAILURE (Status))
0841                 {
0842                     break;
0843                 }
0844             }
0845             break;
0846 
0847         case AML_TYPE_UNDEFINED:
0848 
0849             ACPI_ERROR ((AE_INFO,
0850                 "Undefined opcode type Op=%p", Op));
0851             return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
0852 
0853         case AML_TYPE_BOGUS:
0854 
0855             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0856                 "Internal opcode=%X type Op=%p\n",
0857                 WalkState->Opcode, Op));
0858             break;
0859 
0860         default:
0861 
0862             ACPI_ERROR ((AE_INFO,
0863                 "Unimplemented opcode, class=0x%X "
0864                 "type=0x%X Opcode=0x%X Op=%p",
0865                 OpClass, OpType, Op->Common.AmlOpcode, Op));
0866 
0867             Status = AE_NOT_IMPLEMENTED;
0868             break;
0869         }
0870     }
0871 
0872     /*
0873      * ACPI 2.0 support for 64-bit integers: Truncate numeric
0874      * result value if we are executing from a 32-bit ACPI table
0875      */
0876     (void) AcpiExTruncateFor32bitTable (WalkState->ResultObj);
0877 
0878     /*
0879      * Check if we just completed the evaluation of a
0880      * conditional predicate
0881      */
0882     if ((ACPI_SUCCESS (Status)) &&
0883         (WalkState->ControlState) &&
0884         (WalkState->ControlState->Common.State ==
0885             ACPI_CONTROL_PREDICATE_EXECUTING) &&
0886         (WalkState->ControlState->Control.PredicateOp == Op))
0887     {
0888         Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
0889         WalkState->ResultObj = NULL;
0890     }
0891 
0892 
0893 Cleanup:
0894 
0895     if (WalkState->ResultObj)
0896     {
0897         /* Break to debugger to display result */
0898 
0899         AcpiDbDisplayResultObject (WalkState->ResultObj,WalkState);
0900 
0901         /*
0902          * Delete the result op if and only if:
0903          * Parent will not use the result -- such as any
0904          * non-nested type2 op in a method (parent will be method)
0905          */
0906         AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
0907     }
0908 
0909 #ifdef _UNDER_DEVELOPMENT
0910 
0911     if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
0912     {
0913         AcpiDbMethodEnd (WalkState);
0914     }
0915 #endif
0916 
0917     /* Invoke exception handler on error */
0918 
0919     if (ACPI_FAILURE (Status))
0920     {
0921         Status = AcpiDsMethodError (Status, WalkState);
0922     }
0923 
0924     /* Always clear the object stack */
0925 
0926     WalkState->NumOperands = 0;
0927     return_ACPI_STATUS (Status);
0928 }