checkdirs() was being passed the wrong mount point, resulting in a panic
[dragonfly.git] / sys / contrib / dev / acpica-unix-20050309 / interpreter / dispatcher / dswexec.c
blob538c69aef50424ac01710b60d7b8650a75291a13
1 /******************************************************************************
3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 * dispatch to interpreter.
5 * $Revision: 117 $
7 *****************************************************************************/
9 /******************************************************************************
11 * 1. Copyright Notice
13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
14 * All rights reserved.
16 * 2. License
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.
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
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;
39 * The above copyright and patent license is granted only if the following
40 * conditions are met:
42 * 3. Conditions
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.
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.
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.
74 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * Intel Code.
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.
82 * 4. Disclaimer and Export Compliance
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.
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.
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.
116 *****************************************************************************/
118 #define __DSWEXEC_C__
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 #include "acdisasm.h"
130 #define _COMPONENT ACPI_DISPATCHER
131 ACPI_MODULE_NAME ("dswexec")
134 * Dispatch table for opcode classes
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};
150 /*****************************************************************************
152 * FUNCTION: AcpiDsGetPredicateValue
154 * PARAMETERS: WalkState - Current state of the parse tree walk
156 * RETURN: Status
158 * DESCRIPTION: Get the result of a predicate evaluation
160 ****************************************************************************/
162 ACPI_STATUS
163 AcpiDsGetPredicateValue (
164 ACPI_WALK_STATE *WalkState,
165 ACPI_OPERAND_OBJECT *ResultObj)
167 ACPI_STATUS Status = AE_OK;
168 ACPI_OPERAND_OBJECT *ObjDesc;
169 ACPI_OPERAND_OBJECT *LocalObjDesc = NULL;
172 ACPI_FUNCTION_TRACE_PTR ("DsGetPredicateValue", WalkState);
175 WalkState->ControlState->Common.State = 0;
177 if (ResultObj)
179 Status = AcpiDsResultPop (&ObjDesc, WalkState);
180 if (ACPI_FAILURE (Status))
182 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
183 "Could not get result from predicate evaluation, %s\n",
184 AcpiFormatException (Status)));
186 return_ACPI_STATUS (Status);
189 else
191 Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
192 if (ACPI_FAILURE (Status))
194 return_ACPI_STATUS (Status);
197 Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
198 if (ACPI_FAILURE (Status))
200 return_ACPI_STATUS (Status);
203 ObjDesc = WalkState->Operands [0];
206 if (!ObjDesc)
208 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate ObjDesc=%p State=%p\n",
209 ObjDesc, WalkState));
211 return_ACPI_STATUS (AE_AML_NO_OPERAND);
215 * Result of predicate evaluation must be an Integer
216 * object. Implicitly convert the argument if necessary.
218 Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
219 if (ACPI_FAILURE (Status))
221 goto Cleanup;
224 if (ACPI_GET_OBJECT_TYPE (LocalObjDesc) != ACPI_TYPE_INTEGER)
226 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
227 "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X\n",
228 ObjDesc, WalkState, ACPI_GET_OBJECT_TYPE (ObjDesc)));
230 Status = AE_AML_OPERAND_TYPE;
231 goto Cleanup;
234 /* Truncate the predicate to 32-bits if necessary */
236 AcpiExTruncateFor32bitTable (LocalObjDesc);
239 * Save the result of the predicate evaluation on
240 * the control stack
242 if (LocalObjDesc->Integer.Value)
244 WalkState->ControlState->Common.Value = TRUE;
246 else
249 * Predicate is FALSE, we will just toss the
250 * rest of the package
252 WalkState->ControlState->Common.Value = FALSE;
253 Status = AE_CTRL_FALSE;
257 Cleanup:
259 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
260 WalkState->ControlState->Common.Value, WalkState->Op));
262 /* Break to debugger to display result */
264 ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
267 * Delete the predicate result object (we know that
268 * we don't need it anymore)
270 if (LocalObjDesc != ObjDesc)
272 AcpiUtRemoveReference (LocalObjDesc);
274 AcpiUtRemoveReference (ObjDesc);
276 WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
277 return_ACPI_STATUS (Status);
281 /*****************************************************************************
283 * FUNCTION: AcpiDsExecBeginOp
285 * PARAMETERS: WalkState - Current state of the parse tree walk
286 * OutOp - Return op if a new one is created
288 * RETURN: Status
290 * DESCRIPTION: Descending callback used during the execution of control
291 * methods. This is where most operators and operands are
292 * dispatched to the interpreter.
294 ****************************************************************************/
296 ACPI_STATUS
297 AcpiDsExecBeginOp (
298 ACPI_WALK_STATE *WalkState,
299 ACPI_PARSE_OBJECT **OutOp)
301 ACPI_PARSE_OBJECT *Op;
302 ACPI_STATUS Status = AE_OK;
303 UINT32 OpcodeClass;
306 ACPI_FUNCTION_TRACE_PTR ("DsExecBeginOp", WalkState);
309 Op = WalkState->Op;
310 if (!Op)
312 Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
313 if (ACPI_FAILURE (Status))
315 return_ACPI_STATUS (Status);
318 Op = *OutOp;
319 WalkState->Op = Op;
320 WalkState->Opcode = Op->Common.AmlOpcode;
321 WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
323 if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
325 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
326 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
328 Status = AcpiDsScopeStackPop (WalkState);
329 if (ACPI_FAILURE (Status))
331 return_ACPI_STATUS (Status);
336 if (Op == WalkState->Origin)
338 if (OutOp)
340 *OutOp = Op;
343 return_ACPI_STATUS (AE_OK);
347 * If the previous opcode was a conditional, this opcode
348 * must be the beginning of the associated predicate.
349 * Save this knowledge in the current scope descriptor
351 if ((WalkState->ControlState) &&
352 (WalkState->ControlState->Common.State ==
353 ACPI_CONTROL_CONDITIONAL_EXECUTING))
355 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
356 Op, WalkState));
358 WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
360 /* Save start of predicate */
362 WalkState->ControlState->Control.PredicateOp = Op;
366 OpcodeClass = WalkState->OpInfo->Class;
368 /* We want to send namepaths to the load code */
370 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
372 OpcodeClass = AML_CLASS_NAMED_OBJECT;
376 * Handle the opcode based upon the opcode type
378 switch (OpcodeClass)
380 case AML_CLASS_CONTROL:
382 Status = AcpiDsResultStackPush (WalkState);
383 if (ACPI_FAILURE (Status))
385 return_ACPI_STATUS (Status);
388 Status = AcpiDsExecBeginControlOp (WalkState, Op);
389 break;
392 case AML_CLASS_NAMED_OBJECT:
394 if (WalkState->WalkType == ACPI_WALK_METHOD)
397 * Found a named object declaration during method
398 * execution; we must enter this object into the
399 * namespace. The created object is temporary and
400 * will be deleted upon completion of the execution
401 * of this method.
403 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
406 if (Op->Common.AmlOpcode == AML_REGION_OP)
408 Status = AcpiDsResultStackPush (WalkState);
410 break;
413 case AML_CLASS_EXECUTE:
414 case AML_CLASS_CREATE:
417 * Most operators with arguments.
418 * Start a new result/operand state
420 Status = AcpiDsResultStackPush (WalkState);
421 break;
424 default:
425 break;
428 /* Nothing to do here during method execution */
430 return_ACPI_STATUS (Status);
434 /*****************************************************************************
436 * FUNCTION: AcpiDsExecEndOp
438 * PARAMETERS: WalkState - Current state of the parse tree walk
439 * Op - Op that has been just been completed in the
440 * walk; Arguments have now been evaluated.
442 * RETURN: Status
444 * DESCRIPTION: Ascending callback used during the execution of control
445 * methods. The only thing we really need to do here is to
446 * notice the beginning of IF, ELSE, and WHILE blocks.
448 ****************************************************************************/
450 ACPI_STATUS
451 AcpiDsExecEndOp (
452 ACPI_WALK_STATE *WalkState)
454 ACPI_PARSE_OBJECT *Op;
455 ACPI_STATUS Status = AE_OK;
456 UINT32 OpType;
457 UINT32 OpClass;
458 ACPI_PARSE_OBJECT *NextOp;
459 ACPI_PARSE_OBJECT *FirstArg;
462 ACPI_FUNCTION_TRACE_PTR ("DsExecEndOp", WalkState);
465 Op = WalkState->Op;
466 OpType = WalkState->OpInfo->Type;
467 OpClass = WalkState->OpInfo->Class;
469 if (OpClass == AML_CLASS_UNKNOWN)
471 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", Op->Common.AmlOpcode));
472 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
475 FirstArg = Op->Common.Value.Arg;
477 /* Init the walk state */
479 WalkState->NumOperands = 0;
480 WalkState->ReturnDesc = NULL;
481 WalkState->ResultObj = NULL;
483 /* Call debugger for single step support (DEBUG build only) */
485 ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
486 ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
488 /* Decode the Opcode Class */
490 switch (OpClass)
492 case AML_CLASS_ARGUMENT: /* constants, literals, etc. -- do nothing */
493 break;
496 case AML_CLASS_EXECUTE: /* most operators with arguments */
498 /* Build resolved operand stack */
500 Status = AcpiDsCreateOperands (WalkState, FirstArg);
501 if (ACPI_FAILURE (Status))
503 goto Cleanup;
506 /* Done with this result state (Now that operand stack is built) */
508 Status = AcpiDsResultStackPop (WalkState);
509 if (ACPI_FAILURE (Status))
511 goto Cleanup;
515 * All opcodes require operand resolution, with the only exceptions
516 * being the ObjectType and SizeOf operators.
518 if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
520 /* Resolve all operands */
522 Status = AcpiExResolveOperands (WalkState->Opcode,
523 &(WalkState->Operands [WalkState->NumOperands -1]),
524 WalkState);
525 if (ACPI_SUCCESS (Status))
527 ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
528 AcpiPsGetOpcodeName (WalkState->Opcode),
529 WalkState->NumOperands, "after ExResolveOperands");
533 if (ACPI_SUCCESS (Status))
536 * Dispatch the request to the appropriate interpreter handler
537 * routine. There is one routine per opcode "type" based upon the
538 * number of opcode arguments and return type.
540 Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
542 else
545 * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
546 * Local is uninitialized.
548 if ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
549 (WalkState->Opcode == AML_STORE_OP) &&
550 (WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
551 (WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
552 (WalkState->Operands[0]->Reference.Opcode ==
553 WalkState->Operands[1]->Reference.Opcode) &&
554 (WalkState->Operands[0]->Reference.Offset ==
555 WalkState->Operands[1]->Reference.Offset))
557 Status = AE_OK;
559 else
561 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
562 "[%s]: Could not resolve operands, %s\n",
563 AcpiPsGetOpcodeName (WalkState->Opcode),
564 AcpiFormatException (Status)));
568 /* Always delete the argument objects and clear the operand stack */
570 AcpiDsClearOperands (WalkState);
573 * If a result object was returned from above, push it on the
574 * current result stack
576 if (ACPI_SUCCESS (Status) &&
577 WalkState->ResultObj)
579 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
582 break;
585 default:
587 switch (OpType)
589 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
591 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
593 Status = AcpiDsExecEndControlOp (WalkState, Op);
595 /* Make sure to properly pop the result stack */
597 if (ACPI_SUCCESS (Status))
599 Status = AcpiDsResultStackPop (WalkState);
601 else if (Status == AE_CTRL_PENDING)
603 Status = AcpiDsResultStackPop (WalkState);
604 if (ACPI_SUCCESS (Status))
606 Status = AE_CTRL_PENDING;
609 break;
612 case AML_TYPE_METHOD_CALL:
615 * If the method is referenced from within a package
616 * declaration, it is not a invocation of the method, just
617 * a reference to it.
619 if ((Op->Asl.Parent) &&
620 ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
621 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
623 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method Reference in a Package, Op=%p\n", Op));
624 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node->Object;
625 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
626 return_ACPI_STATUS (AE_OK);
629 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
632 * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
633 * the method Node pointer
635 /* NextOp points to the op that holds the method name */
637 NextOp = FirstArg;
639 /* NextOp points to first argument op */
641 NextOp = NextOp->Common.Next;
644 * Get the method's arguments and put them on the operand stack
646 Status = AcpiDsCreateOperands (WalkState, NextOp);
647 if (ACPI_FAILURE (Status))
649 break;
653 * Since the operands will be passed to another control method,
654 * we must resolve all local references here (Local variables,
655 * arguments to *this* method, etc.)
657 Status = AcpiDsResolveOperands (WalkState);
658 if (ACPI_FAILURE (Status))
660 /* On error, clear all resolved operands */
662 AcpiDsClearOperands (WalkState);
663 break;
667 * Tell the walk loop to preempt this running method and
668 * execute the new method
670 Status = AE_CTRL_TRANSFER;
673 * Return now; we don't want to disturb anything,
674 * especially the operand count!
676 return_ACPI_STATUS (Status);
679 case AML_TYPE_CREATE_FIELD:
681 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
682 "Executing CreateField Buffer/Index Op=%p\n", Op));
684 Status = AcpiDsLoad2EndOp (WalkState);
685 if (ACPI_FAILURE (Status))
687 break;
690 Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
691 break;
694 case AML_TYPE_CREATE_OBJECT:
696 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
697 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
699 switch (Op->Common.Parent->Common.AmlOpcode)
701 case AML_NAME_OP:
704 * Put the Node on the object stack (Contains the ACPI Name of
705 * this object)
707 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
708 WalkState->NumOperands = 1;
710 Status = AcpiDsCreateNode (WalkState, Op->Common.Parent->Common.Node, Op->Common.Parent);
711 if (ACPI_FAILURE (Status))
713 break;
716 /* Fall through */
717 /*lint -fallthrough */
719 case AML_INT_EVAL_SUBTREE_OP:
721 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
722 AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
723 break;
725 default:
727 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
728 break;
731 /* Done with this result state (Now that operand stack is built) */
733 Status = AcpiDsResultStackPop (WalkState);
734 if (ACPI_FAILURE (Status))
736 goto Cleanup;
740 * If a result object was returned from above, push it on the
741 * current result stack
743 if (ACPI_SUCCESS (Status) &&
744 WalkState->ResultObj)
746 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
748 break;
751 case AML_TYPE_NAMED_FIELD:
752 case AML_TYPE_NAMED_COMPLEX:
753 case AML_TYPE_NAMED_SIMPLE:
754 case AML_TYPE_NAMED_NO_OBJ:
756 Status = AcpiDsLoad2EndOp (WalkState);
757 if (ACPI_FAILURE (Status))
759 break;
762 if (Op->Common.AmlOpcode == AML_REGION_OP)
764 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
765 "Executing OpRegion Address/Length Op=%p\n", Op));
767 Status = AcpiDsEvalRegionOperands (WalkState, Op);
768 if (ACPI_FAILURE (Status))
770 break;
773 Status = AcpiDsResultStackPop (WalkState);
776 break;
779 case AML_TYPE_UNDEFINED:
781 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", Op));
782 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
785 case AML_TYPE_BOGUS:
787 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
788 "Internal opcode=%X type Op=%p\n",
789 WalkState->Opcode, Op));
790 break;
793 default:
795 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
796 "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
797 OpClass, OpType, Op->Common.AmlOpcode, Op));
799 Status = AE_NOT_IMPLEMENTED;
800 break;
805 * ACPI 2.0 support for 64-bit integers: Truncate numeric
806 * result value if we are executing from a 32-bit ACPI table
808 AcpiExTruncateFor32bitTable (WalkState->ResultObj);
811 * Check if we just completed the evaluation of a
812 * conditional predicate
815 if ((ACPI_SUCCESS (Status)) &&
816 (WalkState->ControlState) &&
817 (WalkState->ControlState->Common.State ==
818 ACPI_CONTROL_PREDICATE_EXECUTING) &&
819 (WalkState->ControlState->Control.PredicateOp == Op))
821 Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
822 WalkState->ResultObj = NULL;
826 Cleanup:
828 /* Invoke exception handler on error */
830 if (ACPI_FAILURE (Status) &&
831 AcpiGbl_ExceptionHandler &&
832 !(Status & AE_CODE_CONTROL))
834 AcpiExExitInterpreter ();
835 Status = AcpiGbl_ExceptionHandler (Status,
836 WalkState->MethodNode->Name.Integer, WalkState->Opcode,
837 WalkState->AmlOffset, NULL);
838 AcpiExEnterInterpreter ();
841 if (WalkState->ResultObj)
843 /* Break to debugger to display result */
845 ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj, WalkState));
848 * Delete the result op if and only if:
849 * Parent will not use the result -- such as any
850 * non-nested type2 op in a method (parent will be method)
852 AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
855 #ifdef _UNDER_DEVELOPMENT
857 if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
859 AcpiDbMethodEnd (WalkState);
861 #endif
863 /* Always clear the object stack */
865 WalkState->NumOperands = 0;
867 #ifdef ACPI_DISASSEMBLER
869 /* On error, display method locals/args */
871 if (ACPI_FAILURE (Status))
873 AcpiDmDumpMethodInfo (Status, WalkState, Op);
875 #endif
877 return_ACPI_STATUS (Status);