Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/drivers/acpica/dswexec.c need to be fixed.

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 - 2009, 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 #define __DSWEXEC_C__
0118 
0119 #include "acpi.h"
0120 #include "accommon.h"
0121 #include "acparser.h"
0122 #include "amlcode.h"
0123 #include "acdispat.h"
0124 #include "acinterp.h"
0125 #include "acnamesp.h"
0126 #include "acdebug.h"
0127 
0128 
0129 #define _COMPONENT          ACPI_DISPATCHER
0130         ACPI_MODULE_NAME    ("dswexec")
0131 
0132 /*
0133  * Dispatch table for opcode classes
0134  */
0135 static ACPI_EXECUTE_OP      AcpiGbl_OpTypeDispatch [] =
0136 {
0137     AcpiExOpcode_0A_0T_1R,
0138     AcpiExOpcode_1A_0T_0R,
0139     AcpiExOpcode_1A_0T_1R,
0140     AcpiExOpcode_1A_1T_0R,
0141     AcpiExOpcode_1A_1T_1R,
0142     AcpiExOpcode_2A_0T_0R,
0143     AcpiExOpcode_2A_0T_1R,
0144     AcpiExOpcode_2A_1T_1R,
0145     AcpiExOpcode_2A_2T_1R,
0146     AcpiExOpcode_3A_0T_0R,
0147     AcpiExOpcode_3A_1T_1R,
0148     AcpiExOpcode_6A_0T_1R
0149 };
0150 
0151 
0152 /*****************************************************************************
0153  *
0154  * FUNCTION:    AcpiDsGetPredicateValue
0155  *
0156  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0157  *              ResultObj       - if non-zero, pop result from result stack
0158  *
0159  * RETURN:      Status
0160  *
0161  * DESCRIPTION: Get the result of a predicate evaluation
0162  *
0163  ****************************************************************************/
0164 
0165 ACPI_STATUS
0166 AcpiDsGetPredicateValue (
0167     ACPI_WALK_STATE         *WalkState,
0168     ACPI_OPERAND_OBJECT     *ResultObj)
0169 {
0170     ACPI_STATUS             Status = AE_OK;
0171     ACPI_OPERAND_OBJECT     *ObjDesc;
0172     ACPI_OPERAND_OBJECT     *LocalObjDesc = NULL;
0173 
0174 
0175     ACPI_FUNCTION_TRACE_PTR (DsGetPredicateValue, WalkState);
0176 
0177 
0178     WalkState->ControlState->Common.State = 0;
0179 
0180     if (ResultObj)
0181     {
0182         Status = AcpiDsResultPop (&ObjDesc, WalkState);
0183         if (ACPI_FAILURE (Status))
0184         {
0185             ACPI_EXCEPTION ((AE_INFO, Status,
0186                 "Could not get result from predicate evaluation"));
0187 
0188             return_ACPI_STATUS (Status);
0189         }
0190     }
0191     else
0192     {
0193         Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
0194         if (ACPI_FAILURE (Status))
0195         {
0196             return_ACPI_STATUS (Status);
0197         }
0198 
0199         Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
0200         if (ACPI_FAILURE (Status))
0201         {
0202             return_ACPI_STATUS (Status);
0203         }
0204 
0205         ObjDesc = WalkState->Operands [0];
0206     }
0207 
0208     if (!ObjDesc)
0209     {
0210         ACPI_ERROR ((AE_INFO,
0211             "No predicate ObjDesc=%p State=%p",
0212             ObjDesc, WalkState));
0213 
0214         return_ACPI_STATUS (AE_AML_NO_OPERAND);
0215     }
0216 
0217     /*
0218      * Result of predicate evaluation must be an Integer
0219      * object. Implicitly convert the argument if necessary.
0220      */
0221     Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
0222     if (ACPI_FAILURE (Status))
0223     {
0224         goto Cleanup;
0225     }
0226 
0227     if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
0228     {
0229         ACPI_ERROR ((AE_INFO,
0230             "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X",
0231             ObjDesc, WalkState, ObjDesc->Common.Type));
0232 
0233         Status = AE_AML_OPERAND_TYPE;
0234         goto Cleanup;
0235     }
0236 
0237     /* Truncate the predicate to 32-bits if necessary */
0238 
0239     AcpiExTruncateFor32bitTable (LocalObjDesc);
0240 
0241     /*
0242      * Save the result of the predicate evaluation on
0243      * the control stack
0244      */
0245     if (LocalObjDesc->Integer.Value)
0246     {
0247         WalkState->ControlState->Common.Value = TRUE;
0248     }
0249     else
0250     {
0251         /*
0252          * Predicate is FALSE, we will just toss the
0253          * rest of the package
0254          */
0255         WalkState->ControlState->Common.Value = FALSE;
0256         Status = AE_CTRL_FALSE;
0257     }
0258 
0259     /* Predicate can be used for an implicit return value */
0260 
0261     (void) AcpiDsDoImplicitReturn (LocalObjDesc, WalkState, TRUE);
0262 
0263 
0264 Cleanup:
0265 
0266     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
0267         WalkState->ControlState->Common.Value, WalkState->Op));
0268 
0269      /* Break to debugger to display result */
0270 
0271     ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
0272 
0273     /*
0274      * Delete the predicate result object (we know that
0275      * we don't need it anymore)
0276      */
0277     if (LocalObjDesc != ObjDesc)
0278     {
0279         AcpiUtRemoveReference (LocalObjDesc);
0280     }
0281     AcpiUtRemoveReference (ObjDesc);
0282 
0283     WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
0284     return_ACPI_STATUS (Status);
0285 }
0286 
0287 
0288 /*****************************************************************************
0289  *
0290  * FUNCTION:    AcpiDsExecBeginOp
0291  *
0292  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0293  *              OutOp           - Where to return op if a new one is created
0294  *
0295  * RETURN:      Status
0296  *
0297  * DESCRIPTION: Descending callback used during the execution of control
0298  *              methods.  This is where most operators and operands are
0299  *              dispatched to the interpreter.
0300  *
0301  ****************************************************************************/
0302 
0303 ACPI_STATUS
0304 AcpiDsExecBeginOp (
0305     ACPI_WALK_STATE         *WalkState,
0306     ACPI_PARSE_OBJECT       **OutOp)
0307 {
0308     ACPI_PARSE_OBJECT       *Op;
0309     ACPI_STATUS             Status = AE_OK;
0310     UINT32                  OpcodeClass;
0311 
0312 
0313     ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
0314 
0315 
0316     Op = WalkState->Op;
0317     if (!Op)
0318     {
0319         Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
0320         if (ACPI_FAILURE (Status))
0321         {
0322             goto ErrorExit;
0323         }
0324 
0325         Op = *OutOp;
0326         WalkState->Op = Op;
0327         WalkState->Opcode = Op->Common.AmlOpcode;
0328         WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
0329 
0330         if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
0331         {
0332             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0333                 "(%s) Popping scope for Op %p\n",
0334                 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
0335 
0336             Status = AcpiDsScopeStackPop (WalkState);
0337             if (ACPI_FAILURE (Status))
0338             {
0339                 goto ErrorExit;
0340             }
0341         }
0342     }
0343 
0344     if (Op == WalkState->Origin)
0345     {
0346         if (OutOp)
0347         {
0348             *OutOp = Op;
0349         }
0350 
0351         return_ACPI_STATUS (AE_OK);
0352     }
0353 
0354     /*
0355      * If the previous opcode was a conditional, this opcode
0356      * must be the beginning of the associated predicate.
0357      * Save this knowledge in the current scope descriptor
0358      */
0359     if ((WalkState->ControlState) &&
0360         (WalkState->ControlState->Common.State ==
0361             ACPI_CONTROL_CONDITIONAL_EXECUTING))
0362     {
0363         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
0364                         Op, WalkState));
0365 
0366         WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
0367 
0368         /* Save start of predicate */
0369 
0370         WalkState->ControlState->Control.PredicateOp = Op;
0371     }
0372 
0373 
0374     OpcodeClass = WalkState->OpInfo->Class;
0375 
0376     /* We want to send namepaths to the load code */
0377 
0378     if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
0379     {
0380         OpcodeClass = AML_CLASS_NAMED_OBJECT;
0381     }
0382 
0383     /*
0384      * Handle the opcode based upon the opcode type
0385      */
0386     switch (OpcodeClass)
0387     {
0388     case AML_CLASS_CONTROL:
0389 
0390         Status = AcpiDsExecBeginControlOp (WalkState, Op);
0391         break;
0392 
0393 
0394     case AML_CLASS_NAMED_OBJECT:
0395 
0396         if (WalkState->WalkType & ACPI_WALK_METHOD)
0397         {
0398             /*
0399              * Found a named object declaration during method execution;
0400              * we must enter this object into the namespace.  The created
0401              * object is temporary and will be deleted upon completion of
0402              * the execution of this method.
0403              */
0404             Status = AcpiDsLoad2BeginOp (WalkState, NULL);
0405         }
0406 
0407         break;
0408 
0409 
0410     case AML_CLASS_EXECUTE:
0411     case AML_CLASS_CREATE:
0412 
0413         break;
0414 
0415 
0416     default:
0417         break;
0418     }
0419 
0420     /* Nothing to do here during method execution */
0421 
0422     return_ACPI_STATUS (Status);
0423 
0424 
0425 ErrorExit:
0426     Status = AcpiDsMethodError (Status, WalkState);
0427     return_ACPI_STATUS (Status);
0428 }
0429 
0430 
0431 /*****************************************************************************
0432  *
0433  * FUNCTION:    AcpiDsExecEndOp
0434  *
0435  * PARAMETERS:  WalkState       - Current state of the parse tree walk
0436  *
0437  * RETURN:      Status
0438  *
0439  * DESCRIPTION: Ascending callback used during the execution of control
0440  *              methods.  The only thing we really need to do here is to
0441  *              notice the beginning of IF, ELSE, and WHILE blocks.
0442  *
0443  ****************************************************************************/
0444 
0445 ACPI_STATUS
0446 AcpiDsExecEndOp (
0447     ACPI_WALK_STATE         *WalkState)
0448 {
0449     ACPI_PARSE_OBJECT       *Op;
0450     ACPI_STATUS             Status = AE_OK;
0451     UINT32                  OpType;
0452     UINT32                  OpClass;
0453     ACPI_PARSE_OBJECT       *NextOp;
0454     ACPI_PARSE_OBJECT       *FirstArg;
0455 
0456 
0457     ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
0458 
0459 
0460     Op      = WalkState->Op;
0461     OpType  = WalkState->OpInfo->Type;
0462     OpClass = WalkState->OpInfo->Class;
0463 
0464     if (OpClass == AML_CLASS_UNKNOWN)
0465     {
0466         ACPI_ERROR ((AE_INFO, "Unknown opcode %X", Op->Common.AmlOpcode));
0467         return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
0468     }
0469 
0470     FirstArg = Op->Common.Value.Arg;
0471 
0472     /* Init the walk state */
0473 
0474     WalkState->NumOperands = 0;
0475     WalkState->OperandIndex = 0;
0476     WalkState->ReturnDesc = NULL;
0477     WalkState->ResultObj = NULL;
0478 
0479     /* Call debugger for single step support (DEBUG build only) */
0480 
0481     ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
0482     ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
0483 
0484     /* Decode the Opcode Class */
0485 
0486     switch (OpClass)
0487     {
0488     case AML_CLASS_ARGUMENT:    /* Constants, literals, etc. */
0489 
0490         if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
0491         {
0492             Status = AcpiDsEvaluateNamePath (WalkState);
0493             if (ACPI_FAILURE (Status))
0494             {
0495                 goto Cleanup;
0496             }
0497         }
0498         break;
0499 
0500 
0501     case AML_CLASS_EXECUTE:     /* Most operators with arguments */
0502 
0503         /* Build resolved operand stack */
0504 
0505         Status = AcpiDsCreateOperands (WalkState, FirstArg);
0506         if (ACPI_FAILURE (Status))
0507         {
0508             goto Cleanup;
0509         }
0510 
0511         /*
0512          * All opcodes require operand resolution, with the only exceptions
0513          * being the ObjectType and SizeOf operators.
0514          */
0515         if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
0516         {
0517             /* Resolve all operands */
0518 
0519             Status = AcpiExResolveOperands (WalkState->Opcode,
0520                         &(WalkState->Operands [WalkState->NumOperands -1]),
0521                         WalkState);
0522         }
0523 
0524         if (ACPI_SUCCESS (Status))
0525         {
0526             /*
0527              * Dispatch the request to the appropriate interpreter handler
0528              * routine.  There is one routine per opcode "type" based upon the
0529              * number of opcode arguments and return type.
0530              */
0531             Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
0532         }
0533         else
0534         {
0535             /*
0536              * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
0537              * Local is uninitialized.
0538              */
0539             if  ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
0540                 (WalkState->Opcode == AML_STORE_OP) &&
0541                 (WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
0542                 (WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
0543                 (WalkState->Operands[0]->Reference.Class ==
0544                  WalkState->Operands[1]->Reference.Class) &&
0545                 (WalkState->Operands[0]->Reference.Value ==
0546                  WalkState->Operands[1]->Reference.Value))
0547             {
0548                 Status = AE_OK;
0549             }
0550             else
0551             {
0552                 ACPI_EXCEPTION ((AE_INFO, Status,
0553                     "While resolving operands for [%s]",
0554                     AcpiPsGetOpcodeName (WalkState->Opcode)));
0555             }
0556         }
0557 
0558         /* Always delete the argument objects and clear the operand stack */
0559 
0560         AcpiDsClearOperands (WalkState);
0561 
0562         /*
0563          * If a result object was returned from above, push it on the
0564          * current result stack
0565          */
0566         if (ACPI_SUCCESS (Status) &&
0567             WalkState->ResultObj)
0568         {
0569             Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
0570         }
0571         break;
0572 
0573 
0574     default:
0575 
0576         switch (OpType)
0577         {
0578         case AML_TYPE_CONTROL:    /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
0579 
0580             /* 1 Operand, 0 ExternalResult, 0 InternalResult */
0581 
0582             Status = AcpiDsExecEndControlOp (WalkState, Op);
0583 
0584             break;
0585 
0586 
0587         case AML_TYPE_METHOD_CALL:
0588 
0589             /*
0590              * If the method is referenced from within a package
0591              * declaration, it is not a invocation of the method, just
0592              * a reference to it.
0593              */
0594             if ((Op->Asl.Parent) &&
0595                ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
0596                 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
0597             {
0598                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0599                     "Method Reference in a Package, Op=%p\n", Op));
0600 
0601                 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
0602                 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
0603                 return_ACPI_STATUS (AE_OK);
0604             }
0605 
0606             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
0607 
0608             /*
0609              * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
0610              * the method Node pointer
0611              */
0612             /* NextOp points to the op that holds the method name */
0613 
0614             NextOp = FirstArg;
0615 
0616             /* NextOp points to first argument op */
0617 
0618             NextOp = NextOp->Common.Next;
0619 
0620             /*
0621              * Get the method's arguments and put them on the operand stack
0622              */
0623             Status = AcpiDsCreateOperands (WalkState, NextOp);
0624             if (ACPI_FAILURE (Status))
0625             {
0626                 break;
0627             }
0628 
0629             /*
0630              * Since the operands will be passed to another control method,
0631              * we must resolve all local references here (Local variables,
0632              * arguments to *this* method, etc.)
0633              */
0634             Status = AcpiDsResolveOperands (WalkState);
0635             if (ACPI_FAILURE (Status))
0636             {
0637                 /* On error, clear all resolved operands */
0638 
0639                 AcpiDsClearOperands (WalkState);
0640                 break;
0641             }
0642 
0643             /*
0644              * Tell the walk loop to preempt this running method and
0645              * execute the new method
0646              */
0647             Status = AE_CTRL_TRANSFER;
0648 
0649             /*
0650              * Return now; we don't want to disturb anything,
0651              * especially the operand count!
0652              */
0653             return_ACPI_STATUS (Status);
0654 
0655 
0656         case AML_TYPE_CREATE_FIELD:
0657 
0658             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0659                 "Executing CreateField Buffer/Index Op=%p\n", Op));
0660 
0661             Status = AcpiDsLoad2EndOp (WalkState);
0662             if (ACPI_FAILURE (Status))
0663             {
0664                 break;
0665             }
0666 
0667             Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
0668             break;
0669 
0670 
0671         case AML_TYPE_CREATE_OBJECT:
0672 
0673             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0674                 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
0675 
0676             switch (Op->Common.Parent->Common.AmlOpcode)
0677             {
0678             case AML_NAME_OP:
0679 
0680                 /*
0681                  * Put the Node on the object stack (Contains the ACPI Name
0682                  * of this object)
0683                  */
0684                 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
0685                 WalkState->NumOperands = 1;
0686 
0687                 Status = AcpiDsCreateNode (WalkState,
0688                             Op->Common.Parent->Common.Node,
0689                             Op->Common.Parent);
0690                 if (ACPI_FAILURE (Status))
0691                 {
0692                     break;
0693                 }
0694 
0695                 /* Fall through */
0696                 /*lint -fallthrough */
0697 
0698             case AML_INT_EVAL_SUBTREE_OP:
0699 
0700                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
0701                             AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
0702                 break;
0703 
0704             default:
0705 
0706                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
0707                 break;
0708             }
0709 
0710             /*
0711              * If a result object was returned from above, push it on the
0712              * current result stack
0713              */
0714             if (WalkState->ResultObj)
0715             {
0716                 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
0717             }
0718             break;
0719 
0720 
0721         case AML_TYPE_NAMED_FIELD:
0722         case AML_TYPE_NAMED_COMPLEX:
0723         case AML_TYPE_NAMED_SIMPLE:
0724         case AML_TYPE_NAMED_NO_OBJ:
0725 
0726             Status = AcpiDsLoad2EndOp (WalkState);
0727             if (ACPI_FAILURE (Status))
0728             {
0729                 break;
0730             }
0731 
0732             if (Op->Common.AmlOpcode == AML_REGION_OP)
0733             {
0734                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0735                     "Executing OpRegion Address/Length Op=%p\n", Op));
0736 
0737                 Status = AcpiDsEvalRegionOperands (WalkState, Op);
0738                 if (ACPI_FAILURE (Status))
0739                 {
0740                     break;
0741                 }
0742             }
0743             else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
0744             {
0745                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0746                     "Executing DataTableRegion Strings Op=%p\n", Op));
0747 
0748                 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
0749                 if (ACPI_FAILURE (Status))
0750                 {
0751                     break;
0752                 }
0753             }
0754             else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
0755             {
0756                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0757                     "Executing BankField Op=%p\n", Op));
0758 
0759                 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
0760                 if (ACPI_FAILURE (Status))
0761                 {
0762                     break;
0763                 }
0764             }
0765             break;
0766 
0767 
0768         case AML_TYPE_UNDEFINED:
0769 
0770             ACPI_ERROR ((AE_INFO,
0771                 "Undefined opcode type Op=%p", Op));
0772             return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
0773 
0774 
0775         case AML_TYPE_BOGUS:
0776 
0777             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
0778                 "Internal opcode=%X type Op=%p\n",
0779                 WalkState->Opcode, Op));
0780             break;
0781 
0782 
0783         default:
0784 
0785             ACPI_ERROR ((AE_INFO,
0786                 "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p",
0787                 OpClass, OpType, Op->Common.AmlOpcode, Op));
0788 
0789             Status = AE_NOT_IMPLEMENTED;
0790             break;
0791         }
0792     }
0793 
0794     /*
0795      * ACPI 2.0 support for 64-bit integers: Truncate numeric
0796      * result value if we are executing from a 32-bit ACPI table
0797      */
0798     AcpiExTruncateFor32bitTable (WalkState->ResultObj);
0799 
0800     /*
0801      * Check if we just completed the evaluation of a
0802      * conditional predicate
0803      */
0804     if ((ACPI_SUCCESS (Status)) &&
0805         (WalkState->ControlState) &&
0806         (WalkState->ControlState->Common.State ==
0807             ACPI_CONTROL_PREDICATE_EXECUTING) &&
0808         (WalkState->ControlState->Control.PredicateOp == Op))
0809     {
0810         Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
0811         WalkState->ResultObj = NULL;
0812     }
0813 
0814 
0815 Cleanup:
0816 
0817     if (WalkState->ResultObj)
0818     {
0819         /* Break to debugger to display result */
0820 
0821         ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
0822                                 WalkState));
0823 
0824         /*
0825          * Delete the result op if and only if:
0826          * Parent will not use the result -- such as any
0827          * non-nested type2 op in a method (parent will be method)
0828          */
0829         AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
0830     }
0831 
0832 #ifdef _UNDER_DEVELOPMENT
0833 
0834     if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
0835     {
0836         AcpiDbMethodEnd (WalkState);
0837     }
0838 #endif
0839 
0840     /* Invoke exception handler on error */
0841 
0842     if (ACPI_FAILURE (Status))
0843     {
0844         Status = AcpiDsMethodError (Status, WalkState);
0845     }
0846 
0847     /* Always clear the object stack */
0848 
0849     WalkState->NumOperands = 0;
0850     return_ACPI_STATUS (Status);
0851 }
0852 
0853