FreeBSD/sys/contrib/dev/acpica/components/events/evhandler.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiEvInstallRegionHandlers
 *
 * PARAMETERS:  None
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Installs the core subsystem default address space handlers.
 *
 ******************************************************************************/


Status

Installs the core subsystem default address space handlers.
Status Installs the core subsystem default address space handlers .
ACPI_STATUS
AcpiEvInstallRegionHandlers (
    void)
{
    ACPI_STATUS             Status;
    UINT32                  i;
    ACPI_FUNCTION_TRACE (EvInstallRegionHandlers);
    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }
    for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
    {
        Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode,
            AcpiGbl_DefaultAddressSpaces[i],
            ACPI_DEFAULT_HANDLER, NULL, NULL);
        switch (Status)
        {
        case AE_OK:
        case AE_SAME_HANDLER:
        case AE_ALREADY_EXISTS:
            Status = AE_OK;
            break;
        default:
            goto UnlockAndExit;
        }
    }
UnlockAndExit:
    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiEvInstallRegionHandlers ( void ) { ACPI_STATUS Status ; UINT32 i ; ACPI_FUNCTION_TRACE ( EvInstallRegionHandlers ) ; Status = AcpiUtAcquireMutex ( ACPI_MTX_NAMESPACE ) ; if ( ACPI_FAILURE ( Status ) ) { return_ACPI_STATUS ( Status ) ; } for ( i = 0 ; i < ACPI_NUM_DEFAULT_SPACES ; i ++ ) { Status = AcpiEvInstallSpaceHandler ( AcpiGbl_RootNode , AcpiGbl_DefaultAddressSpaces [ i ] , ACPI_DEFAULT_HANDLER , NULL , NULL ) ; switch ( Status ) { case AE_OK : case AE_SAME_HANDLER : case AE_ALREADY_EXISTS : Status = AE_OK ; break ; default : goto UnlockAndExit ; } } UnlockAndExit : ( void ) AcpiUtReleaseMutex ( ACPI_MTX_NAMESPACE ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiEvInstallRegionHandlers
 PARAMETERS:  None
FUNCTION : AcpiEvInstallRegionHandlers PARAMETERS : None
/*
     * All address spaces (PCI Config, EC, SMBus) are scope dependent and
     * registration must occur for a specific device.
     *
     * In the case of the system memory and IO address spaces there is
     * currently no device associated with the address space. For these we
     * use the root.
     *
     * We install the default PCI config space handler at the root so that
     * this space is immediately available even though the we have not
     * enumerated all the PCI Root Buses yet. This is to conform to the ACPI
     * specification which states that the PCI config space must be always
     * available -- even though we are nowhere near ready to find the PCI root
     * buses at this point.
     *
     * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
     * has already been installed (via AcpiInstallAddressSpaceHandler).
     * Similar for AE_SAME_HANDLER.
     */ /* These exceptions are all OK */