Exemplo n.º 1
0
ACPI_STATUS
AeLoadTables (
    void)
{
    ACPI_STATUS             Status;


    Status = AcpiLoadTables ();
    ACPI_CHECK_OK (AcpiLoadTables, Status);

    /*
     * Test run-time control method installation. Do it twice to test code
     * for an existing name.
     */
    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    return (AE_OK);
}
Exemplo n.º 2
0
ACPI_STATUS
AeInstallTables (
    void)
{
    ACPI_STATUS             Status;
    ACPI_TABLE_HEADER       Header;
    ACPI_TABLE_HEADER       *Table;


    Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE);
    AE_CHECK_OK (AcpiInitializeTables, Status);

    Status = AcpiReallocateRootTable ();
    AE_CHECK_OK (AcpiReallocateRootTable, Status);

    Status = AcpiLoadTables ();
    AE_CHECK_OK (AcpiLoadTables, Status);

    /*
     * Test run-time control method installation. Do it twice to test code
     * for an existing name.
     */
    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    /* Test multiple table/UEFI support. First, get the headers */

    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 1, &Header);
    AE_CHECK_OK (AcpiGetTableHeader, Status);

    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 2, &Header);
    AE_CHECK_OK (AcpiGetTableHeader, Status);

    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 3, &Header);
    AE_CHECK_STATUS (AcpiGetTableHeader, Status, AE_NOT_FOUND);

    /* Now get the actual tables */

    Status = AcpiGetTable (ACPI_SIG_UEFI, 1, &Table);
    AE_CHECK_OK (AcpiGetTable, Status);

    Status = AcpiGetTable (ACPI_SIG_UEFI, 2, &Table);
    AE_CHECK_OK (AcpiGetTable, Status);

    Status = AcpiGetTable (ACPI_SIG_UEFI, 3, &Table);
    AE_CHECK_STATUS (AcpiGetTable, Status, AE_NOT_FOUND);

    return (AE_OK);
}
Exemplo n.º 3
0
static void
AcpiDbTestAllObjects (
    void)
{
    ACPI_STATUS             Status;


    /* Install the debugger read-object control method if necessary */

    if (!ReadHandle)
    {
        Status = AcpiInstallMethod (ReadMethodCode);
        if (ACPI_FAILURE (Status))
        {
            AcpiOsPrintf ("%s, Could not install debugger read method\n",
                AcpiFormatException (Status));
            return;
        }

        Status = AcpiGetHandle (NULL, ACPI_DB_READ_METHOD, &ReadHandle);
        if (ACPI_FAILURE (Status))
        {
            AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
                ACPI_DB_READ_METHOD);
            return;
        }
    }

    /* Install the debugger write-object control method if necessary */

    if (!WriteHandle)
    {
        Status = AcpiInstallMethod (WriteMethodCode);
        if (ACPI_FAILURE (Status))
        {
            AcpiOsPrintf ("%s, Could not install debugger write method\n",
                AcpiFormatException (Status));
            return;
        }

        Status = AcpiGetHandle (NULL, ACPI_DB_WRITE_METHOD, &WriteHandle);
        if (ACPI_FAILURE (Status))
        {
            AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
                ACPI_DB_WRITE_METHOD);
            return;
        }
    }

    /* Walk the entire namespace, testing each supported named data object */

    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
        ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
}
Exemplo n.º 4
0
ACPI_STATUS
AeInstallTables (
    void)
{
    ACPI_STATUS             Status;


    Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE);
    AE_CHECK_OK (AcpiInitializeTables, Status);

    Status = AcpiReallocateRootTable ();
    AE_CHECK_OK (AcpiReallocateRootTable, Status);

    Status = AcpiLoadTables ();
    AE_CHECK_OK (AcpiLoadTables, Status);

    /*
     * Test run-time control method installation. Do it twice to test code
     * for an existing name.
     */
    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    Status = AcpiInstallMethod (MethodCode);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("%s, Could not install method\n",
            AcpiFormatException (Status));
    }

    return (AE_OK);
}