Esempio n. 1
0
static ACPI_STATUS
AeLocalLoadTable (
    ACPI_TABLE_HEADER       *Table)
{
    ACPI_STATUS             Status = AE_OK;
/*    ACPI_TABLE_DESC         TableInfo; */


    ACPI_FUNCTION_TRACE (AeLocalLoadTable);
#if 0


    if (!Table)
    {
        return_ACPI_STATUS (AE_BAD_PARAMETER);
    }

    TableInfo.Pointer = Table;
    Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_ALL);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Install the new table into the local data structures */

    Status = AcpiTbInitTableDescriptor (&TableInfo);
    if (ACPI_FAILURE (Status))
    {
        if (Status == AE_ALREADY_EXISTS)
        {
            /* Table already exists, no error */

            Status = AE_OK;
        }

        /* Free table allocated by AcpiTbGetTable */

        AcpiTbDeleteSingleTable (&TableInfo);
        return_ACPI_STATUS (Status);
    }

#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))

    Status = AcpiNsLoadTable (TableInfo.InstalledDesc, AcpiGbl_RootNode);
    if (ACPI_FAILURE (Status))
    {
        /* Uninstall table and free the buffer */

        AcpiTbDeleteTablesByType (ACPI_TABLE_ID_DSDT);
        return_ACPI_STATUS (Status);
    }
#endif
#endif

    return_ACPI_STATUS (Status);
}
Esempio n. 2
0
ACPI_STATUS
AcpiTbGetPrimaryTable (
    ACPI_POINTER            *Address,
    ACPI_TABLE_DESC         *TableInfo)
{
    ACPI_STATUS             Status;
    ACPI_TABLE_HEADER       Header;


    ACPI_FUNCTION_TRACE ("TbGetPrimaryTable");


    /* Ignore a NULL address in the RSDT */

    if (!Address->Pointer.Value)
    {
        return_ACPI_STATUS (AE_OK);
    }

    /*
     * Get the header in order to get signature and table size
     */
    Status = AcpiTbGetTableHeader (Address, &Header);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Clear the TableInfo */

    ACPI_MEMSET (TableInfo, 0, sizeof (ACPI_TABLE_DESC));

    /*
     * Check the table signature and make sure it is recognized.
     * Also checks the header checksum
     */
    TableInfo->Pointer = &Header;
    Status = AcpiTbRecognizeTable (TableInfo, ACPI_TABLE_PRIMARY);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Get the entire table */

    Status = AcpiTbGetTableBody (Address, &Header, TableInfo);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Install the table */

    Status = AcpiTbInstallTable (TableInfo);
    return_ACPI_STATUS (Status);
}
Esempio n. 3
0
ACPI_STATUS
AcpiTbGetSecondaryTable (
    ACPI_POINTER            *Address,
    ACPI_STRING             Signature,
    ACPI_TABLE_DESC         *TableInfo)
{
    ACPI_STATUS             Status;
    ACPI_TABLE_HEADER       Header;


    ACPI_FUNCTION_TRACE_STR ("TbGetSecondaryTable", Signature);


    /* Get the header in order to match the signature */

    Status = AcpiTbGetTableHeader (Address, &Header);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Signature must match request */

    if (ACPI_STRNCMP (Header.Signature, Signature, ACPI_NAME_SIZE))
    {
        ACPI_REPORT_ERROR (("Incorrect table signature - wanted [%s] found [%4.4s]\n",
            Signature, Header.Signature));
        return_ACPI_STATUS (AE_BAD_SIGNATURE);
    }

    /*
     * Check the table signature and make sure it is recognized.
     * Also checks the header checksum
     */
    TableInfo->Pointer = &Header;
    Status = AcpiTbRecognizeTable (TableInfo, ACPI_TABLE_SECONDARY);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Get the entire table */

    Status = AcpiTbGetTableBody (Address, &Header, TableInfo);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Install the table */

    Status = AcpiTbInstallTable (TableInfo);
    return_ACPI_STATUS (Status);
}