ACPI_STATUS AcpiDisable (void) { ACPI_STATUS Status; FUNCTION_TRACE ("AcpiDisable"); /* Ensure that ACPI has been initialized */ ACPI_IS_INITIALIZATION_COMPLETE (Status); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Restore original mode */ Status = AcpiHwSetMode (AcpiGbl_OriginalMode); if (ACPI_FAILURE (Status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode")); return_ACPI_STATUS (Status); } /* Unload the SCI interrupt handler */ AcpiEvRemoveSciHandler (); AcpiEvRestoreAcpiState (); return_ACPI_STATUS (Status); }
void AcpiEvTerminate ( void) { UINT32 i; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvTerminate); if (AcpiGbl_EventsInitialized) { /* * Disable all event-related functionality. In all cases, on error, * print a message but obviously we don't abort. */ /* Disable all fixed events */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { Status = AcpiDisableEvent (i, 0); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Could not disable fixed event %u", (UINT32) i)); } } /* Disable all GPEs in all GPE blocks */ Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); /* Remove SCI handler */ Status = AcpiEvRemoveSciHandler (); if (ACPI_FAILURE(Status)) { ACPI_ERROR ((AE_INFO, "Could not remove SCI handler")); } Status = AcpiEvRemoveGlobalLockHandler (); if (ACPI_FAILURE(Status)) { ACPI_ERROR ((AE_INFO, "Could not remove Global Lock handler")); } AcpiGbl_EventsInitialized = FALSE; } /* Deallocate all handler objects installed within GPE info structs */ Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL); /* Return to original mode if necessary */ if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY) { Status = AcpiDisable (); if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, "AcpiDisable failed")); } } return_VOID; }