FreeBSD/sys/contrib/dev/acpica/components/events/evsci.c
/******************************************************************************
 *
 * FUNCTION:    AcpiEvRemoveAllSciHandlers
 *
 * PARAMETERS:  none
 *
 * RETURN:      AE_OK if handler uninstalled, AE_ERROR if handler was not
 *              installed to begin with
 *
 * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
 *              taken. Remove all host-installed SCI handlers.
 *
 * Note:  It doesn't seem important to disable all events or set the event
 *        enable registers to their original values. The OS should disable
 *        the SCI interrupt level when the handler is removed, so no more
 *        events will come in.
 *
 ******************************************************************************/


AE_OK if handler uninstalled, AE_ERROR if handler was not
installed to begin with

Remove the SCI interrupt handler. No further SCIs will be
taken. Remove all host-installed SCI handlers.

It doesn't seem important to disable all events or set the event
enable registers to their original values. The OS should disable
the SCI interrupt level when the handler is removed, so no more
events will come in.
AE_OK if handler uninstalled AE_ERROR if handler was not installed to begin with Remove the SCI interrupt handler . No further SCIs will be taken . Remove all host - installed SCI handlers . It doesn ' t seem important to disable all events or set the event enable registers to their original values . The OS should disable the SCI interrupt level when the handler is removed so no more events will come in .
ACPI_STATUS
AcpiEvRemoveAllSciHandlers (
    void)
{
    ACPI_SCI_HANDLER_INFO   *SciHandler;
    ACPI_CPU_FLAGS          Flags;
    ACPI_STATUS             Status;
    ACPI_FUNCTION_TRACE (EvRemoveAllSciHandlers);
    Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
        AcpiEvSciXruptHandler);
    if (!AcpiGbl_SciHandlerList)
    {
        return (Status);
    }
    Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
    while (AcpiGbl_SciHandlerList)
    {
        SciHandler = AcpiGbl_SciHandlerList;
        AcpiGbl_SciHandlerList = SciHandler->Next;
        ACPI_FREE (SciHandler);
    }
    AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiEvRemoveAllSciHandlers ( void ) { ACPI_SCI_HANDLER_INFO * SciHandler ; ACPI_CPU_FLAGS Flags ; ACPI_STATUS Status ; ACPI_FUNCTION_TRACE ( EvRemoveAllSciHandlers ) ; Status = AcpiOsRemoveInterruptHandler ( ( UINT32 ) AcpiGbl_FADT . SciInterrupt , AcpiEvSciXruptHandler ) ; if ( ! AcpiGbl_SciHandlerList ) { return ( Status ) ; } Flags = AcpiOsAcquireLock ( AcpiGbl_GpeLock ) ; while ( AcpiGbl_SciHandlerList ) { SciHandler = AcpiGbl_SciHandlerList ; AcpiGbl_SciHandlerList = SciHandler -> Next ; ACPI_FREE ( SciHandler ) ; } AcpiOsReleaseLock ( AcpiGbl_GpeLock , Flags ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiEvRemoveAllSciHandlers
 PARAMETERS:  none
FUNCTION : AcpiEvRemoveAllSciHandlers PARAMETERS : none
/* Just let the OS remove the handler and disable the level */ /* Free all host-installed SCI handlers */