void AcpiUtSubsystemShutdown ( void) { ACPI_FUNCTION_TRACE (UtSubsystemShutdown); /* Just exit if subsystem is already shutdown */ if (AcpiGbl_Shutdown) { ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated")); return_VOID; } /* Subsystem appears active, go ahead and shut it down */ AcpiGbl_Shutdown = TRUE; AcpiGbl_StartupFlags = 0; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n")); #ifndef ACPI_ASL_COMPILER /* Close the AcpiEvent Handling */ AcpiEvTerminate (); /* Delete any dynamic _OSI interfaces */ AcpiUtInterfaceTerminate (); #endif /* Close the Namespace */ AcpiNsTerminate (); /* Delete the ACPI tables */ AcpiTbTerminate (); /* Close the globals */ AcpiUtTerminate (); /* Purge the local caches */ (void) AcpiUtDeleteCaches (); return_VOID; }
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); 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: AcpiUtDeleteCaches (); DtDeleteCaches (); CmCleanupAndExit (); return (Status); }