kernel/acpica/components/tables/tbinstal.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiTbOverrideTable
 *
 * PARAMETERS:  OldTableDesc        - Validated table descriptor to be
 *                                    overridden
 *
 * RETURN:      None
 *
 * DESCRIPTION: Attempt table override by calling the OSL override functions.
 *              Note: If the table is overridden, then the entire new table
 *              is acquired and returned by this function.
 *              Before/after invocation, the table descriptor is in a state
 *              that is "VALIDATED".
 *
 ******************************************************************************/
AcpiTbOverrideTable
PARAMETERS:  OldTableDesc        - Validated table descriptor to be
overridden

None

Attempt table override by calling the OSL override functions.
Note: If the table is overridden, then the entire new table
is acquired and returned by this function.
Before/after invocation, the table descriptor is in a state
that is "VALIDATED".
AcpiTbOverrideTable PARAMETERS : OldTableDesc - Validated table descriptor to be overridden None Attempt table override by calling the OSL override functions . Note : If the table is overridden then the entire new table is acquired and returned by this function . Before / after invocation the table descriptor is in a state that is " VALIDATED " .
void
AcpiTbOverrideTable (
    ACPI_TABLE_DESC         *OldTableDesc)
{
    ACPI_STATUS             Status;
    char                    *OverrideType;
    ACPI_TABLE_DESC         NewTableDesc;
    ACPI_TABLE_HEADER       *Table;
    ACPI_PHYSICAL_ADDRESS   Address;
    UINT32                  Length;
    Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);
    if (ACPI_SUCCESS (Status) && Table)
    {
        AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),
            ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
        OverrideType = "Logical";
        goto FinishOverride;
    }
    Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer,
        &Address, &Length);
    if (ACPI_SUCCESS (Status) && Address && Length)
    {
        AcpiTbAcquireTempTable (&NewTableDesc, Address,
            ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
        OverrideType = "Physical";
        goto FinishOverride;
    }
    return; 
FinishOverride:
    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL);
    if (ACPI_FAILURE (Status))
    {
        return;
    }
    ACPI_INFO (("%4.4s 0x%8.8X%8.8X"
        " %s table override, new table: 0x%8.8X%8.8X",
        OldTableDesc->Signature.Ascii,
        ACPI_FORMAT_UINT64 (OldTableDesc->Address),
        OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));
    AcpiTbUninstallTable (OldTableDesc);
    AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
        NewTableDesc.Flags, NewTableDesc.Pointer);
    AcpiTbValidateTempTable (OldTableDesc);
    AcpiTbReleaseTempTable (&NewTableDesc);
}
void AcpiTbOverrideTable ( ACPI_TABLE_DESC * OldTableDesc ) { ACPI_STATUS Status ; char * OverrideType ; ACPI_TABLE_DESC NewTableDesc ; ACPI_TABLE_HEADER * Table ; ACPI_PHYSICAL_ADDRESS Address ; UINT32 Length ; Status = AcpiOsTableOverride ( OldTableDesc -> Pointer , & Table ) ; if ( ACPI_SUCCESS ( Status ) && Table ) { AcpiTbAcquireTempTable ( & NewTableDesc , ACPI_PTR_TO_PHYSADDR ( Table ) , ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL ) ; OverrideType = " " ; goto FinishOverride ; } Status = AcpiOsPhysicalTableOverride ( OldTableDesc -> Pointer , & Address , & Length ) ; if ( ACPI_SUCCESS ( Status ) && Address && Length ) { AcpiTbAcquireTempTable ( & NewTableDesc , Address , ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL ) ; OverrideType = " " ; goto FinishOverride ; } return ; FinishOverride : Status = AcpiTbVerifyTempTable ( & NewTableDesc , NULL , NULL ) ; if ( ACPI_FAILURE ( Status ) ) { return ; } ACPI_INFO ( ( " " " " , OldTableDesc -> Signature . Ascii , ACPI_FORMAT_UINT64 ( OldTableDesc -> Address ) , OverrideType , ACPI_FORMAT_UINT64 ( NewTableDesc . Address ) ) ) ; AcpiTbUninstallTable ( OldTableDesc ) ; AcpiTbInitTableDescriptor ( OldTableDesc , NewTableDesc . Address , NewTableDesc . Flags , NewTableDesc . Pointer ) ; AcpiTbValidateTempTable ( OldTableDesc ) ; AcpiTbReleaseTempTable ( & NewTableDesc ) ; }
FUNCTION:    AcpiTbOverrideTable
 PARAMETERS:  OldTableDesc        - Validated table descriptor to be
                                    overridden
FUNCTION : AcpiTbOverrideTable PARAMETERS : OldTableDesc - Validated table descriptor to be overridden
/* (1) Attempt logical override (returns a logical address) */ /* (2) Attempt physical override (returns a physical address) */ /* There was no override */ /*
     * Validate and verify a table before overriding, no nested table
     * duplication check as it's too complicated and unnecessary.
     */ /* We can now uninstall the original table */ /*
     * Replace the original table descriptor and keep its state as
     * "VALIDATED".
     */ /* Release the temporary table descriptor */