deps/acpica/source/components/events/evrgnini.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiEvSystemMemoryRegionSetup
 *
 * PARAMETERS:  Handle              - Region we are interested in
 *              Function            - Start or stop
 *              HandlerContext      - Address space handler context
 *              RegionContext       - Region specific context
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Setup a SystemMemory operation region
 *
 ******************************************************************************/
AcpiEvSystemMemoryRegionSetup
PARAMETERS:  Handle              - Region we are interested in
Function            - Start or stop
HandlerContext      - Address space handler context
RegionContext       - Region specific context

Status

Setup a SystemMemory operation region
AcpiEvSystemMemoryRegionSetup PARAMETERS : Handle - Region we are interested in Function - Start or stop HandlerContext - Address space handler context RegionContext - Region specific context Status Setup a SystemMemory operation region
ACPI_STATUS
AcpiEvSystemMemoryRegionSetup (
    ACPI_HANDLE             Handle,
    UINT32                  Function,
    void                    *HandlerContext,
    void                    **RegionContext)
{
    ACPI_OPERAND_OBJECT     *RegionDesc = (ACPI_OPERAND_OBJECT *) Handle;
    ACPI_MEM_SPACE_CONTEXT  *LocalRegionContext;
    ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup);
    if (Function == ACPI_REGION_DEACTIVATE)
    {
        if (*RegionContext)
        {
            LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext;
            if (LocalRegionContext->MappedLength)
            {
                AcpiOsUnmapMemory (LocalRegionContext->MappedLogicalAddress,
                    LocalRegionContext->MappedLength);
            }
            ACPI_FREE (LocalRegionContext);
            *RegionContext = NULL;
        }
        return_ACPI_STATUS (AE_OK);
    }
    LocalRegionContext = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_MEM_SPACE_CONTEXT));
    if (!(LocalRegionContext))
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }
    LocalRegionContext->Length  = RegionDesc->Region.Length;
    LocalRegionContext->Address = RegionDesc->Region.Address;
    *RegionContext = LocalRegionContext;
    return_ACPI_STATUS (AE_OK);
}
ACPI_STATUS AcpiEvSystemMemoryRegionSetup ( ACPI_HANDLE Handle , UINT32 Function , void * HandlerContext , void * * RegionContext ) { ACPI_OPERAND_OBJECT * RegionDesc = ( ACPI_OPERAND_OBJECT * ) Handle ; ACPI_MEM_SPACE_CONTEXT * LocalRegionContext ; ACPI_FUNCTION_TRACE ( EvSystemMemoryRegionSetup ) ; if ( Function == ACPI_REGION_DEACTIVATE ) { if ( * RegionContext ) { LocalRegionContext = ( ACPI_MEM_SPACE_CONTEXT * ) * RegionContext ; if ( LocalRegionContext -> MappedLength ) { AcpiOsUnmapMemory ( LocalRegionContext -> MappedLogicalAddress , LocalRegionContext -> MappedLength ) ; } ACPI_FREE ( LocalRegionContext ) ; * RegionContext = NULL ; } return_ACPI_STATUS ( AE_OK ) ; } LocalRegionContext = ACPI_ALLOCATE_ZEROED ( sizeof ( ACPI_MEM_SPACE_CONTEXT ) ) ; if ( ! ( LocalRegionContext ) ) { return_ACPI_STATUS ( AE_NO_MEMORY ) ; } LocalRegionContext -> Length = RegionDesc -> Region . Length ; LocalRegionContext -> Address = RegionDesc -> Region . Address ; * RegionContext = LocalRegionContext ; return_ACPI_STATUS ( AE_OK ) ; }
FUNCTION:    AcpiEvSystemMemoryRegionSetup
 PARAMETERS:  Handle              - Region we are interested in
              Function            - Start or stop
              HandlerContext      - Address space handler context
              RegionContext       - Region specific context
FUNCTION : AcpiEvSystemMemoryRegionSetup PARAMETERS : Handle - Region we are interested in Function - Start or stop HandlerContext - Address space handler context RegionContext - Region specific context
/* Delete a cached mapping if present */ /* Create a new context */ /* Save the region length and address for use in the handler */