]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/dev/acpica/dswexec.c
Import the 20010518 Intel ACPI CA release. Note that Intel's directory layout
[FreeBSD/FreeBSD.git] / sys / contrib / dev / acpica / dswexec.c
1 /******************************************************************************
2  *
3  * Module Name: dswexec - Dispatcher method execution callbacks;
4  *                        dispatch to interpreter.
5  *              $Revision: 61 $
6  *
7  *****************************************************************************/
8
9 /******************************************************************************
10  *
11  * 1. Copyright Notice
12  *
13  * Some or all of this work - Copyright (c) 1999, 2000, 2001, 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 "acpi.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         MODULE_NAME         ("dswexec")
131
132
133 /*****************************************************************************
134  *
135  * FUNCTION:    AcpiDsGetPredicateValue
136  *
137  * PARAMETERS:  WalkState       - Current state of the parse tree walk
138  *
139  * RETURN:      Status
140  *
141  * DESCRIPTION: Get the result of a predicate evaluation
142  *
143  ****************************************************************************/
144
145 ACPI_STATUS
146 AcpiDsGetPredicateValue (
147     ACPI_WALK_STATE         *WalkState,
148     ACPI_PARSE_OBJECT       *Op,
149     UINT32                  HasResultObj)
150 {
151     ACPI_STATUS             Status = AE_OK;
152     ACPI_OPERAND_OBJECT     *ObjDesc;
153
154
155     FUNCTION_TRACE_PTR ("DsGetPredicateValue", WalkState);
156
157
158     WalkState->ControlState->Common.State = 0;
159
160     if (HasResultObj)
161     {
162         Status = AcpiDsResultPop (&ObjDesc, WalkState);
163         if (ACPI_FAILURE (Status))
164         {
165             DEBUG_PRINTP (ACPI_ERROR,
166                 ("Could not get result from predicate evaluation, %s\n",
167                 AcpiUtFormatException (Status)));
168
169             return_ACPI_STATUS (Status);
170         }
171     }
172
173     else
174     {
175         Status = AcpiDsCreateOperand (WalkState, Op, 0);
176         if (ACPI_FAILURE (Status))
177         {
178             return_ACPI_STATUS (Status);
179         }
180
181         Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
182         if (ACPI_FAILURE (Status))
183         {
184             return_ACPI_STATUS (Status);
185         }
186
187         ObjDesc = WalkState->Operands [0];
188     }
189
190     if (!ObjDesc)
191     {
192         DEBUG_PRINTP (ACPI_ERROR, ("No predicate ObjDesc=%X State=%X\n",
193             ObjDesc, WalkState));
194
195         return_ACPI_STATUS (AE_AML_NO_OPERAND);
196     }
197
198
199     /*
200      * Result of predicate evaluation currently must
201      * be a number
202      */
203
204     if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
205     {
206         DEBUG_PRINTP (ACPI_ERROR,
207             ("Bad predicate (not a number) ObjDesc=%X State=%X Type=%X\n",
208             ObjDesc, WalkState, ObjDesc->Common.Type));
209
210         Status = AE_AML_OPERAND_TYPE;
211         goto Cleanup;
212     }
213
214
215     /* Truncate the predicate to 32-bits if necessary */
216
217     AcpiExTruncateFor32bitTable (ObjDesc, WalkState);
218
219     /*
220      * Save the result of the predicate evaluation on
221      * the control stack
222      */
223
224     if (ObjDesc->Integer.Value)
225     {
226         WalkState->ControlState->Common.Value = TRUE;
227     }
228
229     else
230     {
231         /*
232          * Predicate is FALSE, we will just toss the
233          * rest of the package
234          */
235
236         WalkState->ControlState->Common.Value = FALSE;
237         Status = AE_CTRL_FALSE;
238     }
239
240
241 Cleanup:
242
243     DEBUG_PRINTP (TRACE_EXEC, ("Completed a predicate eval=%X Op=%X\n",
244         WalkState->ControlState->Common.Value, Op));
245
246      /* Break to debugger to display result */
247
248     DEBUGGER_EXEC (AcpiDbDisplayResultObject (ObjDesc, WalkState));
249
250     /*
251      * Delete the predicate result object (we know that
252      * we don't need it anymore)
253      */
254
255     AcpiUtRemoveReference (ObjDesc);
256
257     WalkState->ControlState->Common.State = CONTROL_NORMAL;
258
259     return_ACPI_STATUS (Status);
260 }
261
262
263 /*****************************************************************************
264  *
265  * FUNCTION:    AcpiDsExecBeginOp
266  *
267  * PARAMETERS:  WalkState       - Current state of the parse tree walk
268  *              Op              - Op that has been just been reached in the
269  *                                walk;  Arguments have not been evaluated yet.
270  *
271  * RETURN:      Status
272  *
273  * DESCRIPTION: Descending callback used during the execution of control
274  *              methods.  This is where most operators and operands are
275  *              dispatched to the interpreter.
276  *
277  ****************************************************************************/
278
279 ACPI_STATUS
280 AcpiDsExecBeginOp (
281     UINT16                  Opcode,
282     ACPI_PARSE_OBJECT       *Op,
283     ACPI_WALK_STATE         *WalkState,
284     ACPI_PARSE_OBJECT       **OutOp)
285 {
286     ACPI_OPCODE_INFO        *OpInfo;
287     ACPI_STATUS             Status = AE_OK;
288
289
290     FUNCTION_TRACE_PTR ("DsExecBeginOp", Op);
291
292
293     if (!Op)
294     {
295         Status = AcpiDsLoad2BeginOp (Opcode, NULL, WalkState, OutOp);
296         if (ACPI_FAILURE (Status))
297         {
298             return_ACPI_STATUS (Status);
299         }
300
301         Op = *OutOp;
302     }
303
304     if (Op == WalkState->Origin)
305     {
306         if (OutOp)
307         {
308             *OutOp = Op;
309         }
310
311         return_ACPI_STATUS (AE_OK);
312     }
313
314     /*
315      * If the previous opcode was a conditional, this opcode
316      * must be the beginning of the associated predicate.
317      * Save this knowledge in the current scope descriptor
318      */
319
320     if ((WalkState->ControlState) &&
321         (WalkState->ControlState->Common.State ==
322             CONTROL_CONDITIONAL_EXECUTING))
323     {
324         DEBUG_PRINTP (TRACE_EXEC, ("Exec predicate Op=%X State=%X\n",
325                         Op, WalkState));
326
327         WalkState->ControlState->Common.State = CONTROL_PREDICATE_EXECUTING;
328
329         /* Save start of predicate */
330
331         WalkState->ControlState->Control.PredicateOp = Op;
332     }
333
334
335     OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
336
337     /* We want to send namepaths to the load code */
338
339     if (Op->Opcode == AML_INT_NAMEPATH_OP)
340     {
341         OpInfo->Flags = OPTYPE_NAMED_OBJECT;
342     }
343
344
345     /*
346      * Handle the opcode based upon the opcode type
347      */
348
349     switch (ACPI_GET_OP_CLASS (OpInfo))
350     {
351     case OPTYPE_CONTROL:
352
353         Status = AcpiDsResultStackPush (WalkState);
354         if (ACPI_FAILURE (Status))
355         {
356             return_ACPI_STATUS (Status);
357         }
358
359         Status = AcpiDsExecBeginControlOp (WalkState, Op);
360         break;
361
362
363     case OPTYPE_NAMED_OBJECT:
364
365         if (WalkState->WalkType == WALK_METHOD)
366         {
367             /*
368              * Found a named object declaration during method
369              * execution;  we must enter this object into the
370              * namespace.  The created object is temporary and
371              * will be deleted upon completion of the execution
372              * of this method.
373              */
374
375             Status = AcpiDsLoad2BeginOp (Op->Opcode, Op, WalkState, NULL);
376         }
377
378
379         if (Op->Opcode == AML_REGION_OP)
380         {
381             Status = AcpiDsResultStackPush (WalkState);
382         }
383
384         break;
385
386
387     /* most operators with arguments */
388
389     case OPTYPE_MONADIC1:
390     case OPTYPE_DYADIC1:
391     case OPTYPE_MONADIC2:
392     case OPTYPE_MONADIC2R:
393     case OPTYPE_DYADIC2:
394     case OPTYPE_DYADIC2R:
395     case OPTYPE_DYADIC2S:
396     case OPTYPE_RECONFIGURATION:
397     case OPTYPE_INDEX:
398     case OPTYPE_MATCH:
399     case OPTYPE_FATAL:
400     case OPTYPE_CREATE_FIELD:
401
402         /* Start a new result/operand state */
403
404         Status = AcpiDsResultStackPush (WalkState);
405         break;
406
407
408     default:
409         break;
410     }
411
412     /* Nothing to do here during method execution */
413
414     return_ACPI_STATUS (Status);
415 }
416
417
418 /*****************************************************************************
419  *
420  * FUNCTION:    AcpiDsExecEndOp
421  *
422  * PARAMETERS:  WalkState       - Current state of the parse tree walk
423  *              Op              - Op that has been just been completed in the
424  *                                walk;  Arguments have now been evaluated.
425  *
426  * RETURN:      Status
427  *
428  * DESCRIPTION: Ascending callback used during the execution of control
429  *              methods.  The only thing we really need to do here is to
430  *              notice the beginning of IF, ELSE, and WHILE blocks.
431  *
432  ****************************************************************************/
433
434 ACPI_STATUS
435 AcpiDsExecEndOp (
436     ACPI_WALK_STATE         *WalkState,
437     ACPI_PARSE_OBJECT       *Op)
438 {
439     ACPI_STATUS             Status = AE_OK;
440     UINT16                  Opcode;
441     UINT8                   Optype;
442     ACPI_PARSE_OBJECT       *NextOp;
443     ACPI_PARSE_OBJECT       *FirstArg;
444     ACPI_OPERAND_OBJECT     *ResultObj = NULL;
445     ACPI_OPCODE_INFO        *OpInfo;
446
447
448     FUNCTION_TRACE_PTR ("DsExecEndOp", Op);
449
450
451     Opcode = (UINT16) Op->Opcode;
452
453
454     OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
455     if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
456     {
457         DEBUG_PRINTP (ACPI_ERROR, ("Unknown opcode %X\n", Op->Opcode));
458         return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
459     }
460
461     Optype = (UINT8) ACPI_GET_OP_CLASS (OpInfo);
462     FirstArg = Op->Value.Arg;
463
464     /* Init the walk state */
465
466     WalkState->NumOperands = 0;
467     WalkState->ReturnDesc = NULL;
468     WalkState->OpInfo = OpInfo;
469     WalkState->Opcode = Opcode;
470
471
472     /* Call debugger for single step support (DEBUG build only) */
473
474     DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, Optype));
475     DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
476
477
478     /* Decode the opcode */
479
480     switch (Optype)
481     {
482     case OPTYPE_UNDEFINED:
483
484         DEBUG_PRINTP (ACPI_ERROR, ("Undefined opcode type Op=%X\n", Op));
485         return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
486         break;
487
488
489     case OPTYPE_BOGUS:
490         DEBUG_PRINTP (TRACE_DISPATCH, ("Internal opcode=%X type Op=%X\n",
491             Opcode, Op));
492         break;
493
494     case OPTYPE_CONSTANT:           /* argument type only */
495     case OPTYPE_LITERAL:            /* argument type only */
496     case OPTYPE_DATA_TERM:          /* argument type only */
497     case OPTYPE_LOCAL_VARIABLE:     /* argument type only */
498     case OPTYPE_METHOD_ARGUMENT:    /* argument type only */
499         break;
500
501
502     /* most operators with arguments */
503
504     case OPTYPE_MONADIC1:
505     case OPTYPE_DYADIC1:
506     case OPTYPE_MONADIC2:
507     case OPTYPE_MONADIC2R:
508     case OPTYPE_DYADIC2:
509     case OPTYPE_DYADIC2R:
510     case OPTYPE_DYADIC2S:
511     case OPTYPE_RECONFIGURATION:
512     case OPTYPE_INDEX:
513     case OPTYPE_MATCH:
514     case OPTYPE_FATAL:
515
516
517         /* Build resolved operand stack */
518
519         Status = AcpiDsCreateOperands (WalkState, FirstArg);
520         if (ACPI_FAILURE (Status))
521         {
522             goto Cleanup;
523         }
524
525         /* Done with this result state (Now that operand stack is built) */
526
527         Status = AcpiDsResultStackPop (WalkState);
528         if (ACPI_FAILURE (Status))
529         {
530             goto Cleanup;
531         }
532
533         switch (Optype)
534         {
535         case OPTYPE_MONADIC1:
536
537             /* 1 Operand, 0 ExternalResult, 0 InternalResult */
538
539             Status = AcpiExMonadic1 (Opcode, WalkState);
540             break;
541
542
543         case OPTYPE_MONADIC2:
544
545             /* 1 Operand, 0 ExternalResult, 1 InternalResult */
546
547             Status = AcpiExMonadic2 (Opcode, WalkState, &ResultObj);
548             break;
549
550
551         case OPTYPE_MONADIC2R:
552
553             /* 1 Operand, 1 ExternalResult, 1 InternalResult */
554
555             Status = AcpiExMonadic2R (Opcode, WalkState, &ResultObj);
556             break;
557
558
559         case OPTYPE_DYADIC1:
560
561             /* 2 Operands, 0 ExternalResult, 0 InternalResult */
562
563             Status = AcpiExDyadic1 (Opcode, WalkState);
564             break;
565
566
567         case OPTYPE_DYADIC2:
568
569             /* 2 Operands, 0 ExternalResult, 1 InternalResult */
570
571             Status = AcpiExDyadic2 (Opcode, WalkState, &ResultObj);
572             break;
573
574
575         case OPTYPE_DYADIC2R:
576
577             /* 2 Operands, 1 or 2 ExternalResults, 1 InternalResult */
578
579             Status = AcpiExDyadic2R (Opcode, WalkState, &ResultObj);
580             break;
581
582
583         case OPTYPE_DYADIC2S:   /* Synchronization Operator */
584
585             /* 2 Operands, 0 ExternalResult, 1 InternalResult */
586
587             Status = AcpiExDyadic2S (Opcode, WalkState, &ResultObj);
588             break;
589
590
591         case OPTYPE_INDEX:  /* Type 2 opcode with 3 operands */
592
593             /* 3 Operands, 1 ExternalResult, 1 InternalResult */
594
595             Status = AcpiExIndex (WalkState, &ResultObj);
596             break;
597
598
599         case OPTYPE_MATCH:  /* Type 2 opcode with 6 operands */
600
601             /* 6 Operands, 0 ExternalResult, 1 InternalResult */
602
603             Status = AcpiExMatch (WalkState, &ResultObj);
604             break;
605
606
607         case OPTYPE_RECONFIGURATION:
608
609             /* 1 or 2 operands, 0 Internal Result */
610
611             Status = AcpiExReconfiguration (Opcode, WalkState);
612             break;
613
614
615         case OPTYPE_FATAL:
616
617             /* 3 Operands, 0 ExternalResult, 0 InternalResult */
618
619             Status = AcpiExFatal (WalkState);
620             break;
621         }
622
623         /*
624          * If a result object was returned from above, push it on the
625          * current result stack
626          */
627         if (ACPI_SUCCESS (Status) &&
628             ResultObj)
629         {
630             Status = AcpiDsResultPush (ResultObj, WalkState);
631         }
632
633         break;
634
635
636     case OPTYPE_CONTROL:    /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
637
638         /* 1 Operand, 0 ExternalResult, 0 InternalResult */
639
640         Status = AcpiDsExecEndControlOp (WalkState, Op);
641
642         AcpiDsResultStackPop (WalkState);
643         break;
644
645
646     case OPTYPE_METHOD_CALL:
647
648         DEBUG_PRINTP (TRACE_DISPATCH, ("Method invocation, Op=%X\n", Op));
649
650         /*
651          * (AML_METHODCALL) Op->Value->Arg->Node contains
652          * the method Node pointer
653          */
654         /* NextOp points to the op that holds the method name */
655
656         NextOp = FirstArg;
657
658         /* NextOp points to first argument op */
659
660         NextOp = NextOp->Next;
661
662         /*
663          * Get the method's arguments and put them on the operand stack
664          */
665         Status = AcpiDsCreateOperands (WalkState, NextOp);
666         if (ACPI_FAILURE (Status))
667         {
668             break;
669         }
670
671         /*
672          * Since the operands will be passed to another
673          * control method, we must resolve all local
674          * references here (Local variables, arguments
675          * to *this* method, etc.)
676          */
677
678         Status = AcpiDsResolveOperands (WalkState);
679         if (ACPI_FAILURE (Status))
680         {
681             break;
682         }
683
684         /*
685          * Tell the walk loop to preempt this running method and
686          * execute the new method
687          */
688         Status = AE_CTRL_TRANSFER;
689
690         /*
691          * Return now; we don't want to disturb anything,
692          * especially the operand count!
693          */
694         return_ACPI_STATUS (Status);
695         break;
696
697
698     case OPTYPE_CREATE_FIELD:
699
700         DEBUG_PRINTP (TRACE_EXEC, 
701             ("Executing CreateField Buffer/Index Op=%X\n", Op));
702
703         Status = AcpiDsLoad2EndOp (WalkState, Op);
704         if (ACPI_FAILURE (Status))
705         {
706             break;
707         }
708
709         Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
710         break;
711
712
713     case OPTYPE_NAMED_OBJECT:
714
715         Status = AcpiDsLoad2EndOp (WalkState, Op);
716         if (ACPI_FAILURE (Status))
717         {
718             break;
719         }
720
721         switch (Op->Opcode)
722         {
723         case AML_REGION_OP:
724
725             DEBUG_PRINTP (TRACE_EXEC,
726                 ("Executing OpRegion Address/Length Op=%X\n", Op));
727
728             Status = AcpiDsEvalRegionOperands (WalkState, Op);
729             if (ACPI_FAILURE (Status))
730             {
731                 break;
732             }
733
734             Status = AcpiDsResultStackPop (WalkState);
735             break;
736
737
738         case AML_METHOD_OP:
739             break;
740
741
742         case AML_ALIAS_OP:
743
744             /* Alias creation was already handled by call
745             to psxload above */
746             break;
747
748
749         default:
750             /* Nothing needs to be done */
751
752             Status = AE_OK;
753             break;
754         }
755
756         break;
757
758     default:
759
760         DEBUG_PRINTP (ACPI_ERROR, 
761             ("Unimplemented opcode, type=%X Opcode=%X Op=%X\n",
762             Optype, Op->Opcode, Op));
763
764         Status = AE_NOT_IMPLEMENTED;
765         break;
766     }
767
768
769     /*
770      * ACPI 2.0 support for 64-bit integers:
771      * Truncate numeric result value if we are executing from a 32-bit ACPI table
772      */
773     AcpiExTruncateFor32bitTable (ResultObj, WalkState);
774
775     /*
776      * Check if we just completed the evaluation of a
777      * conditional predicate
778      */
779
780     if ((WalkState->ControlState) &&
781         (WalkState->ControlState->Common.State ==
782             CONTROL_PREDICATE_EXECUTING) &&
783         (WalkState->ControlState->Control.PredicateOp == Op))
784     {
785         Status = AcpiDsGetPredicateValue (WalkState, Op, (UINT32) ResultObj);
786         ResultObj = NULL;
787     }
788
789
790 Cleanup:
791     if (ResultObj)
792     {
793         /* Break to debugger to display result */
794
795         DEBUGGER_EXEC (AcpiDbDisplayResultObject (ResultObj, WalkState));
796
797         /*
798          * Delete the result op if and only if:
799          * Parent will not use the result -- such as any
800          * non-nested type2 op in a method (parent will be method)
801          */
802         AcpiDsDeleteResultIfNotUsed (Op, ResultObj, WalkState);
803     }
804
805     /* Always clear the object stack */
806
807     /* TBD: [Investigate] Clear stack of return value,
808     but don't delete it */
809     WalkState->NumOperands = 0;
810
811     return_ACPI_STATUS (Status);
812 }
813
814