1 /******************************************************************************
3 * Module Name: adwalk - Application-level disassembler parse tree walk routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2014, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
54 #define _COMPONENT ACPI_TOOLS
55 ACPI_MODULE_NAME ("adwalk")
58 * aslmap - opcode mappings and reserved method names
61 AslMapNamedOpcodeToDataType (
64 /* Local prototypes */
67 AcpiDmFindOrphanDescending (
68 ACPI_PARSE_OBJECT *Op,
73 AcpiDmDumpDescending (
74 ACPI_PARSE_OBJECT *Op,
79 AcpiDmXrefDescendingOp (
80 ACPI_PARSE_OBJECT *Op,
85 AcpiDmCommonAscendingOp (
86 ACPI_PARSE_OBJECT *Op,
91 AcpiDmLoadDescendingOp (
92 ACPI_PARSE_OBJECT *Op,
97 AcpiDmInspectPossibleArgs (
98 UINT32 CurrentOpArgCount,
100 ACPI_PARSE_OBJECT *Op);
103 AcpiDmResourceDescendingOp (
104 ACPI_PARSE_OBJECT *Op,
109 /*******************************************************************************
111 * FUNCTION: AcpiDmDumpTree
113 * PARAMETERS: Origin - Starting object
117 * DESCRIPTION: Parse tree walk to format and output the nodes
119 ******************************************************************************/
123 ACPI_PARSE_OBJECT *Origin)
125 ACPI_OP_WALK_INFO Info;
133 AcpiOsPrintf ("/*\nAML Parse Tree\n\n");
137 Info.WalkState = NULL;
138 AcpiDmWalkParseTree (Origin, AcpiDmDumpDescending, NULL, &Info);
139 AcpiOsPrintf ("*/\n\n");
143 /*******************************************************************************
145 * FUNCTION: AcpiDmFindOrphanMethods
147 * PARAMETERS: Origin - Starting object
151 * DESCRIPTION: Parse tree walk to find "orphaned" method invocations -- methods
152 * that are not resolved in the namespace
154 ******************************************************************************/
157 AcpiDmFindOrphanMethods (
158 ACPI_PARSE_OBJECT *Origin)
160 ACPI_OP_WALK_INFO Info;
170 Info.WalkState = NULL;
171 AcpiDmWalkParseTree (Origin, AcpiDmFindOrphanDescending, NULL, &Info);
175 /*******************************************************************************
177 * FUNCTION: AcpiDmFinishNamespaceLoad
179 * PARAMETERS: ParseTreeRoot - Root of the parse tree
180 * NamespaceRoot - Root of the internal namespace
181 * OwnerId - OwnerId of the table to be disassembled
185 * DESCRIPTION: Load all namespace items that are created within control
186 * methods. Used before namespace cross reference
188 ******************************************************************************/
191 AcpiDmFinishNamespaceLoad (
192 ACPI_PARSE_OBJECT *ParseTreeRoot,
193 ACPI_NAMESPACE_NODE *NamespaceRoot,
194 ACPI_OWNER_ID OwnerId)
197 ACPI_OP_WALK_INFO Info;
198 ACPI_WALK_STATE *WalkState;
206 /* Create and initialize a new walk state */
208 WalkState = AcpiDsCreateWalkState (OwnerId, ParseTreeRoot, NULL, NULL);
214 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
215 if (ACPI_FAILURE (Status))
222 Info.WalkState = WalkState;
223 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmLoadDescendingOp,
224 AcpiDmCommonAscendingOp, &Info);
225 ACPI_FREE (WalkState);
229 /*******************************************************************************
231 * FUNCTION: AcpiDmCrossReferenceNamespace
233 * PARAMETERS: ParseTreeRoot - Root of the parse tree
234 * NamespaceRoot - Root of the internal namespace
235 * OwnerId - OwnerId of the table to be disassembled
239 * DESCRIPTION: Cross reference the namespace to create externals
241 ******************************************************************************/
244 AcpiDmCrossReferenceNamespace (
245 ACPI_PARSE_OBJECT *ParseTreeRoot,
246 ACPI_NAMESPACE_NODE *NamespaceRoot,
247 ACPI_OWNER_ID OwnerId)
250 ACPI_OP_WALK_INFO Info;
251 ACPI_WALK_STATE *WalkState;
259 /* Create and initialize a new walk state */
261 WalkState = AcpiDsCreateWalkState (OwnerId, ParseTreeRoot, NULL, NULL);
267 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
268 if (ACPI_FAILURE (Status))
275 Info.WalkState = WalkState;
276 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmXrefDescendingOp,
277 AcpiDmCommonAscendingOp, &Info);
278 ACPI_FREE (WalkState);
282 /*******************************************************************************
284 * FUNCTION: AcpiDmConvertResourceIndexes
286 * PARAMETERS: ParseTreeRoot - Root of the parse tree
287 * NamespaceRoot - Root of the internal namespace
291 * DESCRIPTION: Convert fixed-offset references to resource descriptors to
292 * symbolic references. Should only be called after namespace has
293 * been cross referenced.
295 ******************************************************************************/
298 AcpiDmConvertResourceIndexes (
299 ACPI_PARSE_OBJECT *ParseTreeRoot,
300 ACPI_NAMESPACE_NODE *NamespaceRoot)
303 ACPI_OP_WALK_INFO Info;
304 ACPI_WALK_STATE *WalkState;
312 /* Create and initialize a new walk state */
314 WalkState = AcpiDsCreateWalkState (0, ParseTreeRoot, NULL, NULL);
320 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
321 if (ACPI_FAILURE (Status))
328 Info.WalkState = WalkState;
329 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp,
330 AcpiDmCommonAscendingOp, &Info);
331 ACPI_FREE (WalkState);
336 /*******************************************************************************
338 * FUNCTION: AcpiDmDumpDescending
340 * PARAMETERS: ASL_WALK_CALLBACK
344 * DESCRIPTION: Format and print contents of one parse Op.
346 ******************************************************************************/
349 AcpiDmDumpDescending (
350 ACPI_PARSE_OBJECT *Op,
354 ACPI_OP_WALK_INFO *Info = Context;
363 /* Most of the information (count, level, name) here */
366 AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level);
367 AcpiDmIndent (Level);
368 AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode));
370 /* Extra info is helpful */
372 switch (Op->Common.AmlOpcode)
376 AcpiOsPrintf ("%2.2X", (UINT32) Op->Common.Value.Integer);
381 AcpiOsPrintf ("%4.4X", (UINT32) Op->Common.Value.Integer);
386 AcpiOsPrintf ("%8.8X", (UINT32) Op->Common.Value.Integer);
391 AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
394 case AML_INT_NAMEPATH_OP:
396 if (Op->Common.Value.String)
398 AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
400 AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
405 AcpiOsPrintf ("[NULL]");
412 case AML_INT_NAMEDFIELD_OP:
414 AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
427 /*******************************************************************************
429 * FUNCTION: AcpiDmFindOrphanDescending
431 * PARAMETERS: ASL_WALK_CALLBACK
435 * DESCRIPTION: Check namepath Ops for orphaned method invocations
437 * Note: Experimental.
439 ******************************************************************************/
442 AcpiDmFindOrphanDescending (
443 ACPI_PARSE_OBJECT *Op,
447 const ACPI_OPCODE_INFO *OpInfo;
448 ACPI_PARSE_OBJECT *ChildOp;
449 ACPI_PARSE_OBJECT *NextOp;
450 ACPI_PARSE_OBJECT *ParentOp;
459 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
461 switch (Op->Common.AmlOpcode)
463 #ifdef ACPI_UNDER_DEVELOPMENT
466 ChildOp = Op->Common.Value.Arg;
467 if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
468 !ChildOp->Common.Node)
470 AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
472 AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n",
473 Op->Common.AmlOpName, Path);
476 NextOp = Op->Common.Next;
479 /* This NamePath has no args, assume it is an integer */
481 AcpiDmAddOpToExternalList (ChildOp,
482 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
486 ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
487 AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
488 ArgCount, AcpiDmCountChildren (Op));
492 /* One Arg means this is just a Store(Name,Target) */
494 AcpiDmAddOpToExternalList (ChildOp,
495 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
499 AcpiDmAddOpToExternalList (ChildOp,
500 ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
507 ChildOp = Op->Common.Value.Arg;
508 if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
509 !ChildOp->Common.Node)
511 NextOp = Op->Common.Next;
514 /* This NamePath has no args, assume it is an integer */
516 AcpiDmAddOpToExternalList (ChildOp,
517 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
521 ArgCount = AcpiDmInspectPossibleArgs (2, 1, NextOp);
524 /* One Arg means this is just a Store(Name,Target) */
526 AcpiDmAddOpToExternalList (ChildOp,
527 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
531 AcpiDmAddOpToExternalList (ChildOp,
532 ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
536 case AML_INT_NAMEPATH_OP:
538 /* Must examine parent to see if this namepath is an argument */
540 ParentOp = Op->Common.Parent;
541 OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
543 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
544 (OpInfo->Class != AML_CLASS_CREATE) &&
545 (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) &&
546 (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
549 ArgCount = AcpiDmInspectPossibleArgs (0, 0, Op->Common.Next);
552 * Check if namepath is a predicate for if/while or lone parameter to
557 if (((ParentOp->Common.AmlOpcode == AML_IF_OP) ||
558 (ParentOp->Common.AmlOpcode == AML_WHILE_OP) ||
559 (ParentOp->Common.AmlOpcode == AML_RETURN_OP)) &&
561 /* And namepath is the first argument */
562 (ParentOp->Common.Value.Arg == Op))
564 AcpiDmAddOpToExternalList (Op,
565 Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
571 * This is a standalone namestring (not a parameter to another
572 * operator) - it *must* be a method invocation, nothing else is
573 * grammatically possible.
575 AcpiDmAddOpToExternalList (Op,
576 Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
589 /*******************************************************************************
591 * FUNCTION: AcpiDmLoadDescendingOp
593 * PARAMETERS: ASL_WALK_CALLBACK
597 * DESCRIPTION: Descending handler for namespace control method object load
599 ******************************************************************************/
602 AcpiDmLoadDescendingOp (
603 ACPI_PARSE_OBJECT *Op,
607 ACPI_OP_WALK_INFO *Info = Context;
608 const ACPI_OPCODE_INFO *OpInfo;
609 ACPI_WALK_STATE *WalkState;
610 ACPI_OBJECT_TYPE ObjectType;
613 ACPI_PARSE_OBJECT *NextOp;
614 ACPI_NAMESPACE_NODE *Node;
616 BOOLEAN PreDefined = FALSE;
617 UINT8 PreDefineIndex = 0;
620 WalkState = Info->WalkState;
621 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
622 ObjectType = OpInfo->ObjectType;
623 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
625 /* Only interested in operators that create new names */
627 if (!(OpInfo->Flags & AML_NAMED) &&
628 !(OpInfo->Flags & AML_CREATE))
633 /* Get the NamePath from the appropriate place */
635 if (OpInfo->Flags & AML_NAMED)
637 /* For all named operators, get the new name */
639 Path = (char *) Op->Named.Path;
641 if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
643 *ACPI_CAST_PTR (UINT32, &FieldPath[0]) = Op->Named.Name;
648 else if (OpInfo->Flags & AML_CREATE)
650 /* New name is the last child */
652 NextOp = Op->Common.Value.Arg;
654 while (NextOp->Common.Next)
656 NextOp = NextOp->Common.Next;
658 Path = NextOp->Common.Value.String;
666 /* Insert the name into the namespace */
668 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
669 ACPI_IMODE_LOAD_PASS2, ACPI_NS_DONT_OPEN_SCOPE,
672 Op->Common.Node = Node;
674 if (ACPI_SUCCESS (Status))
676 /* Check if it's a predefined node */
678 while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name)
680 if (ACPI_COMPARE_NAME (Node->Name.Ascii,
681 AcpiGbl_PreDefinedNames[PreDefineIndex].Name))
691 * Set node owner id if it satisfies all the following conditions:
692 * 1) Not a predefined node, _SB_ etc
693 * 2) Not the root node
694 * 3) Not a node created by Scope
697 if (!PreDefined && Node != AcpiGbl_RootNode &&
698 Op->Common.AmlOpcode != AML_SCOPE_OP)
700 Node->OwnerId = WalkState->OwnerId;
707 if (AcpiNsOpensScope (ObjectType))
711 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
712 if (ACPI_FAILURE (Status))
723 /*******************************************************************************
725 * FUNCTION: AcpiDmXrefDescendingOp
727 * PARAMETERS: ASL_WALK_CALLBACK
731 * DESCRIPTION: Descending handler for namespace cross reference
733 ******************************************************************************/
736 AcpiDmXrefDescendingOp (
737 ACPI_PARSE_OBJECT *Op,
741 ACPI_OP_WALK_INFO *Info = Context;
742 const ACPI_OPCODE_INFO *OpInfo;
743 ACPI_WALK_STATE *WalkState;
744 ACPI_OBJECT_TYPE ObjectType;
745 ACPI_OBJECT_TYPE ObjectType2;
748 ACPI_PARSE_OBJECT *NextOp;
749 ACPI_NAMESPACE_NODE *Node;
750 ACPI_OPERAND_OBJECT *Object;
751 UINT32 ParamCount = 0;
755 WalkState = Info->WalkState;
756 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
757 ObjectType = OpInfo->ObjectType;
758 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
760 if ((!(OpInfo->Flags & AML_NAMED)) &&
761 (!(OpInfo->Flags & AML_CREATE)) &&
762 (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP) &&
763 (Op->Common.AmlOpcode != AML_NOTIFY_OP))
769 /* Get the NamePath from the appropriate place */
771 if (OpInfo->Flags & AML_NAMED)
774 * Only these two operators (Alias, Scope) refer to an existing
775 * name, it is the first argument
777 if (Op->Common.AmlOpcode == AML_ALIAS_OP)
779 ObjectType = ACPI_TYPE_ANY;
781 NextOp = Op->Common.Value.Arg;
782 NextOp = NextOp->Common.Value.Arg;
783 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
785 Path = NextOp->Common.Value.String;
788 else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
790 Path = (char *) Op->Named.Path;
793 else if (OpInfo->Flags & AML_CREATE)
795 /* Referenced Buffer Name is the first child */
797 ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */
799 NextOp = Op->Common.Value.Arg;
800 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
802 Path = NextOp->Common.Value.String;
805 else if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
807 Path = Op->Common.Value.Arg->Asl.Value.String;
811 Path = Op->Common.Value.String;
820 * Lookup the name in the namespace. Name must exist at this point, or it
821 * is an invalid reference.
823 * The namespace is also used as a lookup table for references to resource
824 * descriptors and the fields within them.
827 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
828 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
830 if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
832 /* Node was created by an External() statement */
834 Status = AE_NOT_FOUND;
837 if (ACPI_FAILURE (Status))
839 if (Status == AE_NOT_FOUND)
842 * Add this symbol as an external declaration, except if the
843 * parent is a CondRefOf operator. For this operator, we do not
844 * need an external, nor do we want one, since this can cause
845 * disassembly problems if the symbol is actually a control
848 if (!(Op->Asl.Parent &&
849 (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
853 AcpiDmAddNodeToExternalList (Node,
854 (UINT8) ObjectType, 0, 0);
858 AcpiDmAddOpToExternalList (Op, Path,
859 (UINT8) ObjectType, 0, 0);
866 * Found the node, but check if it came from an external table.
867 * Add it to external list. Note: Node->OwnerId == 0 indicates
868 * one of the built-in ACPI Names (_OS_ etc.) which can safely
871 else if (Node->OwnerId &&
872 (WalkState->OwnerId != Node->OwnerId))
874 ObjectType2 = ObjectType;
876 Object = AcpiNsGetAttachedObject (Node);
879 ObjectType2 = Object->Common.Type;
880 if (ObjectType2 == ACPI_TYPE_METHOD)
882 ParamCount = Object->Method.ParamCount;
886 Pathname = AcpiNsGetExternalPathname (Node);
889 return (AE_NO_MEMORY);
892 AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
893 ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
895 ACPI_FREE (Pathname);
896 Op->Common.Node = Node;
900 Op->Common.Node = Node;
905 /* Open new scope if necessary */
907 if (AcpiNsOpensScope (ObjectType))
911 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
912 if (ACPI_FAILURE (Status))
923 /*******************************************************************************
925 * FUNCTION: AcpiDmResourceDescendingOp
927 * PARAMETERS: ASL_WALK_CALLBACK
931 * DESCRIPTION: Process one parse op during symbolic resource index conversion.
933 ******************************************************************************/
936 AcpiDmResourceDescendingOp (
937 ACPI_PARSE_OBJECT *Op,
941 ACPI_OP_WALK_INFO *Info = Context;
942 const ACPI_OPCODE_INFO *OpInfo;
943 ACPI_WALK_STATE *WalkState;
944 ACPI_OBJECT_TYPE ObjectType;
948 WalkState = Info->WalkState;
949 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
951 /* Open new scope if necessary */
953 ObjectType = OpInfo->ObjectType;
954 if (AcpiNsOpensScope (ObjectType))
959 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
960 if (ACPI_FAILURE (Status))
968 * Check if this operator contains a reference to a resource descriptor.
969 * If so, convert the reference into a symbolic reference.
971 AcpiDmCheckResourceReference (Op, WalkState);
976 /*******************************************************************************
978 * FUNCTION: AcpiDmCommonAscendingOp
980 * PARAMETERS: ASL_WALK_CALLBACK
984 * DESCRIPTION: Ascending handler for combined parse/namespace walks. Closes
985 * scope if necessary.
987 ******************************************************************************/
990 AcpiDmCommonAscendingOp (
991 ACPI_PARSE_OBJECT *Op,
995 ACPI_OP_WALK_INFO *Info = Context;
996 const ACPI_OPCODE_INFO *OpInfo;
997 ACPI_OBJECT_TYPE ObjectType;
1000 /* Close scope if necessary */
1002 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
1003 ObjectType = OpInfo->ObjectType;
1004 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
1006 if (AcpiNsOpensScope (ObjectType))
1008 (void) AcpiDsScopeStackPop (Info->WalkState);
1015 /*******************************************************************************
1017 * FUNCTION: AcpiDmInspectPossibleArgs
1019 * PARAMETERS: CurrentOpArgCount - Which arg of the current op was the
1020 * possible method invocation found
1021 * TargetCount - Number of targets (0,1,2) for this op
1026 * DESCRIPTION: Examine following args and next ops for possible arguments
1027 * for an unrecognized method invocation.
1029 ******************************************************************************/
1032 AcpiDmInspectPossibleArgs (
1033 UINT32 CurrentOpArgCount,
1035 ACPI_PARSE_OBJECT *Op)
1037 const ACPI_OPCODE_INFO *OpInfo;
1043 Lookahead = (ACPI_METHOD_NUM_ARGS + TargetCount) - CurrentOpArgCount;
1045 /* Lookahead for the maximum number of possible arguments */
1047 for (i = 0; i < Lookahead; i++)
1054 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
1057 * Any one of these operators is "very probably" not a method arg
1059 if ((Op->Common.AmlOpcode == AML_STORE_OP) ||
1060 (Op->Common.AmlOpcode == AML_NOTIFY_OP))
1065 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
1066 (OpInfo->Class != AML_CLASS_CONTROL))
1071 Op = Op->Common.Next;