xref: /titanic_44/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c (revision 503ad85c168c7992ccc310af845a581cff3c72b5)
1 /******************************************************************************
2  *
3  * Module Name: dswexec - Dispatcher method execution callbacks;
4  *                        dispatch to interpreter.
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 
117 #define __DSWEXEC_C__
118 
119 #include "acpi.h"
120 #include "accommon.h"
121 #include "acparser.h"
122 #include "amlcode.h"
123 #include "acdispat.h"
124 #include "acinterp.h"
125 #include "acnamesp.h"
126 #include "acdebug.h"
127 
128 
129 #define _COMPONENT          ACPI_DISPATCHER
130         ACPI_MODULE_NAME    ("dswexec")
131 
132 /*
133  * Dispatch table for opcode classes
134  */
135 static ACPI_EXECUTE_OP      AcpiGbl_OpTypeDispatch [] =
136 {
137     AcpiExOpcode_0A_0T_1R,
138     AcpiExOpcode_1A_0T_0R,
139     AcpiExOpcode_1A_0T_1R,
140     AcpiExOpcode_1A_1T_0R,
141     AcpiExOpcode_1A_1T_1R,
142     AcpiExOpcode_2A_0T_0R,
143     AcpiExOpcode_2A_0T_1R,
144     AcpiExOpcode_2A_1T_1R,
145     AcpiExOpcode_2A_2T_1R,
146     AcpiExOpcode_3A_0T_0R,
147     AcpiExOpcode_3A_1T_1R,
148     AcpiExOpcode_6A_0T_1R
149 };
150 
151 
152 /*****************************************************************************
153  *
154  * FUNCTION:    AcpiDsGetPredicateValue
155  *
156  * PARAMETERS:  WalkState       - Current state of the parse tree walk
157  *              ResultObj       - if non-zero, pop result from result stack
158  *
159  * RETURN:      Status
160  *
161  * DESCRIPTION: Get the result of a predicate evaluation
162  *
163  ****************************************************************************/
164 
165 ACPI_STATUS
166 AcpiDsGetPredicateValue (
167     ACPI_WALK_STATE         *WalkState,
168     ACPI_OPERAND_OBJECT     *ResultObj)
169 {
170     ACPI_STATUS             Status = AE_OK;
171     ACPI_OPERAND_OBJECT     *ObjDesc;
172     ACPI_OPERAND_OBJECT     *LocalObjDesc = NULL;
173 
174 
175     ACPI_FUNCTION_TRACE_PTR (DsGetPredicateValue, WalkState);
176 
177 
178     WalkState->ControlState->Common.State = 0;
179 
180     if (ResultObj)
181     {
182         Status = AcpiDsResultPop (&ObjDesc, WalkState);
183         if (ACPI_FAILURE (Status))
184         {
185             ACPI_EXCEPTION ((AE_INFO, Status,
186                 "Could not get result from predicate evaluation"));
187 
188             return_ACPI_STATUS (Status);
189         }
190     }
191     else
192     {
193         Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
194         if (ACPI_FAILURE (Status))
195         {
196             return_ACPI_STATUS (Status);
197         }
198 
199         Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
200         if (ACPI_FAILURE (Status))
201         {
202             return_ACPI_STATUS (Status);
203         }
204 
205         ObjDesc = WalkState->Operands [0];
206     }
207 
208     if (!ObjDesc)
209     {
210         ACPI_ERROR ((AE_INFO,
211             "No predicate ObjDesc=%p State=%p",
212             ObjDesc, WalkState));
213 
214         return_ACPI_STATUS (AE_AML_NO_OPERAND);
215     }
216 
217     /*
218      * Result of predicate evaluation must be an Integer
219      * object. Implicitly convert the argument if necessary.
220      */
221     Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
222     if (ACPI_FAILURE (Status))
223     {
224         goto Cleanup;
225     }
226 
227     if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
228     {
229         ACPI_ERROR ((AE_INFO,
230             "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X",
231             ObjDesc, WalkState, ObjDesc->Common.Type));
232 
233         Status = AE_AML_OPERAND_TYPE;
234         goto Cleanup;
235     }
236 
237     /* Truncate the predicate to 32-bits if necessary */
238 
239     AcpiExTruncateFor32bitTable (LocalObjDesc);
240 
241     /*
242      * Save the result of the predicate evaluation on
243      * the control stack
244      */
245     if (LocalObjDesc->Integer.Value)
246     {
247         WalkState->ControlState->Common.Value = TRUE;
248     }
249     else
250     {
251         /*
252          * Predicate is FALSE, we will just toss the
253          * rest of the package
254          */
255         WalkState->ControlState->Common.Value = FALSE;
256         Status = AE_CTRL_FALSE;
257     }
258 
259     /* Predicate can be used for an implicit return value */
260 
261     (void) AcpiDsDoImplicitReturn (LocalObjDesc, WalkState, TRUE);
262 
263 
264 Cleanup:
265 
266     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
267         WalkState->ControlState->Common.Value, WalkState->Op));
268 
269      /* Break to debugger to display result */
270 
271     ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
272 
273     /*
274      * Delete the predicate result object (we know that
275      * we don't need it anymore)
276      */
277     if (LocalObjDesc != ObjDesc)
278     {
279         AcpiUtRemoveReference (LocalObjDesc);
280     }
281     AcpiUtRemoveReference (ObjDesc);
282 
283     WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
284     return_ACPI_STATUS (Status);
285 }
286 
287 
288 /*****************************************************************************
289  *
290  * FUNCTION:    AcpiDsExecBeginOp
291  *
292  * PARAMETERS:  WalkState       - Current state of the parse tree walk
293  *              OutOp           - Where to return op if a new one is created
294  *
295  * RETURN:      Status
296  *
297  * DESCRIPTION: Descending callback used during the execution of control
298  *              methods.  This is where most operators and operands are
299  *              dispatched to the interpreter.
300  *
301  ****************************************************************************/
302 
303 ACPI_STATUS
304 AcpiDsExecBeginOp (
305     ACPI_WALK_STATE         *WalkState,
306     ACPI_PARSE_OBJECT       **OutOp)
307 {
308     ACPI_PARSE_OBJECT       *Op;
309     ACPI_STATUS             Status = AE_OK;
310     UINT32                  OpcodeClass;
311 
312 
313     ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
314 
315 
316     Op = WalkState->Op;
317     if (!Op)
318     {
319         Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
320         if (ACPI_FAILURE (Status))
321         {
322             goto ErrorExit;
323         }
324 
325         Op = *OutOp;
326         WalkState->Op = Op;
327         WalkState->Opcode = Op->Common.AmlOpcode;
328         WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
329 
330         if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
331         {
332             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
333                 "(%s) Popping scope for Op %p\n",
334                 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
335 
336             Status = AcpiDsScopeStackPop (WalkState);
337             if (ACPI_FAILURE (Status))
338             {
339                 goto ErrorExit;
340             }
341         }
342     }
343 
344     if (Op == WalkState->Origin)
345     {
346         if (OutOp)
347         {
348             *OutOp = Op;
349         }
350 
351         return_ACPI_STATUS (AE_OK);
352     }
353 
354     /*
355      * If the previous opcode was a conditional, this opcode
356      * must be the beginning of the associated predicate.
357      * Save this knowledge in the current scope descriptor
358      */
359     if ((WalkState->ControlState) &&
360         (WalkState->ControlState->Common.State ==
361             ACPI_CONTROL_CONDITIONAL_EXECUTING))
362     {
363         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
364                         Op, WalkState));
365 
366         WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
367 
368         /* Save start of predicate */
369 
370         WalkState->ControlState->Control.PredicateOp = Op;
371     }
372 
373 
374     OpcodeClass = WalkState->OpInfo->Class;
375 
376     /* We want to send namepaths to the load code */
377 
378     if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
379     {
380         OpcodeClass = AML_CLASS_NAMED_OBJECT;
381     }
382 
383     /*
384      * Handle the opcode based upon the opcode type
385      */
386     switch (OpcodeClass)
387     {
388     case AML_CLASS_CONTROL:
389 
390         Status = AcpiDsExecBeginControlOp (WalkState, Op);
391         break;
392 
393 
394     case AML_CLASS_NAMED_OBJECT:
395 
396         if (WalkState->WalkType & ACPI_WALK_METHOD)
397         {
398             /*
399              * Found a named object declaration during method execution;
400              * we must enter this object into the namespace.  The created
401              * object is temporary and will be deleted upon completion of
402              * the execution of this method.
403              */
404             Status = AcpiDsLoad2BeginOp (WalkState, NULL);
405         }
406 
407         break;
408 
409 
410     case AML_CLASS_EXECUTE:
411     case AML_CLASS_CREATE:
412 
413         break;
414 
415 
416     default:
417         break;
418     }
419 
420     /* Nothing to do here during method execution */
421 
422     return_ACPI_STATUS (Status);
423 
424 
425 ErrorExit:
426     Status = AcpiDsMethodError (Status, WalkState);
427     return_ACPI_STATUS (Status);
428 }
429 
430 
431 /*****************************************************************************
432  *
433  * FUNCTION:    AcpiDsExecEndOp
434  *
435  * PARAMETERS:  WalkState       - Current state of the parse tree walk
436  *
437  * RETURN:      Status
438  *
439  * DESCRIPTION: Ascending callback used during the execution of control
440  *              methods.  The only thing we really need to do here is to
441  *              notice the beginning of IF, ELSE, and WHILE blocks.
442  *
443  ****************************************************************************/
444 
445 ACPI_STATUS
446 AcpiDsExecEndOp (
447     ACPI_WALK_STATE         *WalkState)
448 {
449     ACPI_PARSE_OBJECT       *Op;
450     ACPI_STATUS             Status = AE_OK;
451     UINT32                  OpType;
452     UINT32                  OpClass;
453     ACPI_PARSE_OBJECT       *NextOp;
454     ACPI_PARSE_OBJECT       *FirstArg;
455 
456 
457     ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
458 
459 
460     Op      = WalkState->Op;
461     OpType  = WalkState->OpInfo->Type;
462     OpClass = WalkState->OpInfo->Class;
463 
464     if (OpClass == AML_CLASS_UNKNOWN)
465     {
466         ACPI_ERROR ((AE_INFO, "Unknown opcode %X", Op->Common.AmlOpcode));
467         return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
468     }
469 
470     FirstArg = Op->Common.Value.Arg;
471 
472     /* Init the walk state */
473 
474     WalkState->NumOperands = 0;
475     WalkState->OperandIndex = 0;
476     WalkState->ReturnDesc = NULL;
477     WalkState->ResultObj = NULL;
478 
479     /* Call debugger for single step support (DEBUG build only) */
480 
481     ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
482     ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
483 
484     /* Decode the Opcode Class */
485 
486     switch (OpClass)
487     {
488     case AML_CLASS_ARGUMENT:    /* Constants, literals, etc. */
489 
490         if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
491         {
492             Status = AcpiDsEvaluateNamePath (WalkState);
493             if (ACPI_FAILURE (Status))
494             {
495                 goto Cleanup;
496             }
497         }
498         break;
499 
500 
501     case AML_CLASS_EXECUTE:     /* Most operators with arguments */
502 
503         /* Build resolved operand stack */
504 
505         Status = AcpiDsCreateOperands (WalkState, FirstArg);
506         if (ACPI_FAILURE (Status))
507         {
508             goto Cleanup;
509         }
510 
511         /*
512          * All opcodes require operand resolution, with the only exceptions
513          * being the ObjectType and SizeOf operators.
514          */
515         if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
516         {
517             /* Resolve all operands */
518 
519             Status = AcpiExResolveOperands (WalkState->Opcode,
520                         &(WalkState->Operands [WalkState->NumOperands -1]),
521                         WalkState);
522         }
523 
524         if (ACPI_SUCCESS (Status))
525         {
526             /*
527              * Dispatch the request to the appropriate interpreter handler
528              * routine.  There is one routine per opcode "type" based upon the
529              * number of opcode arguments and return type.
530              */
531             Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
532         }
533         else
534         {
535             /*
536              * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
537              * Local is uninitialized.
538              */
539             if  ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
540                 (WalkState->Opcode == AML_STORE_OP) &&
541                 (WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
542                 (WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
543                 (WalkState->Operands[0]->Reference.Class ==
544                  WalkState->Operands[1]->Reference.Class) &&
545                 (WalkState->Operands[0]->Reference.Value ==
546                  WalkState->Operands[1]->Reference.Value))
547             {
548                 Status = AE_OK;
549             }
550             else
551             {
552                 ACPI_EXCEPTION ((AE_INFO, Status,
553                     "While resolving operands for [%s]",
554                     AcpiPsGetOpcodeName (WalkState->Opcode)));
555             }
556         }
557 
558         /* Always delete the argument objects and clear the operand stack */
559 
560         AcpiDsClearOperands (WalkState);
561 
562         /*
563          * If a result object was returned from above, push it on the
564          * current result stack
565          */
566         if (ACPI_SUCCESS (Status) &&
567             WalkState->ResultObj)
568         {
569             Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
570         }
571         break;
572 
573 
574     default:
575 
576         switch (OpType)
577         {
578         case AML_TYPE_CONTROL:    /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
579 
580             /* 1 Operand, 0 ExternalResult, 0 InternalResult */
581 
582             Status = AcpiDsExecEndControlOp (WalkState, Op);
583 
584             break;
585 
586 
587         case AML_TYPE_METHOD_CALL:
588 
589             /*
590              * If the method is referenced from within a package
591              * declaration, it is not a invocation of the method, just
592              * a reference to it.
593              */
594             if ((Op->Asl.Parent) &&
595                ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
596                 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
597             {
598                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
599                     "Method Reference in a Package, Op=%p\n", Op));
600 
601                 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
602                 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
603                 return_ACPI_STATUS (AE_OK);
604             }
605 
606             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
607 
608             /*
609              * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
610              * the method Node pointer
611              */
612             /* NextOp points to the op that holds the method name */
613 
614             NextOp = FirstArg;
615 
616             /* NextOp points to first argument op */
617 
618             NextOp = NextOp->Common.Next;
619 
620             /*
621              * Get the method's arguments and put them on the operand stack
622              */
623             Status = AcpiDsCreateOperands (WalkState, NextOp);
624             if (ACPI_FAILURE (Status))
625             {
626                 break;
627             }
628 
629             /*
630              * Since the operands will be passed to another control method,
631              * we must resolve all local references here (Local variables,
632              * arguments to *this* method, etc.)
633              */
634             Status = AcpiDsResolveOperands (WalkState);
635             if (ACPI_FAILURE (Status))
636             {
637                 /* On error, clear all resolved operands */
638 
639                 AcpiDsClearOperands (WalkState);
640                 break;
641             }
642 
643             /*
644              * Tell the walk loop to preempt this running method and
645              * execute the new method
646              */
647             Status = AE_CTRL_TRANSFER;
648 
649             /*
650              * Return now; we don't want to disturb anything,
651              * especially the operand count!
652              */
653             return_ACPI_STATUS (Status);
654 
655 
656         case AML_TYPE_CREATE_FIELD:
657 
658             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
659                 "Executing CreateField Buffer/Index Op=%p\n", Op));
660 
661             Status = AcpiDsLoad2EndOp (WalkState);
662             if (ACPI_FAILURE (Status))
663             {
664                 break;
665             }
666 
667             Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
668             break;
669 
670 
671         case AML_TYPE_CREATE_OBJECT:
672 
673             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
674                 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
675 
676             switch (Op->Common.Parent->Common.AmlOpcode)
677             {
678             case AML_NAME_OP:
679 
680                 /*
681                  * Put the Node on the object stack (Contains the ACPI Name
682                  * of this object)
683                  */
684                 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
685                 WalkState->NumOperands = 1;
686 
687                 Status = AcpiDsCreateNode (WalkState,
688                             Op->Common.Parent->Common.Node,
689                             Op->Common.Parent);
690                 if (ACPI_FAILURE (Status))
691                 {
692                     break;
693                 }
694 
695                 /* Fall through */
696                 /*lint -fallthrough */
697 
698             case AML_INT_EVAL_SUBTREE_OP:
699 
700                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
701                             AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
702                 break;
703 
704             default:
705 
706                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
707                 break;
708             }
709 
710             /*
711              * If a result object was returned from above, push it on the
712              * current result stack
713              */
714             if (WalkState->ResultObj)
715             {
716                 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
717             }
718             break;
719 
720 
721         case AML_TYPE_NAMED_FIELD:
722         case AML_TYPE_NAMED_COMPLEX:
723         case AML_TYPE_NAMED_SIMPLE:
724         case AML_TYPE_NAMED_NO_OBJ:
725 
726             Status = AcpiDsLoad2EndOp (WalkState);
727             if (ACPI_FAILURE (Status))
728             {
729                 break;
730             }
731 
732             if (Op->Common.AmlOpcode == AML_REGION_OP)
733             {
734                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
735                     "Executing OpRegion Address/Length Op=%p\n", Op));
736 
737                 Status = AcpiDsEvalRegionOperands (WalkState, Op);
738                 if (ACPI_FAILURE (Status))
739                 {
740                     break;
741                 }
742             }
743             else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
744             {
745                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
746                     "Executing DataTableRegion Strings Op=%p\n", Op));
747 
748                 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
749                 if (ACPI_FAILURE (Status))
750                 {
751                     break;
752                 }
753             }
754             else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
755             {
756                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
757                     "Executing BankField Op=%p\n", Op));
758 
759                 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
760                 if (ACPI_FAILURE (Status))
761                 {
762                     break;
763                 }
764             }
765             break;
766 
767 
768         case AML_TYPE_UNDEFINED:
769 
770             ACPI_ERROR ((AE_INFO,
771                 "Undefined opcode type Op=%p", Op));
772             return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
773 
774 
775         case AML_TYPE_BOGUS:
776 
777             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
778                 "Internal opcode=%X type Op=%p\n",
779                 WalkState->Opcode, Op));
780             break;
781 
782 
783         default:
784 
785             ACPI_ERROR ((AE_INFO,
786                 "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p",
787                 OpClass, OpType, Op->Common.AmlOpcode, Op));
788 
789             Status = AE_NOT_IMPLEMENTED;
790             break;
791         }
792     }
793 
794     /*
795      * ACPI 2.0 support for 64-bit integers: Truncate numeric
796      * result value if we are executing from a 32-bit ACPI table
797      */
798     AcpiExTruncateFor32bitTable (WalkState->ResultObj);
799 
800     /*
801      * Check if we just completed the evaluation of a
802      * conditional predicate
803      */
804     if ((ACPI_SUCCESS (Status)) &&
805         (WalkState->ControlState) &&
806         (WalkState->ControlState->Common.State ==
807             ACPI_CONTROL_PREDICATE_EXECUTING) &&
808         (WalkState->ControlState->Control.PredicateOp == Op))
809     {
810         Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
811         WalkState->ResultObj = NULL;
812     }
813 
814 
815 Cleanup:
816 
817     if (WalkState->ResultObj)
818     {
819         /* Break to debugger to display result */
820 
821         ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
822                                 WalkState));
823 
824         /*
825          * Delete the result op if and only if:
826          * Parent will not use the result -- such as any
827          * non-nested type2 op in a method (parent will be method)
828          */
829         AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
830     }
831 
832 #ifdef _UNDER_DEVELOPMENT
833 
834     if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
835     {
836         AcpiDbMethodEnd (WalkState);
837     }
838 #endif
839 
840     /* Invoke exception handler on error */
841 
842     if (ACPI_FAILURE (Status))
843     {
844         Status = AcpiDsMethodError (Status, WalkState);
845     }
846 
847     /* Always clear the object stack */
848 
849     WalkState->NumOperands = 0;
850     return_ACPI_STATUS (Status);
851 }
852 
853 
854