void CmDoOutputFiles ( void) { /* Create listings and hex files */ LsDoListings (); HxDoHexOutput (); /* Dump the namespace to the .nsp file if requested */ (void) NsDisplayNamespace (); }
ACPI_STATUS DtDoCompile ( void) { ACPI_STATUS Status; UINT8 Event; DT_FIELD *FieldList; /* Initialize globals */ Status = DtInitialize (); if (ACPI_FAILURE (Status)) { printf ("Error during compiler initialization, 0x%X\n", Status); return (Status); } /* Preprocessor */ Event = UtBeginEvent ("Preprocess input file"); PrDoPreprocess (); UtEndEvent (Event); if (Gbl_PreprocessOnly) { return (AE_OK); } /* * Scan the input file (file is already open) and * build the parse tree */ Event = UtBeginEvent ("Scan and parse input file"); FieldList = DtScanFile (Gbl_Files[ASL_FILE_INPUT].Handle); UtEndEvent (Event); /* Did the parse tree get successfully constructed? */ if (!FieldList) { /* TBD: temporary error message. Msgs should come from function above */ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Input file does not appear to be an ASL or data table source file"); Status = AE_ERROR; goto CleanupAndExit; } Event = UtBeginEvent ("Compile parse tree"); /* * Compile the parse tree */ Status = DtCompileDataTable (&FieldList); UtEndEvent (Event); DtFreeFieldList (); if (ACPI_FAILURE (Status)) { /* TBD: temporary error message. Msgs should come from function above */ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Could not compile input file"); goto CleanupAndExit; } /* Create/open the binary output file */ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL; Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); if (ACPI_FAILURE (Status)) { goto CleanupAndExit; } /* Write the binary, then the optional hex file */ DtOutputBinary (Gbl_RootTable); HxDoHexOutput (); DtWriteTableToListing (); CleanupAndExit: CmCleanupAndExit (); return (Status); }