Пример #1
0
ACPI_STATUS
AcpiNsParseTable (
    UINT32                  TableIndex,
    ACPI_NAMESPACE_NODE     *StartNode)
{
    ACPI_STATUS             Status;


    ACPI_FUNCTION_TRACE (NsParseTable);


    /*
     * Executes the AML table as one large control method.
     * The point of this is to execute any module-level code in-place
     * as the table is parsed. Some AML code depends on this behavior.
     *
     * Note: This causes the table to only have a single-pass parse.
     * However, this is compatible with other ACPI implementations.
     */
    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
        "%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME));

    Status = AcpiNsExecuteTable (TableIndex, StartNode);

    return_ACPI_STATUS (Status);
}
Пример #2
0
ACPI_STATUS
AcpiNsParseTable (
    UINT32                  TableIndex,
    ACPI_NAMESPACE_NODE     *StartNode)
{
    ACPI_STATUS             Status;


    ACPI_FUNCTION_TRACE (NsParseTable);


    if (AcpiGbl_ExecuteTablesAsMethods)
    {
        /*
         * This case executes the AML table as one large control method.
         * The point of this is to execute any module-level code in-place
         * as the table is parsed. Some AML code depends on this behavior.
         *
         * It is a run-time option at this time, but will eventually become
         * the default.
         *
         * Note: This causes the table to only have a single-pass parse.
         * However, this is compatible with other ACPI implementations.
         */
        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
            "%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME));

        Status = AcpiNsExecuteTable (TableIndex, StartNode);
        if (ACPI_FAILURE (Status))
        {
            return_ACPI_STATUS (Status);
        }
    }
    else
    {
        /*
         * AML Parse, pass 1
         *
         * In this pass, we load most of the namespace. Control methods
         * are not parsed until later. A parse tree is not created.
         * Instead, each Parser Op subtree is deleted when it is finished.
         * This saves a great deal of memory, and allows a small cache of
         * parse objects to service the entire parse. The second pass of
         * the parse then performs another complete parse of the AML.
         */
        ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));

        Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
            TableIndex, StartNode);
        if (ACPI_FAILURE (Status))
        {
            return_ACPI_STATUS (Status);
        }

        /*
         * AML Parse, pass 2
         *
         * In this pass, we resolve forward references and other things
         * that could not be completed during the first pass.
         * Another complete parse of the AML is performed, but the
         * overhead of this is compensated for by the fact that the
         * parse objects are all cached.
         */
        ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
        Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2,
            TableIndex, StartNode);
        if (ACPI_FAILURE (Status))
        {
            return_ACPI_STATUS (Status);
        }
    }

    return_ACPI_STATUS (Status);
}