1 /******************************************************************************
3 * Module Name: adisasm - Application-level disassembler 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.
60 #define _COMPONENT ACPI_TOOLS
61 ACPI_MODULE_NAME ("adisasm")
64 * Older versions of Bison won't emit this external in the generated header.
65 * Newer versions do emit the external, so we don't need to do it.
67 #ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
68 extern int AslCompilerdebug
;
76 NsSetupNamespaceListing (
80 /* Local prototypes */
89 ACPI_TABLE_HEADER
*Table
);
91 /* Stubs for ASL compiler */
93 #ifndef ACPI_ASL_COMPILER
96 ACPI_PARSE_OBJECT
*Op
,
97 ACPI_WALK_STATE
*WalkState
)
105 ACPI_WALK_STATE
*WalkState
)
114 ACPI_NAMESPACE_NODE
*Node
)
116 return (AE_NOT_IMPLEMENTED
);
120 AcpiDsRestartControlMethod (
121 ACPI_WALK_STATE
*WalkState
,
122 ACPI_OPERAND_OBJECT
*ReturnDesc
)
128 AcpiDsTerminateControlMethod (
129 ACPI_OPERAND_OBJECT
*MethodDesc
,
130 ACPI_WALK_STATE
*WalkState
)
136 AcpiDsCallControlMethod (
137 ACPI_THREAD_STATE
*Thread
,
138 ACPI_WALK_STATE
*WalkState
,
139 ACPI_PARSE_OBJECT
*Op
)
145 AcpiDsMethodDataInitArgs (
146 ACPI_OPERAND_OBJECT
**Params
,
147 UINT32 MaxParamCount
,
148 ACPI_WALK_STATE
*WalkState
)
154 static ACPI_TABLE_DESC LocalTables
[1];
155 static ACPI_PARSE_OBJECT
*AcpiGbl_ParseOpRoot
;
158 /*******************************************************************************
160 * FUNCTION: AdGetFileSize
162 * PARAMETERS: File - Open file handle
166 * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
168 ******************************************************************************/
178 Offset
= ftell (File
);
180 fseek (File
, 0, SEEK_END
);
181 FileSize
= (UINT32
) ftell (File
);
183 /* Restore file pointer */
185 fseek (File
, Offset
, SEEK_SET
);
190 /*******************************************************************************
192 * FUNCTION: AdInitialize
198 * DESCRIPTION: ACPICA and local initialization
200 ******************************************************************************/
209 /* ACPI CA subsystem initialization */
211 Status
= AcpiOsInitialize ();
212 if (ACPI_FAILURE (Status
))
217 Status
= AcpiUtInitGlobals ();
218 if (ACPI_FAILURE (Status
))
223 Status
= AcpiUtMutexInitialize ();
224 if (ACPI_FAILURE (Status
))
229 Status
= AcpiNsRootInitialize ();
230 if (ACPI_FAILURE (Status
))
235 /* Setup the Table Manager (cheat - there is no RSDT) */
237 AcpiGbl_RootTableList
.MaxTableCount
= 1;
238 AcpiGbl_RootTableList
.CurrentTableCount
= 0;
239 AcpiGbl_RootTableList
.Tables
= LocalTables
;
245 /******************************************************************************
247 * FUNCTION: AdAmlDisassemble
249 * PARAMETERS: Filename - AML input filename
250 * OutToFile - TRUE if output should go to a file
251 * Prefix - Path prefix for output
252 * OutFilename - where the filename is returned
253 * GetAllTables - TRUE if all tables are desired
257 * DESCRIPTION: Disassemble an entire ACPI table
259 *****************************************************************************/
267 BOOLEAN GetAllTables
)
270 char *DisasmFilename
= NULL
;
271 char *ExternalFilename
;
272 ACPI_EXTERNAL_FILE
*ExternalFileList
= AcpiGbl_ExternalFileList
;
274 ACPI_TABLE_HEADER
*Table
= NULL
;
275 ACPI_TABLE_HEADER
*ExternalTable
;
276 ACPI_OWNER_ID OwnerId
;
280 * Input: AML code from either a file or via GetTables (memory or
285 Status
= AcpiDbGetTableFromFile (Filename
, &Table
);
286 if (ACPI_FAILURE (Status
))
292 * External filenames separated by commas
293 * Example: iasl -e file1,file2,file3 -d xxx.aml
295 while (ExternalFileList
)
297 ExternalFilename
= ExternalFileList
->Path
;
298 if (!ACPI_STRCMP (ExternalFilename
, Filename
))
300 /* Next external file */
302 ExternalFileList
= ExternalFileList
->Next
;
306 Status
= AcpiDbGetTableFromFile (ExternalFilename
, &ExternalTable
);
307 if (ACPI_FAILURE (Status
))
312 /* Load external table for symbol resolution */
316 Status
= AdParseTable (ExternalTable
, &OwnerId
, TRUE
, TRUE
);
317 if (ACPI_FAILURE (Status
))
319 AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
320 AcpiFormatException (Status
));
325 * Load namespace from names created within control methods
326 * Set owner id of nodes in external table
328 AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot
,
329 AcpiGbl_RootNode
, OwnerId
);
330 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot
);
333 /* Next external file */
335 ExternalFileList
= ExternalFileList
->Next
;
338 /* Clear external list generated by Scope in external tables */
340 if (AcpiGbl_ExternalFileList
)
342 AcpiDmClearExternalList ();
345 /* Load any externals defined in the optional external ref file */
347 AcpiDmGetExternalsFromFile ();
351 Status
= AdGetLocalTables (Filename
, GetAllTables
);
352 if (ACPI_FAILURE (Status
))
354 AcpiOsPrintf ("Could not get ACPI tables, %s\n",
355 AcpiFormatException (Status
));
359 if (!AcpiGbl_DbOpt_disasm
)
364 /* Obtained the local tables, just disassemble the DSDT */
366 Status
= AcpiGetTable (ACPI_SIG_DSDT
, 0, &Table
);
367 if (ACPI_FAILURE (Status
))
369 AcpiOsPrintf ("Could not get DSDT, %s\n",
370 AcpiFormatException (Status
));
374 AcpiOsPrintf ("\nDisassembly of DSDT\n");
375 Prefix
= AdGenerateFilename ("dsdt", Table
->OemTableId
);
379 * Output: ASL code. Redirect to a file if requested
383 /* Create/Open a disassembly output file */
385 DisasmFilename
= FlGenerateFilename (Prefix
, FILE_SUFFIX_DISASSEMBLY
);
388 fprintf (stderr
, "Could not generate output filename\n");
393 File
= fopen (DisasmFilename
, "w+");
396 fprintf (stderr
, "Could not open output file %s\n", DisasmFilename
);
401 AcpiOsRedirectOutput (File
);
404 *OutFilename
= DisasmFilename
;
406 if (!AcpiUtIsAmlTable (Table
))
408 AdDisassemblerHeader (Filename
);
409 AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
411 AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
412 "FieldName : FieldValue\n */\n\n");
414 AcpiDmDumpDataTable (Table
);
415 fprintf (stderr
, "Acpi Data Table [%4.4s] decoded\n",
417 fprintf (stderr
, "Formatted output: %s - %u bytes\n",
418 DisasmFilename
, AdGetFileSize (File
));
422 /* Always parse the tables, only option is what to display */
424 Status
= AdParseTable (Table
, &OwnerId
, TRUE
, FALSE
);
425 if (ACPI_FAILURE (Status
))
427 AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
428 AcpiFormatException (Status
));
432 if (AslCompilerdebug
)
434 AcpiOsPrintf ("/**** Before second load\n");
436 NsSetupNamespaceListing (File
);
437 NsDisplayNamespace ();
438 AcpiOsPrintf ("*****/\n");
441 /* Load namespace from names created within control methods */
443 AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot
,
444 AcpiGbl_RootNode
, OwnerId
);
447 * Cross reference the namespace here, in order to
448 * generate External() statements
450 AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot
,
451 AcpiGbl_RootNode
, OwnerId
);
453 if (AslCompilerdebug
)
455 AcpiDmDumpTree (AcpiGbl_ParseOpRoot
);
458 /* Find possible calls to external control methods */
460 AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot
);
463 * If we found any external control methods, we must reparse
464 * the entire tree with the new information (namely, the
465 * number of arguments per method)
467 if (AcpiDmGetExternalMethodCount ())
470 "\nFound %u external control methods, "
471 "reparsing with new information\n",
472 AcpiDmGetExternalMethodCount ());
474 /* Reparse, rebuild namespace. no need to xref namespace */
476 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot
);
477 AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode
);
479 AcpiGbl_RootNode
= NULL
;
480 AcpiGbl_RootNodeStruct
.Name
.Integer
= ACPI_ROOT_NAME
;
481 AcpiGbl_RootNodeStruct
.DescriptorType
= ACPI_DESC_TYPE_NAMED
;
482 AcpiGbl_RootNodeStruct
.Type
= ACPI_TYPE_DEVICE
;
483 AcpiGbl_RootNodeStruct
.Parent
= NULL
;
484 AcpiGbl_RootNodeStruct
.Child
= NULL
;
485 AcpiGbl_RootNodeStruct
.Peer
= NULL
;
486 AcpiGbl_RootNodeStruct
.Object
= NULL
;
487 AcpiGbl_RootNodeStruct
.Flags
= 0;
489 Status
= AcpiNsRootInitialize ();
490 AcpiDmAddExternalsToNamespace ();
492 /* Parse the table again. No need to reload it, however */
494 Status
= AdParseTable (Table
, NULL
, FALSE
, FALSE
);
495 if (ACPI_FAILURE (Status
))
497 AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
498 AcpiFormatException (Status
));
502 if (AslCompilerdebug
)
504 AcpiOsPrintf ("/**** After second load and resource conversion\n");
505 NsSetupNamespaceListing (File
);
506 NsDisplayNamespace ();
507 AcpiOsPrintf ("*****/\n");
509 AcpiDmDumpTree (AcpiGbl_ParseOpRoot
);
514 * Now that the namespace is finalized, we can perform namespace
517 * 1) Convert fixed-offset references to resource descriptors
518 * to symbolic references (Note: modifies namespace)
520 AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot
, AcpiGbl_RootNode
);
522 /* Optional displays */
524 if (AcpiGbl_DbOpt_disasm
)
526 /* This is the real disassembly */
528 AdDisplayTables (Filename
, Table
);
530 /* Dump hex table if requested (-vt) */
532 AcpiDmDumpDataTable (Table
);
534 fprintf (stderr
, "Disassembly completed\n");
535 fprintf (stderr
, "ASL Output: %s - %u bytes\n",
536 DisasmFilename
, AdGetFileSize (File
));
542 if (Table
&& !AcpiUtIsAmlTable (Table
))
547 if (OutToFile
&& File
)
549 if (AslCompilerdebug
) /* Display final namespace, with transforms */
551 NsSetupNamespaceListing (File
);
552 NsDisplayNamespace ();
556 AcpiOsRedirectOutput (stdout
);
559 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot
);
560 AcpiGbl_ParseOpRoot
= NULL
;
565 /******************************************************************************
567 * FUNCTION: AdDisassemblerHeader
569 * PARAMETERS: Filename - Input file for the table
573 * DESCRIPTION: Create the disassembler header, including ACPI CA signon with
574 * current time and date.
576 *****************************************************************************/
579 AdDisassemblerHeader (
586 /* Header and input table info */
588 AcpiOsPrintf ("/*\n");
589 AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
591 AcpiOsPrintf (" * Disassembly of %s, %s", Filename
, ctime (&Timer
));
592 AcpiOsPrintf (" *\n");
596 /******************************************************************************
598 * FUNCTION: AdCreateTableHeader
600 * PARAMETERS: Filename - Input file for the table
601 * Table - Pointer to the raw table
605 * DESCRIPTION: Create the ASL table header, including ACPI CA signon with
606 * current time and date.
608 *****************************************************************************/
611 AdCreateTableHeader (
613 ACPI_TABLE_HEADER
*Table
)
620 * Print file header and dump original table header
622 AdDisassemblerHeader (Filename
);
624 AcpiOsPrintf (" * Original Table Header:\n");
625 AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table
->Signature
);
626 AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table
->Length
, Table
->Length
);
628 /* Print and validate the revision */
630 AcpiOsPrintf (" * Revision 0x%2.2X", Table
->Revision
);
632 switch (Table
->Revision
)
636 AcpiOsPrintf (" **** Invalid Revision");
641 /* Revision of DSDT controls the ACPI integer width */
643 if (ACPI_COMPARE_NAME (Table
->Signature
, ACPI_SIG_DSDT
))
645 AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support");
655 /* Print and validate the table checksum */
657 AcpiOsPrintf (" * Checksum 0x%2.2X", Table
->Checksum
);
659 Checksum
= AcpiTbChecksum (ACPI_CAST_PTR (UINT8
, Table
), Table
->Length
);
662 AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
663 (UINT8
) (Table
->Checksum
- Checksum
));
667 AcpiOsPrintf (" * OEM ID \"%.6s\"\n", Table
->OemId
);
668 AcpiOsPrintf (" * OEM Table ID \"%.8s\"\n", Table
->OemTableId
);
669 AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table
->OemRevision
, Table
->OemRevision
);
670 AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table
->AslCompilerId
);
671 AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table
->AslCompilerRevision
, Table
->AslCompilerRevision
);
672 AcpiOsPrintf (" */\n");
674 /* Create AML output filename based on input filename */
678 NewFilename
= FlGenerateFilename (Filename
, "aml");
682 NewFilename
= ACPI_ALLOCATE_ZEROED (9);
683 strncat (NewFilename
, Table
->Signature
, 4);
684 strcat (NewFilename
, ".aml");
687 /* Open the ASL definition block */
690 "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
691 NewFilename
, Table
->Signature
, Table
->Revision
,
692 Table
->OemId
, Table
->OemTableId
, Table
->OemRevision
);
694 ACPI_FREE (NewFilename
);
698 /******************************************************************************
700 * FUNCTION: AdDisplayTables
702 * PARAMETERS: Filename - Input file for the table
703 * Table - Pointer to the raw table
707 * DESCRIPTION: Display (disassemble) loaded tables and dump raw tables
709 *****************************************************************************/
714 ACPI_TABLE_HEADER
*Table
)
718 if (!AcpiGbl_ParseOpRoot
)
720 return (AE_NOT_EXIST
);
723 if (!AcpiGbl_DbOpt_verbose
)
725 AdCreateTableHeader (Filename
, Table
);
728 AcpiDmDisassemble (NULL
, AcpiGbl_ParseOpRoot
, ACPI_UINT32_MAX
);
730 if (AcpiGbl_DbOpt_verbose
)
732 AcpiOsPrintf ("\n\nTable Header:\n");
733 AcpiUtDebugDumpBuffer ((UINT8
*) Table
, sizeof (ACPI_TABLE_HEADER
),
734 DB_BYTE_DISPLAY
, ACPI_UINT32_MAX
);
736 AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table
->Length
);
737 AcpiUtDebugDumpBuffer (((UINT8
*) Table
+ sizeof (ACPI_TABLE_HEADER
)),
738 Table
->Length
, DB_BYTE_DISPLAY
, ACPI_UINT32_MAX
);
745 /******************************************************************************
747 * FUNCTION: AdGetLocalTables
749 * PARAMETERS: Filename - Not used
750 * GetAllTables - TRUE if all tables are desired
754 * DESCRIPTION: Get the ACPI tables from either memory or a file
756 *****************************************************************************/
761 BOOLEAN GetAllTables
)
764 ACPI_TABLE_HEADER TableHeader
;
765 ACPI_TABLE_HEADER
*NewTable
;
773 ACPI_MOVE_32_TO_32 (TableHeader
.Signature
, ACPI_SIG_RSDT
);
774 AcpiOsTableOverride (&TableHeader
, &NewTable
);
777 fprintf (stderr
, "Could not obtain RSDT\n");
778 return (AE_NO_ACPI_TABLES
);
782 AdWriteTable (NewTable
, NewTable
->Length
,
783 ACPI_SIG_RSDT
, NewTable
->OemTableId
);
786 if (ACPI_COMPARE_NAME (NewTable
->Signature
, ACPI_SIG_RSDT
))
788 PointerSize
= sizeof (UINT32
);
792 PointerSize
= sizeof (UINT64
);
796 * Determine the number of tables pointed to by the RSDT/XSDT.
797 * This is defined by the ACPI Specification to be the number of
798 * pointers contained within the RSDT/XSDT. The size of the pointers
799 * is architecture-dependent.
801 NumTables
= (NewTable
->Length
- sizeof (ACPI_TABLE_HEADER
)) / PointerSize
;
802 AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
803 NumTables
, NewTable
->Signature
);
807 ACPI_MOVE_32_TO_32 (TableHeader
.Signature
, ACPI_SIG_FADT
);
808 AcpiOsTableOverride (&TableHeader
, &NewTable
);
811 AdWriteTable (NewTable
, NewTable
->Length
,
812 ACPI_SIG_FADT
, NewTable
->OemTableId
);
816 /* Don't bother with FACS, it is usually all zeros */
819 /* Always get the DSDT */
821 ACPI_MOVE_32_TO_32 (TableHeader
.Signature
, ACPI_SIG_DSDT
);
822 AcpiOsTableOverride (&TableHeader
, &NewTable
);
825 AdWriteTable (NewTable
, NewTable
->Length
,
826 ACPI_SIG_DSDT
, NewTable
->OemTableId
);
828 /* Store DSDT in the Table Manager */
830 Status
= AcpiTbStoreTable (0, NewTable
, NewTable
->Length
,
832 if (ACPI_FAILURE (Status
))
834 fprintf (stderr
, "Could not store DSDT\n");
835 return (AE_NO_ACPI_TABLES
);
840 fprintf (stderr
, "Could not obtain DSDT\n");
841 return (AE_NO_ACPI_TABLES
);
845 /* TBD: Future implementation */
851 ACPI_MOVE_32_TO_32 (TableHeader
.Signature
, ACPI_SIG_SSDT
);
855 Status
= AcpiOsTableOverride (&TableHeader
, &NewTable
);
864 /******************************************************************************
866 * FUNCTION: AdParseTable
868 * PARAMETERS: Table - Pointer to the raw table
869 * OwnerId - Returned OwnerId of the table
870 * LoadTable - If add table to the global table list
871 * External - If this is an external table
875 * DESCRIPTION: Parse the DSDT.
877 *****************************************************************************/
881 ACPI_TABLE_HEADER
*Table
,
882 ACPI_OWNER_ID
*OwnerId
,
886 ACPI_STATUS Status
= AE_OK
;
887 ACPI_WALK_STATE
*WalkState
;
895 return (AE_NOT_EXIST
);
898 /* Pass 1: Parse everything except control method bodies */
900 fprintf (stderr
, "Pass 1 parse of [%4.4s]\n", (char *) Table
->Signature
);
902 AmlLength
= Table
->Length
- sizeof (ACPI_TABLE_HEADER
);
903 AmlStart
= ((UINT8
*) Table
+ sizeof (ACPI_TABLE_HEADER
));
905 /* Create the root object */
907 AcpiGbl_ParseOpRoot
= AcpiPsCreateScopeOp ();
908 if (!AcpiGbl_ParseOpRoot
)
910 return (AE_NO_MEMORY
);
913 /* Create and initialize a new walk state */
915 WalkState
= AcpiDsCreateWalkState (0,
916 AcpiGbl_ParseOpRoot
, NULL
, NULL
);
919 return (AE_NO_MEMORY
);
922 Status
= AcpiDsInitAmlWalk (WalkState
, AcpiGbl_ParseOpRoot
,
923 NULL
, AmlStart
, AmlLength
, NULL
, ACPI_IMODE_LOAD_PASS1
);
924 if (ACPI_FAILURE (Status
))
929 WalkState
->ParseFlags
&= ~ACPI_PARSE_DELETE_TREE
;
930 WalkState
->ParseFlags
|= ACPI_PARSE_DISASSEMBLE
;
932 Status
= AcpiPsParseAml (WalkState
);
933 if (ACPI_FAILURE (Status
))
938 /* If LoadTable is FALSE, we are parsing the last loaded table */
940 TableIndex
= AcpiGbl_RootTableList
.CurrentTableCount
- 1;
946 Status
= AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS
) Table
, Table
,
947 Table
->Length
, ACPI_TABLE_ORIGIN_ALLOCATED
, &TableIndex
);
948 if (ACPI_FAILURE (Status
))
952 Status
= AcpiTbAllocateOwnerId (TableIndex
);
953 if (ACPI_FAILURE (Status
))
959 Status
= AcpiTbGetOwnerId (TableIndex
, OwnerId
);
960 if (ACPI_FAILURE (Status
))
967 fprintf (stderr
, "Pass 2 parse of [%4.4s]\n", (char *) Table
->Signature
);
969 Status
= AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2
, TableIndex
, NULL
);
970 if (ACPI_FAILURE (Status
))
975 /* No need to parse control methods of external table */
982 /* Pass 3: Parse control methods and link their parse trees into the main parse tree */
984 fprintf (stderr
, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
985 Status
= AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot
);
986 fprintf (stderr
, "\n");
988 /* Process Resource Templates */
990 AcpiDmFindResources (AcpiGbl_ParseOpRoot
);
992 fprintf (stderr
, "Parsing completed\n");