kernel/acpica/components/tables/tbinstal.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiTbInstallStandardTable
 *
 * PARAMETERS:  Address             - Address of the table (might be a virtual
 *                                    address depending on the TableFlags)
 *              Flags               - Flags for the table
 *              Reload              - Whether reload should be performed
 *              Override            - Whether override should be performed
 *              TableIndex          - Where the table index is returned
 *
 * RETURN:      Status
 *
 * DESCRIPTION: This function is called to verify and install an ACPI table.
 *              When this function is called by "Load" or "LoadTable" opcodes,
 *              or by AcpiLoadTable() API, the "Reload" parameter is set.
 *              After sucessfully returning from this function, table is
 *              "INSTALLED" but not "VALIDATED".
 *
 ******************************************************************************/


Status

This function is called to verify and install an ACPI table.
Status This function is called to verify and install an ACPI table .
ACPI_STATUS
AcpiTbInstallStandardTable (
    ACPI_PHYSICAL_ADDRESS   Address,
    UINT8                   Flags,
    BOOLEAN                 Reload,
    BOOLEAN                 Override,
    UINT32                  *TableIndex)
{
    UINT32                  i;
    ACPI_STATUS             Status = AE_OK;
    ACPI_TABLE_DESC         NewTableDesc;
    ACPI_FUNCTION_TRACE (TbInstallStandardTable);
    Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
    if (ACPI_FAILURE (Status))
    {
        ACPI_ERROR ((AE_INFO,
            "Could not acquire table length at %8.8X%8.8X",
            ACPI_FORMAT_UINT64 (Address)));
        return_ACPI_STATUS (Status);
    }
    if (!Reload &&
        AcpiGbl_DisableSsdtTableInstall &&
        ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
    {
        ACPI_INFO ((
            "Ignoring installation of %4.4s at %8.8X%8.8X",
            NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
        goto ReleaseAndExit;
    }
    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);
    if (ACPI_FAILURE (Status))
    {
        if (Status == AE_CTRL_TERMINATE)
        {
            AcpiTbUninstallTable (&NewTableDesc);
            (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
            *TableIndex = i;
            return_ACPI_STATUS (AE_OK);
        }
        goto UnlockAndExit;
    }
    AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);
    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
    AcpiTbNotifyTable (ACPI_TABLE_EVENT_INSTALL, NewTableDesc.Pointer);
    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
UnlockAndExit:
    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
ReleaseAndExit:
    AcpiTbReleaseTempTable (&NewTableDesc);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiTbInstallStandardTable ( ACPI_PHYSICAL_ADDRESS Address , UINT8 Flags , BOOLEAN Reload , BOOLEAN Override , UINT32 * TableIndex ) { UINT32 i ; ACPI_STATUS Status = AE_OK ; ACPI_TABLE_DESC NewTableDesc ; ACPI_FUNCTION_TRACE ( TbInstallStandardTable ) ; Status = AcpiTbAcquireTempTable ( & NewTableDesc , Address , Flags ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR ( ( AE_INFO , " " , ACPI_FORMAT_UINT64 ( Address ) ) ) ; return_ACPI_STATUS ( Status ) ; } if ( ! Reload && AcpiGbl_DisableSsdtTableInstall && ACPI_COMPARE_NAME ( & NewTableDesc . Signature , ACPI_SIG_SSDT ) ) { ACPI_INFO ( ( " " , NewTableDesc . Signature . Ascii , ACPI_FORMAT_UINT64 ( Address ) ) ) ; goto ReleaseAndExit ; } ( void ) AcpiUtAcquireMutex ( ACPI_MTX_TABLES ) ; Status = AcpiTbVerifyTempTable ( & NewTableDesc , NULL , & i ) ; if ( ACPI_FAILURE ( Status ) ) { if ( Status == AE_CTRL_TERMINATE ) { AcpiTbUninstallTable ( & NewTableDesc ) ; ( void ) AcpiUtReleaseMutex ( ACPI_MTX_TABLES ) ; * TableIndex = i ; return_ACPI_STATUS ( AE_OK ) ; } goto UnlockAndExit ; } AcpiTbInstallTableWithOverride ( & NewTableDesc , Override , TableIndex ) ; ( void ) AcpiUtReleaseMutex ( ACPI_MTX_TABLES ) ; AcpiTbNotifyTable ( ACPI_TABLE_EVENT_INSTALL , NewTableDesc . Pointer ) ; ( void ) AcpiUtAcquireMutex ( ACPI_MTX_TABLES ) ; UnlockAndExit : ( void ) AcpiUtReleaseMutex ( ACPI_MTX_TABLES ) ; ReleaseAndExit : AcpiTbReleaseTempTable ( & NewTableDesc ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiTbInstallStandardTable
 PARAMETERS:  Address             - Address of the table (might be a virtual
                                    address depending on the TableFlags)
              Flags               - Flags for the table
              Reload              - Whether reload should be performed
              Override            - Whether override should be performed
              TableIndex          - Where the table index is returned
FUNCTION : AcpiTbInstallStandardTable PARAMETERS : Address - Address of the table ( might be a virtual address depending on the TableFlags ) Flags - Flags for the table Reload - Whether reload should be performed Override - Whether override should be performed TableIndex - Where the table index is returned
/* Acquire a temporary table descriptor for validation */ /*
     * Optionally do not load any SSDTs from the RSDT/XSDT. This can
     * be useful for debugging ACPI problems on some machines.
     */ /* Acquire the table lock */ /* Validate and verify a table before installation */ /*
             * Table was unloaded, allow it to be reloaded.
             * As we are going to return AE_OK to the caller, we should
             * take the responsibility of freeing the input descriptor.
             * Refill the input descriptor to ensure
             * AcpiTbInstallTableWithOverride() can be called again to
             * indicate the re-installation.
             */ /* Add the table to the global root table list */ /* Invoke table handler */ /* Release the table lock */ /* Release the temporary table descriptor */