1 /******************************************************************************
3 * Module Name: adwalk - Application-level disassembler parse tree walk routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, 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.
45 #include <contrib/dev/acpica/include/acpi.h>
46 #include <contrib/dev/acpica/include/accommon.h>
47 #include <contrib/dev/acpica/include/acparser.h>
48 #include <contrib/dev/acpica/include/amlcode.h>
49 #include <contrib/dev/acpica/include/acdisasm.h>
50 #include <contrib/dev/acpica/include/acdispat.h>
51 #include <contrib/dev/acpica/include/acnamesp.h>
52 #include <contrib/dev/acpica/include/acapps.h>
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", Op->Common.AmlOpName, Path);
476 NextOp = Op->Common.Next;
479 /* This NamePath has no args, assume it is an integer */
481 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
485 ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
486 AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
490 /* One Arg means this is just a Store(Name,Target) */
492 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
496 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
503 ChildOp = Op->Common.Value.Arg;
504 if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
505 !ChildOp->Common.Node)
507 NextOp = Op->Common.Next;
510 /* This NamePath has no args, assume it is an integer */
512 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
516 ArgCount = AcpiDmInspectPossibleArgs (2, 1, NextOp);
519 /* One Arg means this is just a Store(Name,Target) */
521 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
525 AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
529 case AML_INT_NAMEPATH_OP:
531 /* Must examine parent to see if this namepath is an argument */
533 ParentOp = Op->Common.Parent;
534 OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
536 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
537 (OpInfo->Class != AML_CLASS_CREATE) &&
538 (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) &&
539 (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
542 ArgCount = AcpiDmInspectPossibleArgs (0, 0, Op->Common.Next);
545 * Check if namepath is a predicate for if/while or lone parameter to
550 if (((ParentOp->Common.AmlOpcode == AML_IF_OP) ||
551 (ParentOp->Common.AmlOpcode == AML_WHILE_OP) ||
552 (ParentOp->Common.AmlOpcode == AML_RETURN_OP)) &&
554 /* And namepath is the first argument */
555 (ParentOp->Common.Value.Arg == Op))
557 AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
563 * This is a standalone namestring (not a parameter to another
564 * operator) - it *must* be a method invocation, nothing else is
565 * grammatically possible.
567 AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
581 /*******************************************************************************
583 * FUNCTION: AcpiDmLoadDescendingOp
585 * PARAMETERS: ASL_WALK_CALLBACK
589 * DESCRIPTION: Descending handler for namespace control method object load
591 ******************************************************************************/
594 AcpiDmLoadDescendingOp (
595 ACPI_PARSE_OBJECT *Op,
599 ACPI_OP_WALK_INFO *Info = Context;
600 const ACPI_OPCODE_INFO *OpInfo;
601 ACPI_WALK_STATE *WalkState;
602 ACPI_OBJECT_TYPE ObjectType;
605 ACPI_PARSE_OBJECT *NextOp;
606 ACPI_NAMESPACE_NODE *Node;
608 BOOLEAN PreDefined = FALSE;
609 UINT8 PreDefineIndex = 0;
612 WalkState = Info->WalkState;
613 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
614 ObjectType = OpInfo->ObjectType;
615 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
617 /* Only interested in operators that create new names */
619 if (!(OpInfo->Flags & AML_NAMED) &&
620 !(OpInfo->Flags & AML_CREATE))
625 /* Get the NamePath from the appropriate place */
627 if (OpInfo->Flags & AML_NAMED)
629 /* For all named operators, get the new name */
631 Path = (char *) Op->Named.Path;
633 if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
635 *ACPI_CAST_PTR (UINT32, &FieldPath[0]) = Op->Named.Name;
640 else if (OpInfo->Flags & AML_CREATE)
642 /* New name is the last child */
644 NextOp = Op->Common.Value.Arg;
646 while (NextOp->Common.Next)
648 NextOp = NextOp->Common.Next;
650 Path = NextOp->Common.Value.String;
658 /* Insert the name into the namespace */
660 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
661 ACPI_IMODE_LOAD_PASS2, ACPI_NS_DONT_OPEN_SCOPE,
664 Op->Common.Node = Node;
666 if (ACPI_SUCCESS (Status))
668 /* Check if it's a predefined node */
670 while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name)
672 if (ACPI_COMPARE_NAME (Node->Name.Ascii,
673 AcpiGbl_PreDefinedNames[PreDefineIndex].Name))
683 * Set node owner id if it satisfies all the following conditions:
684 * 1) Not a predefined node, _SB_ etc
685 * 2) Not the root node
686 * 3) Not a node created by Scope
689 if (!PreDefined && Node != AcpiGbl_RootNode &&
690 Op->Common.AmlOpcode != AML_SCOPE_OP)
692 Node->OwnerId = WalkState->OwnerId;
699 if (AcpiNsOpensScope (ObjectType))
703 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
704 if (ACPI_FAILURE (Status))
715 /*******************************************************************************
717 * FUNCTION: AcpiDmXrefDescendingOp
719 * PARAMETERS: ASL_WALK_CALLBACK
723 * DESCRIPTION: Descending handler for namespace cross reference
725 ******************************************************************************/
728 AcpiDmXrefDescendingOp (
729 ACPI_PARSE_OBJECT *Op,
733 ACPI_OP_WALK_INFO *Info = Context;
734 const ACPI_OPCODE_INFO *OpInfo;
735 ACPI_WALK_STATE *WalkState;
736 ACPI_OBJECT_TYPE ObjectType;
737 ACPI_OBJECT_TYPE ObjectType2;
740 ACPI_PARSE_OBJECT *NextOp;
741 ACPI_NAMESPACE_NODE *Node;
742 ACPI_OPERAND_OBJECT *Object;
743 UINT32 ParamCount = 0;
746 WalkState = Info->WalkState;
747 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
748 ObjectType = OpInfo->ObjectType;
749 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
751 if ((!(OpInfo->Flags & AML_NAMED)) &&
752 (!(OpInfo->Flags & AML_CREATE)) &&
753 (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
758 /* Get the NamePath from the appropriate place */
760 if (OpInfo->Flags & AML_NAMED)
763 * Only these two operators (Alias, Scope) refer to an existing
764 * name, it is the first argument
766 if (Op->Common.AmlOpcode == AML_ALIAS_OP)
768 ObjectType = ACPI_TYPE_ANY;
770 NextOp = Op->Common.Value.Arg;
771 NextOp = NextOp->Common.Value.Arg;
772 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
774 Path = NextOp->Common.Value.String;
777 else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
779 Path = (char *) Op->Named.Path;
782 else if (OpInfo->Flags & AML_CREATE)
784 /* Referenced Buffer Name is the first child */
786 ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */
788 NextOp = Op->Common.Value.Arg;
789 if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
791 Path = NextOp->Common.Value.String;
796 Path = Op->Common.Value.String;
805 * Lookup the name in the namespace. Name must exist at this point, or it
806 * is an invalid reference.
808 * The namespace is also used as a lookup table for references to resource
809 * descriptors and the fields within them.
811 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
812 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
814 if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
816 Status = AE_NOT_FOUND;
819 if (ACPI_FAILURE (Status))
821 if (Status == AE_NOT_FOUND)
823 AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
826 * We could install this into the namespace, but we catch duplicate
827 * externals when they are added to the list.
830 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
831 ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE,
838 * Found the node in external table, add it to external list
839 * Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc
841 else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId)
843 ObjectType2 = ObjectType;
845 Object = AcpiNsGetAttachedObject (Node);
848 ObjectType2 = Object->Common.Type;
849 if (ObjectType2 == ACPI_TYPE_METHOD)
851 ParamCount = Object->Method.ParamCount;
855 AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
856 Op->Common.Node = Node;
860 Op->Common.Node = Node;
865 /* Open new scope if necessary */
867 if (AcpiNsOpensScope (ObjectType))
871 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
872 if (ACPI_FAILURE (Status))
883 /*******************************************************************************
885 * FUNCTION: AcpiDmResourceDescendingOp
887 * PARAMETERS: ASL_WALK_CALLBACK
891 * DESCRIPTION: Process one parse op during symbolic resource index conversion.
893 ******************************************************************************/
896 AcpiDmResourceDescendingOp (
897 ACPI_PARSE_OBJECT *Op,
901 ACPI_OP_WALK_INFO *Info = Context;
902 const ACPI_OPCODE_INFO *OpInfo;
903 ACPI_WALK_STATE *WalkState;
904 ACPI_OBJECT_TYPE ObjectType;
908 WalkState = Info->WalkState;
909 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
911 /* Open new scope if necessary */
913 ObjectType = OpInfo->ObjectType;
914 if (AcpiNsOpensScope (ObjectType))
919 Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
920 if (ACPI_FAILURE (Status))
928 * Check if this operator contains a reference to a resource descriptor.
929 * If so, convert the reference into a symbolic reference.
931 AcpiDmCheckResourceReference (Op, WalkState);
936 /*******************************************************************************
938 * FUNCTION: AcpiDmCommonAscendingOp
940 * PARAMETERS: ASL_WALK_CALLBACK
944 * DESCRIPTION: Ascending handler for combined parse/namespace walks. Closes
945 * scope if necessary.
947 ******************************************************************************/
950 AcpiDmCommonAscendingOp (
951 ACPI_PARSE_OBJECT *Op,
955 ACPI_OP_WALK_INFO *Info = Context;
956 const ACPI_OPCODE_INFO *OpInfo;
957 ACPI_OBJECT_TYPE ObjectType;
960 /* Close scope if necessary */
962 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
963 ObjectType = OpInfo->ObjectType;
964 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
966 if (AcpiNsOpensScope (ObjectType))
968 (void) AcpiDsScopeStackPop (Info->WalkState);
975 /*******************************************************************************
977 * FUNCTION: AcpiDmInspectPossibleArgs
979 * PARAMETERS: CurrentOpArgCount - Which arg of the current op was the
980 * possible method invocation found
981 * TargetCount - Number of targets (0,1,2) for this op
986 * DESCRIPTION: Examine following args and next ops for possible arguments
987 * for an unrecognized method invocation.
989 ******************************************************************************/
992 AcpiDmInspectPossibleArgs (
993 UINT32 CurrentOpArgCount,
995 ACPI_PARSE_OBJECT *Op)
997 const ACPI_OPCODE_INFO *OpInfo;
1003 Lookahead = (ACPI_METHOD_NUM_ARGS + TargetCount) - CurrentOpArgCount;
1005 /* Lookahead for the maximum number of possible arguments */
1007 for (i = 0; i < Lookahead; i++)
1014 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
1017 * Any one of these operators is "very probably" not a method arg
1019 if ((Op->Common.AmlOpcode == AML_STORE_OP) ||
1020 (Op->Common.AmlOpcode == AML_NOTIFY_OP))
1025 if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
1026 (OpInfo->Class != AML_CLASS_CONTROL))
1031 Op = Op->Common.Next;