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