--- zzzz-none-000/linux-5.15.111/drivers/acpi/acpica/nsparse.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/drivers/acpi/acpica/nsparse.c 2024-02-07 10:22:36.000000000 +0000 @@ -253,6 +253,38 @@ ACPI_FUNCTION_TRACE(ns_parse_table); +#ifdef CONFIG_ACPI_MXL_LEGACY_BIOS_SUPPORT + /* + * 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 = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, + table_index, start_node); + 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 = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, + table_index, start_node); +#else /* * Executes the AML table as one large control method. * The point of this is to execute any module-level code in-place @@ -266,6 +298,7 @@ ACPI_GET_FUNCTION_NAME)); status = acpi_ns_execute_table(table_index, start_node); +#endif //CONFIG_ACPI_MXL_LEGACY_BIOS_SUPPORT return_ACPI_STATUS(status); }