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.
55 #define _COMPONENT ACPI_TOOLS
56 ACPI_MODULE_NAME ("adwalk")
59 * aslmap - opcode mappings and reserved method names
62 AslMapNamedOpcodeToDataType (
65 /* Local prototypes */
68 AcpiDmFindOrphanDescending (
69 ACPI_PARSE_OBJECT *Op,
74 AcpiDmDumpDescending (
75 ACPI_PARSE_OBJECT *Op,
80 AcpiDmXrefDescendingOp (
81 ACPI_PARSE_OBJECT *Op,
86 AcpiDmCommonAscendingOp (
87 ACPI_PARSE_OBJECT *Op,
92 AcpiDmLoadDescendingOp (
93 ACPI_PARSE_OBJECT *Op,
98 AcpiDmInspectPossibleArgs (
99 UINT32 CurrentOpArgCount,
101 ACPI_PARSE_OBJECT *Op);
104 AcpiDmResourceDescendingOp (
105 ACPI_PARSE_OBJECT *Op,
110 /*******************************************************************************
112 * FUNCTION: AcpiDmDumpTree
114 * PARAMETERS: Origin - Starting object
118 * DESCRIPTION: Parse tree walk to format and output the nodes
120 ******************************************************************************/
124 ACPI_PARSE_OBJECT *Origin)
126 ACPI_OP_WALK_INFO Info;
134 AcpiOsPrintf ("/*\nAML Parse Tree\n\n");
138 Info.WalkState = NULL;
139 AcpiDmWalkParseTree (Origin, AcpiDmDumpDescending, NULL, &Info);
140 AcpiOsPrintf ("*/\n\n");
144 /*******************************************************************************
146 * FUNCTION: AcpiDmFindOrphanMethods
148 * PARAMETERS: Origin - Starting object
152 * DESCRIPTION: Parse tree walk to find "orphaned" method invocations -- methods
153 * that are not resolved in the namespace
155 ******************************************************************************/
158 AcpiDmFindOrphanMethods (
159 ACPI_PARSE_OBJECT *Origin)
161 ACPI_OP_WALK_INFO Info;
171 Info.WalkState = NULL;
172 AcpiDmWalkParseTree (Origin, AcpiDmFindOrphanDescending, NULL, &Info);
176 /*******************************************************************************
178 * FUNCTION: AcpiDmFinishNamespaceLoad
180 * PARAMETERS: ParseTreeRoot - Root of the parse tree
181 * NamespaceRoot - Root of the internal namespace
182 * OwnerId - OwnerId of the table to be disassembled
186 * DESCRIPTION: Load all namespace items that are created within control
187 * methods. Used before namespace cross reference
189 ******************************************************************************/
192 AcpiDmFinishNamespaceLoad (
193 ACPI_PARSE_OBJECT *ParseTreeRoot,
194 ACPI_NAMESPACE_NODE *NamespaceRoot,
195 ACPI_OWNER_ID OwnerId)
198 ACPI_OP_WALK_INFO Info;
199 ACPI_WALK_STATE *WalkState;
207 /* Create and initialize a new walk state */
209 WalkState = AcpiDsCreateWalkState (OwnerId, ParseTreeRoot, NULL, NULL);
215 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
216 if (ACPI_FAILURE (Status))
223 Info.WalkState = WalkState;
224 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmLoadDescendingOp,
225 AcpiDmCommonAscendingOp, &Info);
226 ACPI_FREE (WalkState);
230 /*******************************************************************************
232 * FUNCTION: AcpiDmCrossReferenceNamespace
234 * PARAMETERS: ParseTreeRoot - Root of the parse tree
235 * NamespaceRoot - Root of the internal namespace
236 * OwnerId - OwnerId of the table to be disassembled
240 * DESCRIPTION: Cross reference the namespace to create externals
242 ******************************************************************************/
245 AcpiDmCrossReferenceNamespace (
246 ACPI_PARSE_OBJECT *ParseTreeRoot,
247 ACPI_NAMESPACE_NODE *NamespaceRoot,
248 ACPI_OWNER_ID OwnerId)
251 ACPI_OP_WALK_INFO Info;
252 ACPI_WALK_STATE *WalkState;
260 /* Create and initialize a new walk state */
262 WalkState = AcpiDsCreateWalkState (OwnerId, ParseTreeRoot, NULL, NULL);
268 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
269 if (ACPI_FAILURE (Status))
276 Info.WalkState = WalkState;
277 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmXrefDescendingOp,
278 AcpiDmCommonAscendingOp, &Info);
279 ACPI_FREE (WalkState);
283 /*******************************************************************************
285 * FUNCTION: AcpiDmConvertResourceIndexes
287 * PARAMETERS: ParseTreeRoot - Root of the parse tree
288 * NamespaceRoot - Root of the internal namespace
292 * DESCRIPTION: Convert fixed-offset references to resource descriptors to
293 * symbolic references. Should only be called after namespace has
294 * been cross referenced.
296 ******************************************************************************/
299 AcpiDmConvertResourceIndexes (
300 ACPI_PARSE_OBJECT *ParseTreeRoot,
301 ACPI_NAMESPACE_NODE *NamespaceRoot)
304 ACPI_OP_WALK_INFO Info;
305 ACPI_WALK_STATE *WalkState;
313 /* Create and initialize a new walk state */
315 WalkState = AcpiDsCreateWalkState (0, ParseTreeRoot, NULL, NULL);
321 Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
322 if (ACPI_FAILURE (Status))
329 Info.WalkState = WalkState;
330 AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp,
331 AcpiDmCommonAscendingOp, &Info);
332 ACPI_FREE (WalkState);
337 /*******************************************************************************
339 * FUNCTION: AcpiDmDumpDescending
341 * PARAMETERS: ASL_WALK_CALLBACK
345 * DESCRIPTION: Format and print contents of one parse Op.
347 ******************************************************************************/
350 AcpiDmDumpDescending (
351 ACPI_PARSE_OBJECT *Op,
355 ACPI_OP_WALK_INFO *Info = Context;
364 /* Most of the information (count, level, name) here */
367 AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level);
368 AcpiDmIndent (Level);
369 AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode));
371 /* Extra info is helpful */
373 switch (Op->Common.AmlOpcode)
377 AcpiOsPrintf ("%2.2X", (UINT32) Op->Common.Value.Integer);
382 AcpiOsPrintf ("%4.4X", (UINT32) Op->Common.Value.Integer);
387 AcpiOsPrintf ("%8.8X", (UINT32) Op->Common.Value.Integer);
392 AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
395 case AML_INT_NAMEPATH_OP:
397 if (Op->Common.Value.String)
399 AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
401 AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
406 AcpiOsPrintf ("[NULL]");
413 case AML_INT_NAMEDFIELD_OP:
415 AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
428 /*******************************************************************************
430 * FUNCTION: AcpiDmFindOrphanDescending
432 * PARAMETERS: ASL_WALK_CALLBACK
436 * DESCRIPTION: Check namepath Ops for orphaned method invocations
438 * Note: Experimental.
440 ******************************************************************************/
443 AcpiDmFindOrphanDescending (
444 ACPI_PARSE_OBJECT *Op,
448 const ACPI_OPCODE_INFO *OpInfo;
449 ACPI_PARSE_OBJECT *ChildOp;
450 ACPI_PARSE_OBJECT *NextOp;
451 ACPI_PARSE_OBJECT *ParentOp;
460 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
462 switch (Op->Common.AmlOpcode)
464 #ifdef ACPI_UNDER_DEVELOPMENT
467 ChildOp = Op->Common.Value.Arg;
468 if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
469 !ChildOp->Common.Node)
471 AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
473 AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n",
474 Op->Common.AmlOpName, Path);
477 NextOp = Op->Common.Next;
480 /* This NamePath has no args, assume it is an integer */
482 AcpiDmAddOpToExternalList (ChildOp,
483 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
487 ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
488 AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
489 ArgCount, AcpiDmCountChildren (Op));
493 /* One Arg means this is just a Store(Name,Target) */
495 AcpiDmAddOpToExternalList (ChildOp,
496 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
500 AcpiDmAddOpToExternalList (ChildOp,
501 ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
508 ChildOp = Op->Common.Value.Arg;
509 if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
510 !ChildOp->Common.Node)
512 NextOp = Op->Common.Next;
515 /* This NamePath has no args, assume it is an integer */
517 AcpiDmAddOpToExternalList (ChildOp,
518 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
522 ArgCount = AcpiDmInspectPossibleArgs (2, 1, NextOp);
525 /* One Arg means this is just a Store(Name,Target) */
527 AcpiDmAddOpToExternalList (ChildOp,
528 ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
532 AcpiDmAddOpToExternalList (ChildOp,
533 ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
537 case AML_INT_NAMEPATH_OP:
539 /* Must examine parent to see if this namepath is an argument */
541 ParentOp = Op->Common.Parent;
542 OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
544 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
545 (OpInfo->Class != AML_CLASS_CREATE) &&
546 (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) &&
547 (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
550 ArgCount = AcpiDmInspectPossibleArgs (0, 0, Op->Common.Next);
553 * Check if namepath is a predicate for if/while or lone parameter to
558 if (((ParentOp->Common.AmlOpcode == AML_IF_OP) ||
559 (ParentOp->Common.AmlOpcode == AML_WHILE_OP) ||
560 (ParentOp->Common.AmlOpcode == AML_RETURN_OP)) &&
562 /* And namepath is the first argument */
563 (ParentOp->Common.Value.Arg == Op))
565 AcpiDmAddOpToExternalList (Op,
566 Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
572 * This is a standalone namestring (not a parameter to another
573 * operator) - it *must* be a method invocation, nothing else is
574 * grammatically possible.
576 AcpiDmAddOpToExternalList (Op,
577 Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
590 /*******************************************************************************
592 * FUNCTION: AcpiDmLoadDescendingOp
594 * PARAMETERS: ASL_WALK_CALLBACK
598 * DESCRIPTION: Descending handler for namespace control method object load
600 ******************************************************************************/
603 AcpiDmLoadDescendingOp (
604 ACPI_PARSE_OBJECT *Op,
608 ACPI_OP_WALK_INFO *Info = Context;
609 const ACPI_OPCODE_INFO *OpInfo;
610 ACPI_WALK_STATE *WalkState;
611 ACPI_OBJECT_TYPE ObjectType;
614 ACPI_PARSE_OBJECT *NextOp;
615 ACPI_NAMESPACE_NODE *Node;
617 BOOLEAN PreDefined = FALSE;
618 UINT8 PreDefineIndex = 0;
621 WalkState = Info->WalkState;
622 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
623 ObjectType = OpInfo->ObjectType;
624 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
626 /* Only interested in operators that create new names */
628 if (!(OpInfo->Flags & AML_NAMED) &&
629 !(OpInfo->Flags & AML_CREATE))
634 /* Get the NamePath from the appropriate place */
636 if (OpInfo->Flags & AML_NAMED)
638 /* For all named operators, get the new name */
640 Path = (char *) Op->Named.Path;
642 if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
644 *ACPI_CAST_PTR (UINT32, &FieldPath[0]) = Op->Named.Name;
649 else if (OpInfo->Flags & AML_CREATE)
651 /* New name is the last child */
653 NextOp = Op->Common.Value.Arg;
655 while (NextOp->Common.Next)
657 NextOp = NextOp->Common.Next;
659 Path = NextOp->Common.Value.String;
667 /* Insert the name into the namespace */
669 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
670 ACPI_IMODE_LOAD_PASS2, ACPI_NS_DONT_OPEN_SCOPE,
673 Op->Common.Node = Node;
675 if (ACPI_SUCCESS (Status))
677 /* Check if it's a predefined node */
679 while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name)
681 if (ACPI_COMPARE_NAME (Node->Name.Ascii,
682 AcpiGbl_PreDefinedNames[PreDefineIndex].Name))
692 * Set node owner id if it satisfies all the following conditions:
693 * 1) Not a predefined node, _SB_ etc
694 * 2) Not the root node
695 * 3) Not a node created by Scope
698 if (!PreDefined && Node != AcpiGbl_RootNode &&
699 Op->Common.AmlOpcode != AML_SCOPE_OP)
701 Node->OwnerId = WalkState->OwnerId;
708 if (AcpiNsOpensScope (ObjectType))
712 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
713 if (ACPI_FAILURE (Status))
724 /*******************************************************************************
726 * FUNCTION: AcpiDmXrefDescendingOp
728 * PARAMETERS: ASL_WALK_CALLBACK
732 * DESCRIPTION: Descending handler for namespace cross reference
734 ******************************************************************************/
737 AcpiDmXrefDescendingOp (
738 ACPI_PARSE_OBJECT *Op,
742 ACPI_OP_WALK_INFO *Info = Context;
743 const ACPI_OPCODE_INFO *OpInfo;
744 ACPI_WALK_STATE *WalkState;
745 ACPI_OBJECT_TYPE ObjectType;
746 ACPI_OBJECT_TYPE ObjectType2;
749 ACPI_PARSE_OBJECT *NextOp;
750 ACPI_NAMESPACE_NODE *Node;
751 ACPI_OPERAND_OBJECT *Object;
752 UINT32 ParamCount = 0;
756 WalkState = Info->WalkState;
757 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
758 ObjectType = OpInfo->ObjectType;
759 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
761 if ((!(OpInfo->Flags & AML_NAMED)) &&
762 (!(OpInfo->Flags & AML_CREATE)) &&
763 (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP) &&
764 (Op->Common.AmlOpcode != AML_NOTIFY_OP))
770 /* Get the NamePath from the appropriate place */
772 if (OpInfo->Flags & AML_NAMED)
775 * Only these two operators (Alias, Scope) refer to an existing
776 * name, it is the first argument
778 if (Op->Common.AmlOpcode == AML_ALIAS_OP)
780 ObjectType = ACPI_TYPE_ANY;
782 NextOp = Op->Common.Value.Arg;
783 NextOp = NextOp->Common.Value.Arg;
784 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
786 Path = NextOp->Common.Value.String;
789 else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
791 Path = (char *) Op->Named.Path;
794 else if (OpInfo->Flags & AML_CREATE)
796 /* Referenced Buffer Name is the first child */
798 ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */
800 NextOp = Op->Common.Value.Arg;
801 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
803 Path = NextOp->Common.Value.String;
806 else if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
808 Path = Op->Common.Value.Arg->Asl.Value.String;
812 Path = Op->Common.Value.String;
821 * Lookup the name in the namespace. Name must exist at this point, or it
822 * is an invalid reference.
824 * The namespace is also used as a lookup table for references to resource
825 * descriptors and the fields within them.
828 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
829 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
831 if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
833 /* Node was created by an External() statement */
835 Status = AE_NOT_FOUND;
838 if (ACPI_FAILURE (Status))
840 if (Status == AE_NOT_FOUND)
843 * Add this symbol as an external declaration, except if the
844 * parent is a CondRefOf operator. For this operator, we do not
845 * need an external, nor do we want one, since this can cause
846 * disassembly problems if the symbol is actually a control
849 if (!(Op->Asl.Parent &&
850 (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
854 AcpiDmAddNodeToExternalList (Node,
855 (UINT8) ObjectType, 0, 0);
859 AcpiDmAddOpToExternalList (Op, Path,
860 (UINT8) ObjectType, 0, 0);
867 * Found the node, but check if it came from an external table.
868 * Add it to external list. Note: Node->OwnerId == 0 indicates
869 * one of the built-in ACPI Names (_OS_ etc.) which can safely
872 else if (Node->OwnerId &&
873 (WalkState->OwnerId != Node->OwnerId))
875 ObjectType2 = ObjectType;
877 Object = AcpiNsGetAttachedObject (Node);
880 ObjectType2 = Object->Common.Type;
881 if (ObjectType2 == ACPI_TYPE_METHOD)
883 ParamCount = Object->Method.ParamCount;
887 Pathname = AcpiNsGetExternalPathname (Node);
890 return (AE_NO_MEMORY);
893 AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
894 ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
896 ACPI_FREE (Pathname);
897 Op->Common.Node = Node;
901 Op->Common.Node = Node;
906 /* Open new scope if necessary */
908 if (AcpiNsOpensScope (ObjectType))
912 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
913 if (ACPI_FAILURE (Status))
924 /*******************************************************************************
926 * FUNCTION: AcpiDmResourceDescendingOp
928 * PARAMETERS: ASL_WALK_CALLBACK
932 * DESCRIPTION: Process one parse op during symbolic resource index conversion.
934 ******************************************************************************/
937 AcpiDmResourceDescendingOp (
938 ACPI_PARSE_OBJECT *Op,
942 ACPI_OP_WALK_INFO *Info = Context;
943 const ACPI_OPCODE_INFO *OpInfo;
944 ACPI_WALK_STATE *WalkState;
945 ACPI_OBJECT_TYPE ObjectType;
949 WalkState = Info->WalkState;
950 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
952 /* Open new scope if necessary */
954 ObjectType = OpInfo->ObjectType;
955 if (AcpiNsOpensScope (ObjectType))
960 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
961 if (ACPI_FAILURE (Status))
969 * Check if this operator contains a reference to a resource descriptor.
970 * If so, convert the reference into a symbolic reference.
972 AcpiDmCheckResourceReference (Op, WalkState);
977 /*******************************************************************************
979 * FUNCTION: AcpiDmCommonAscendingOp
981 * PARAMETERS: ASL_WALK_CALLBACK
985 * DESCRIPTION: Ascending handler for combined parse/namespace walks. Closes
986 * scope if necessary.
988 ******************************************************************************/
991 AcpiDmCommonAscendingOp (
992 ACPI_PARSE_OBJECT *Op,
996 ACPI_OP_WALK_INFO *Info = Context;
997 const ACPI_OPCODE_INFO *OpInfo;
998 ACPI_OBJECT_TYPE ObjectType;
1001 /* Close scope if necessary */
1003 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
1004 ObjectType = OpInfo->ObjectType;
1005 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
1007 if (AcpiNsOpensScope (ObjectType))
1009 (void) AcpiDsScopeStackPop (Info->WalkState);
1016 /*******************************************************************************
1018 * FUNCTION: AcpiDmInspectPossibleArgs
1020 * PARAMETERS: CurrentOpArgCount - Which arg of the current op was the
1021 * possible method invocation found
1022 * TargetCount - Number of targets (0,1,2) for this op
1027 * DESCRIPTION: Examine following args and next ops for possible arguments
1028 * for an unrecognized method invocation.
1030 ******************************************************************************/
1033 AcpiDmInspectPossibleArgs (
1034 UINT32 CurrentOpArgCount,
1036 ACPI_PARSE_OBJECT *Op)
1038 const ACPI_OPCODE_INFO *OpInfo;
1044 Lookahead = (ACPI_METHOD_NUM_ARGS + TargetCount) - CurrentOpArgCount;
1046 /* Lookahead for the maximum number of possible arguments */
1048 for (i = 0; i < Lookahead; i++)
1055 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
1058 * Any one of these operators is "very probably" not a method arg
1060 if ((Op->Common.AmlOpcode == AML_STORE_OP) ||
1061 (Op->Common.AmlOpcode == AML_NOTIFY_OP))
1066 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
1067 (OpInfo->Class != AML_CLASS_CONTROL))
1072 Op = Op->Common.Next;