1 /*******************************************************************************
3 * Module Name: dmwalk - AML disassembly tree walk
5 ******************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
118 #include "accommon.h"
119 #include "acparser.h"
121 #include "acdisasm.h"
125 #ifdef ACPI_DISASSEMBLER
127 #define _COMPONENT ACPI_CA_DEBUGGER
128 ACPI_MODULE_NAME ("dmwalk")
131 #define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: "
133 /* Local prototypes */
137 ACPI_PARSE_OBJECT
*Op
,
143 ACPI_PARSE_OBJECT
*Op
,
149 ACPI_PARSE_OBJECT
*Op
);
152 AcpiDmGetObjectTypeName (
153 ACPI_OBJECT_TYPE Type
);
156 * This table maps ACPI_OBJECT_TYPEs to the corresponding ASL
157 * ObjectTypeKeyword. Used to generate typed external declarations
159 static const char *AcpiGbl_DmTypeNames
[] =
161 /* 00 */ "", /* Type ANY */
164 /* 03 */ ", BuffObj",
166 /* 05 */ ", FieldUnitObj",
167 /* 06 */ ", DeviceObj",
168 /* 07 */ ", EventObj",
169 /* 08 */ ", MethodObj",
170 /* 09 */ ", MutexObj",
171 /* 10 */ ", OpRegionObj",
172 /* 11 */ ", PowerResObj",
173 /* 12 */ ", ProcessorObj",
174 /* 13 */ ", ThermalZoneObj",
175 /* 14 */ ", BuffFieldObj",
176 /* 15 */ ", DDBHandleObj",
177 /* 16 */ "", /* Debug object */
178 /* 17 */ ", FieldUnitObj",
179 /* 18 */ ", FieldUnitObj",
180 /* 19 */ ", FieldUnitObj"
184 /*******************************************************************************
186 * FUNCTION: AcpiDmGetObjectTypeName
188 * PARAMETERS: Type - An ACPI_OBJECT_TYPE
190 * RETURN: Pointer to a string
192 * DESCRIPTION: Map an object type to the ASL object type string.
194 ******************************************************************************/
197 AcpiDmGetObjectTypeName (
198 ACPI_OBJECT_TYPE Type
)
201 if (Type
== ACPI_TYPE_LOCAL_SCOPE
)
203 Type
= ACPI_TYPE_DEVICE
;
206 else if (Type
> ACPI_TYPE_LOCAL_INDEX_FIELD
)
211 return (AcpiGbl_DmTypeNames
[Type
]);
215 /*******************************************************************************
217 * FUNCTION: AcpiDmDisassemble
219 * PARAMETERS: WalkState - Current state
220 * Origin - Starting object
221 * NumOpcodes - Max number of opcodes to be displayed
225 * DESCRIPTION: Disassemble parser object and its children. This is the
226 * main entry point of the disassembler.
228 ******************************************************************************/
232 ACPI_WALK_STATE
*WalkState
,
233 ACPI_PARSE_OBJECT
*Origin
,
236 ACPI_PARSE_OBJECT
*Op
= Origin
;
237 ACPI_OP_WALK_INFO Info
;
248 Info
.WalkState
= WalkState
;
249 AcpiDmWalkParseTree (Op
, AcpiDmDescendingOp
, AcpiDmAscendingOp
, &Info
);
254 /*******************************************************************************
256 * FUNCTION: AcpiDmWalkParseTree
258 * PARAMETERS: Op - Root Op object
259 * DescendingCallback - Called during tree descent
260 * AscendingCallback - Called during tree ascent
261 * Context - To be passed to the callbacks
263 * RETURN: Status from callback(s)
265 * DESCRIPTION: Walk the entire parse tree.
267 ******************************************************************************/
270 AcpiDmWalkParseTree (
271 ACPI_PARSE_OBJECT
*Op
,
272 ASL_WALK_CALLBACK DescendingCallback
,
273 ASL_WALK_CALLBACK AscendingCallback
,
276 BOOLEAN NodePreviouslyVisited
;
277 ACPI_PARSE_OBJECT
*StartOp
= Op
;
279 ACPI_PARSE_OBJECT
*Next
;
280 ACPI_OP_WALK_INFO
*Info
= Context
;
284 NodePreviouslyVisited
= FALSE
;
288 if (NodePreviouslyVisited
)
290 if (AscendingCallback
)
292 Status
= AscendingCallback (Op
, Info
->Level
, Context
);
293 if (ACPI_FAILURE (Status
))
301 /* Let the callback process the node */
303 Status
= DescendingCallback (Op
, Info
->Level
, Context
);
304 if (ACPI_SUCCESS (Status
))
306 /* Visit children first, once */
308 Next
= AcpiPsGetArg (Op
, 0);
316 else if (Status
!= AE_CTRL_DEPTH
)
318 /* Exit immediately on any error */
324 /* Terminate walk at start op */
331 /* No more children, re-visit this node */
333 if (!NodePreviouslyVisited
)
335 NodePreviouslyVisited
= TRUE
;
339 /* No more children, visit peers */
343 Op
= Op
->Common
.Next
;
344 NodePreviouslyVisited
= FALSE
;
348 /* No peers, re-visit parent */
350 if (Info
->Level
!= 0 )
355 Op
= Op
->Common
.Parent
;
356 NodePreviouslyVisited
= TRUE
;
360 /* If we get here, the walk completed with no errors */
366 /*******************************************************************************
368 * FUNCTION: AcpiDmBlockType
370 * PARAMETERS: Op - Object to be examined
372 * RETURN: BlockType - not a block, parens, braces, or even both.
374 * DESCRIPTION: Type of block for this op (parens or braces)
376 ******************************************************************************/
380 ACPI_PARSE_OBJECT
*Op
)
382 const ACPI_OPCODE_INFO
*OpInfo
;
390 switch (Op
->Common
.AmlOpcode
)
394 return (BLOCK_BRACE
);
399 case AML_PROCESSOR_OP
:
400 case AML_POWER_RES_OP
:
401 case AML_THERMAL_ZONE_OP
:
405 case AML_INDEX_FIELD_OP
:
406 case AML_BANK_FIELD_OP
:
408 return (BLOCK_PAREN
| BLOCK_BRACE
);
412 if (Op
->Common
.DisasmOpcode
== ACPI_DASM_UNICODE
)
417 /*lint -fallthrough */
420 case AML_VAR_PACKAGE_OP
:
422 return (BLOCK_PAREN
| BLOCK_BRACE
);
426 return (BLOCK_PAREN
);
430 OpInfo
= AcpiPsGetOpcodeInfo (Op
->Common
.AmlOpcode
);
431 if (OpInfo
->Flags
& AML_HAS_ARGS
)
433 return (BLOCK_PAREN
);
441 /*******************************************************************************
443 * FUNCTION: AcpiDmListType
445 * PARAMETERS: Op - Object to be examined
447 * RETURN: ListType - has commas or not.
449 * DESCRIPTION: Type of block for this op (parens or braces)
451 ******************************************************************************/
455 ACPI_PARSE_OBJECT
*Op
)
457 const ACPI_OPCODE_INFO
*OpInfo
;
465 switch (Op
->Common
.AmlOpcode
)
472 case AML_POWER_RES_OP
:
473 case AML_PROCESSOR_OP
:
474 case AML_THERMAL_ZONE_OP
:
478 case AML_INDEX_FIELD_OP
:
479 case AML_BANK_FIELD_OP
:
485 case AML_VAR_PACKAGE_OP
:
487 return (BLOCK_COMMA_LIST
);
491 OpInfo
= AcpiPsGetOpcodeInfo (Op
->Common
.AmlOpcode
);
492 if (OpInfo
->Flags
& AML_HAS_ARGS
)
494 return (BLOCK_COMMA_LIST
);
502 /*******************************************************************************
504 * FUNCTION: AcpiDmDescendingOp
506 * PARAMETERS: ASL_WALK_CALLBACK
510 * DESCRIPTION: First visitation of a parse object during tree descent.
511 * Decode opcode name and begin parameter list(s), if any.
513 ******************************************************************************/
517 ACPI_PARSE_OBJECT
*Op
,
521 ACPI_OP_WALK_INFO
*Info
= Context
;
522 const ACPI_OPCODE_INFO
*OpInfo
;
524 ACPI_PARSE_OBJECT
*NextOp
;
525 ACPI_EXTERNAL_LIST
*NextExternal
;
528 if (Op
->Common
.DisasmFlags
& ACPI_PARSEOP_IGNORE
)
530 /* Ignore this op -- it was handled elsewhere */
532 return (AE_CTRL_DEPTH
);
535 /* Level 0 is at the Definition Block level */
539 /* In verbose mode, print the AML offset, opcode and depth count */
543 VERBOSE_PRINT ((DB_FULL_OP_INFO
,
544 (Info
->WalkState
->MethodNode
?
545 Info
->WalkState
->MethodNode
->Name
.Ascii
: " "),
546 Op
->Common
.AmlOffset
, (UINT32
) Op
->Common
.AmlOpcode
));
549 if (Op
->Common
.AmlOpcode
== AML_SCOPE_OP
)
551 /* This is the beginning of the Definition Block */
553 AcpiOsPrintf ("{\n");
555 /* Emit all External() declarations here */
557 if (AcpiGbl_ExternalList
)
560 * Walk the list of externals (unresolved references)
561 * found during parsing
563 while (AcpiGbl_ExternalList
)
565 AcpiOsPrintf (" External (%s%s",
566 AcpiGbl_ExternalList
->Path
,
567 AcpiDmGetObjectTypeName (AcpiGbl_ExternalList
->Type
));
569 if (AcpiGbl_ExternalList
->Type
== ACPI_TYPE_METHOD
)
571 AcpiOsPrintf (") // %d Arguments\n", AcpiGbl_ExternalList
->Value
);
575 AcpiOsPrintf (")\n");
578 NextExternal
= AcpiGbl_ExternalList
->Next
;
579 ACPI_FREE (AcpiGbl_ExternalList
->Path
);
580 ACPI_FREE (AcpiGbl_ExternalList
);
581 AcpiGbl_ExternalList
= NextExternal
;
589 else if ((AcpiDmBlockType (Op
->Common
.Parent
) & BLOCK_BRACE
) &&
590 (!(Op
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
)) &&
591 (Op
->Common
.AmlOpcode
!= AML_INT_BYTELIST_OP
))
594 * This is a first-level element of a term list,
597 AcpiDmIndent (Level
);
598 Info
->LastLevel
= Level
;
603 * This is an inexpensive mechanism to try and keep lines from getting
604 * too long. When the limit is hit, start a new line at the previous
605 * indent plus one. A better but more expensive mechanism would be to
606 * keep track of the current column.
609 if (Info
->Count
/*+Info->LastLevel*/ > 10)
613 AcpiDmIndent (Info
->LastLevel
+ 1);
616 /* Print the opcode name */
618 AcpiDmDisassembleOneOp (NULL
, Info
, Op
);
620 if (Op
->Common
.DisasmOpcode
== ACPI_DASM_LNOT_PREFIX
)
625 if ((Op
->Common
.AmlOpcode
== AML_NAME_OP
) ||
626 (Op
->Common
.AmlOpcode
== AML_RETURN_OP
))
631 /* Start the opcode argument list if necessary */
633 OpInfo
= AcpiPsGetOpcodeInfo (Op
->Common
.AmlOpcode
);
635 if ((OpInfo
->Flags
& AML_HAS_ARGS
) ||
636 (Op
->Common
.AmlOpcode
== AML_EVENT_OP
))
638 /* This opcode has an argument list */
640 if (AcpiDmBlockType (Op
) & BLOCK_PAREN
)
645 /* If this is a named opcode, print the associated name value */
647 if (OpInfo
->Flags
& AML_NAMED
)
649 switch (Op
->Common
.AmlOpcode
)
653 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
654 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
655 AcpiDmNamestring (NextOp
->Common
.Value
.Name
);
658 /*lint -fallthrough */
662 Name
= AcpiPsGetName (Op
);
665 AcpiDmNamestring ((char *) Op
->Named
.Path
);
669 AcpiDmDumpName (Name
);
672 if (Op
->Common
.AmlOpcode
!= AML_INT_NAMEDFIELD_OP
)
674 if (AcpiGbl_DbOpt_verbose
)
676 (void) AcpiPsDisplayObjectPathname (NULL
, Op
);
682 switch (Op
->Common
.AmlOpcode
)
686 AcpiDmMethodFlags (Op
);
693 /* Check for _HID and related EISAID() */
702 AcpiDmRegionFlags (Op
);
706 case AML_POWER_RES_OP
:
708 /* Mark the next two Ops as part of the parameter list */
711 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
712 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
714 NextOp
= NextOp
->Common
.Next
;
715 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
719 case AML_PROCESSOR_OP
:
721 /* Mark the next three Ops as part of the parameter list */
724 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
725 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
727 NextOp
= NextOp
->Common
.Next
;
728 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
730 NextOp
= NextOp
->Common
.Next
;
731 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
736 case AML_DATA_REGION_OP
:
750 case AML_THERMAL_ZONE_OP
:
758 AcpiOsPrintf ("*** Unhandled named opcode %X\n", Op
->Common
.AmlOpcode
);
763 else switch (Op
->Common
.AmlOpcode
)
766 case AML_BANK_FIELD_OP
:
767 case AML_INDEX_FIELD_OP
:
771 /* Name of the parent OperationRegion */
773 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
774 AcpiDmNamestring (NextOp
->Common
.Value
.Name
);
776 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
778 switch (Op
->Common
.AmlOpcode
)
780 case AML_BANK_FIELD_OP
:
782 /* Namestring - Bank Name */
784 NextOp
= AcpiPsGetDepthNext (NULL
, NextOp
);
785 AcpiDmNamestring (NextOp
->Common
.Value
.Name
);
786 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
790 * Bank Value. This is a TermArg in the middle of the parameter
791 * list, must handle it here.
793 * Disassemble the TermArg parse tree. ACPI_PARSEOP_PARAMLIST
794 * eliminates newline in the output.
796 NextOp
= NextOp
->Common
.Next
;
798 Info
->Flags
= ACPI_PARSEOP_PARAMLIST
;
799 AcpiDmWalkParseTree (NextOp
, AcpiDmDescendingOp
, AcpiDmAscendingOp
, Info
);
803 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
807 case AML_INDEX_FIELD_OP
:
809 /* Namestring - Data Name */
811 NextOp
= AcpiPsGetDepthNext (NULL
, NextOp
);
812 AcpiDmNamestring (NextOp
->Common
.Value
.Name
);
814 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
822 AcpiDmFieldFlags (NextOp
);
828 /* The next op is the size parameter */
830 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
833 /* Single-step support */
838 if (Op
->Common
.DisasmOpcode
== ACPI_DASM_RESOURCE
)
841 * We have a resource list. Don't need to output
842 * the buffer size Op. Open up a new block
844 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_IGNORE
;
845 NextOp
= NextOp
->Common
.Next
;
846 AcpiOsPrintf (")\n");
847 AcpiDmIndent (Info
->Level
);
848 AcpiOsPrintf ("{\n");
852 /* Normal Buffer, mark size as in the parameter list */
854 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
858 case AML_VAR_PACKAGE_OP
:
862 /* The next op is the size or predicate parameter */
864 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
867 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
874 /* The next op is the size or predicate parameter */
876 NextOp
= AcpiPsGetDepthNext (NULL
, Op
);
879 NextOp
->Common
.DisasmFlags
|= ACPI_PARSEOP_PARAMLIST
;
895 if (AcpiDmBlockType (Op
) & BLOCK_BRACE
)
898 AcpiDmIndent (Level
);
899 AcpiOsPrintf ("{\n");
907 /*******************************************************************************
909 * FUNCTION: AcpiDmAscendingOp
911 * PARAMETERS: ASL_WALK_CALLBACK
915 * DESCRIPTION: Second visitation of a parse object, during ascent of parse
916 * tree. Close out any parameter lists and complete the opcode.
918 ******************************************************************************/
922 ACPI_PARSE_OBJECT
*Op
,
926 ACPI_OP_WALK_INFO
*Info
= Context
;
929 if (Op
->Common
.DisasmFlags
& ACPI_PARSEOP_IGNORE
)
931 /* Ignore this op -- it was handled elsewhere */
936 if ((Level
== 0) && (Op
->Common
.AmlOpcode
== AML_SCOPE_OP
))
938 /* Indicates the end of the current descriptor block (table) */
940 AcpiOsPrintf ("}\n\n");
944 switch (AcpiDmBlockType (Op
))
948 /* Completed an op that has arguments, add closing paren */
952 /* Could be a nested operator, check if comma required */
954 if (!AcpiDmCommaIfListMember (Op
))
956 if ((AcpiDmBlockType (Op
->Common
.Parent
) & BLOCK_BRACE
) &&
957 (!(Op
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
)) &&
958 (Op
->Common
.AmlOpcode
!= AML_INT_BYTELIST_OP
))
961 * This is a first-level element of a term list
964 if (!(Info
->Flags
& ACPI_PARSEOP_PARAMLIST
))
974 case (BLOCK_BRACE
| BLOCK_PAREN
):
976 /* Completed an op that has a term list, add closing brace */
978 if (Op
->Common
.DisasmFlags
& ACPI_PARSEOP_EMPTY_TERMLIST
)
984 AcpiDmIndent (Level
);
988 AcpiDmCommaIfListMember (Op
);
990 if (AcpiDmBlockType (Op
->Common
.Parent
) != BLOCK_PAREN
)
993 if (!(Op
->Common
.DisasmFlags
& ACPI_PARSEOP_EMPTY_TERMLIST
))
995 if ((Op
->Common
.AmlOpcode
== AML_IF_OP
) &&
997 (Op
->Common
.Next
->Common
.AmlOpcode
== AML_ELSE_OP
))
1002 if ((AcpiDmBlockType (Op
->Common
.Parent
) & BLOCK_BRACE
) &&
1007 AcpiOsPrintf ("\n");
1016 /* Could be a nested operator, check if comma required */
1018 if (!AcpiDmCommaIfListMember (Op
))
1020 if ((AcpiDmBlockType (Op
->Common
.Parent
) & BLOCK_BRACE
) &&
1021 (!(Op
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
)) &&
1022 (Op
->Common
.AmlOpcode
!= AML_INT_BYTELIST_OP
))
1025 * This is a first-level element of a term list
1028 AcpiOsPrintf ("\n");
1031 else if (Op
->Common
.Parent
)
1033 switch (Op
->Common
.Parent
->Common
.AmlOpcode
)
1035 case AML_PACKAGE_OP
:
1036 case AML_VAR_PACKAGE_OP
:
1038 if (!(Op
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
))
1040 AcpiOsPrintf ("\n");
1052 if (Op
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
)
1054 if ((Op
->Common
.Next
) &&
1055 (Op
->Common
.Next
->Common
.DisasmFlags
& ACPI_PARSEOP_PARAMLIST
))
1061 * Just completed a parameter node for something like "Buffer (param)".
1062 * Close the paren and open up the term list block with a brace
1064 if (Op
->Common
.Next
)
1066 AcpiOsPrintf (")\n");
1067 AcpiDmIndent (Level
- 1);
1068 AcpiOsPrintf ("{\n");
1072 Op
->Common
.Parent
->Common
.DisasmFlags
|=
1073 ACPI_PARSEOP_EMPTY_TERMLIST
;
1074 AcpiOsPrintf (") {");
1078 if ((Op
->Common
.AmlOpcode
== AML_NAME_OP
) ||
1079 (Op
->Common
.AmlOpcode
== AML_RETURN_OP
))
1087 #endif /* ACPI_DISASSEMBLER */