FreeBSD/sys/contrib/dev/acpica/components/tables/tbxface.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiInitializeTables
 *
 * PARAMETERS:  InitialTableArray   - Pointer to an array of pre-allocated
 *                                    ACPI_TABLE_DESC structures. If NULL, the
 *                                    array is dynamically allocated.
 *              InitialTableCount   - Size of InitialTableArray, in number of
 *                                    ACPI_TABLE_DESC structures
 *              AllowResize         - Flag to tell Table Manager if resize of
 *                                    pre-allocated array is allowed. Ignored
 *                                    if InitialTableArray is NULL.
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Initialize the table manager, get the RSDP and RSDT/XSDT.
 *
 * NOTE:        Allows static allocation of the initial table array in order
 *              to avoid the use of dynamic memory in confined environments
 *              such as the kernel boot sequence where it may not be available.
 *
 *              If the host OS memory managers are initialized, use NULL for
 *              InitialTableArray, and the table will be dynamically allocated.
 *
 ******************************************************************************/
AcpiInitializeTables
PARAMETERS:  InitialTableArray   - Pointer to an array of pre-allocated
ACPI_TABLE_DESC structures. If NULL, the
array is dynamically allocated.
InitialTableCount   - Size of InitialTableArray, in number of
ACPI_TABLE_DESC structures
AllowResize         - Flag to tell Table Manager if resize of
pre-allocated array is allowed. Ignored
if InitialTableArray is NULL.

Status

Initialize the table manager, get the RSDP and RSDT/XSDT.

Allows static allocation of the initial table array in order
to avoid the use of dynamic memory in confined environments
such as the kernel boot sequence where it may not be available.

If the host OS memory managers are initialized, use NULL for
InitialTableArray, and the table will be dynamically allocated.
AcpiInitializeTables PARAMETERS : InitialTableArray - Pointer to an array of pre - allocated ACPI_TABLE_DESC structures . If NULL the array is dynamically allocated . InitialTableCount - Size of InitialTableArray in number of ACPI_TABLE_DESC structures AllowResize - Flag to tell Table Manager if resize of pre - allocated array is allowed . Ignored if InitialTableArray is NULL . Status Initialize the table manager get the RSDP and RSDT / XSDT . Allows static allocation of the initial table array in order to avoid the use of dynamic memory in confined environments such as the kernel boot sequence where it may not be available . If the host OS memory managers are initialized use NULL for InitialTableArray and the table will be dynamically allocated .
ACPI_STATUS
AcpiInitializeTables (
    ACPI_TABLE_DESC         *InitialTableArray,
    UINT32                  InitialTableCount,
    BOOLEAN                 AllowResize)
{
    ACPI_PHYSICAL_ADDRESS   RsdpAddress;
    ACPI_STATUS             Status;
    ACPI_FUNCTION_TRACE (AcpiInitializeTables);
    if (!InitialTableArray)
    {
        Status = AcpiAllocateRootTable (InitialTableCount);
        if (ACPI_FAILURE (Status))
        {
            return_ACPI_STATUS (Status);
        }
    }
    else
    {
        memset (InitialTableArray, 0,
            (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC));
        AcpiGbl_RootTableList.Tables = InitialTableArray;
        AcpiGbl_RootTableList.MaxTableCount = InitialTableCount;
        AcpiGbl_RootTableList.Flags = ACPI_ROOT_ORIGIN_UNKNOWN;
        if (AllowResize)
        {
            AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE;
        }
    }
    RsdpAddress = AcpiOsGetRootPointer ();
    if (!RsdpAddress)
    {
        return_ACPI_STATUS (AE_NOT_FOUND);
    }
    Status = AcpiTbParseRootTable (RsdpAddress);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiInitializeTables ( ACPI_TABLE_DESC * InitialTableArray , UINT32 InitialTableCount , BOOLEAN AllowResize ) { ACPI_PHYSICAL_ADDRESS RsdpAddress ; ACPI_STATUS Status ; ACPI_FUNCTION_TRACE ( AcpiInitializeTables ) ; if ( ! InitialTableArray ) { Status = AcpiAllocateRootTable ( InitialTableCount ) ; if ( ACPI_FAILURE ( Status ) ) { return_ACPI_STATUS ( Status ) ; } } else { memset ( InitialTableArray , 0 , ( ACPI_SIZE ) InitialTableCount * sizeof ( ACPI_TABLE_DESC ) ) ; AcpiGbl_RootTableList . Tables = InitialTableArray ; AcpiGbl_RootTableList . MaxTableCount = InitialTableCount ; AcpiGbl_RootTableList . Flags = ACPI_ROOT_ORIGIN_UNKNOWN ; if ( AllowResize ) { AcpiGbl_RootTableList . Flags |= ACPI_ROOT_ALLOW_RESIZE ; } } RsdpAddress = AcpiOsGetRootPointer ( ) ; if ( ! RsdpAddress ) { return_ACPI_STATUS ( AE_NOT_FOUND ) ; } Status = AcpiTbParseRootTable ( RsdpAddress ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiInitializeTables
 PARAMETERS:  InitialTableArray   - Pointer to an array of pre-allocated
                                    ACPI_TABLE_DESC structures.
FUNCTION : AcpiInitializeTables PARAMETERS : InitialTableArray - Pointer to an array of pre - allocated ACPI_TABLE_DESC structures .
/*
     * Setup the Root Table Array and allocate the table array
     * if requested
     */ /* Root Table Array has been statically allocated by the host */ /* Get the address of the RSDP */ /*
     * Get the root table (RSDT or XSDT) and extract all entries to the local
     * Root Table Array. This array contains the information of the RSDT/XSDT
     * in a common, more useable format.
     */