From f5d7e5f42131cdc3fa9a665e4b579f9554169409 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Tue, 27 Feb 2018 13:16:12 -0800 Subject: [PATCH] Change a compile-time option to a runtime option Changes the option to ignore package resolution errors into a runtime option. --- source/components/dispatcher/dspkginit.c | 33 ++++++++++++------------ source/include/acpixf.h | 10 +++++++ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/source/components/dispatcher/dspkginit.c b/source/components/dispatcher/dspkginit.c index a034df0db..9e1cd6115 100644 --- a/source/components/dispatcher/dspkginit.c +++ b/source/components/dispatcher/dspkginit.c @@ -546,34 +546,33 @@ AcpiDsResolvePackageElement ( ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */ - Status = AcpiNsLookup (&ScopeInfo, - (char *) Element->Reference.Aml, /* Pointer to AML path */ + Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &ResolvedNode); if (ACPI_FAILURE (Status)) { -#if defined ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS && !defined ACPI_APPLICATION - /* - * For the kernel-resident ACPICA, optionally be silent about the - * NOT_FOUND case. Although this is potentially a serious problem, - * it can generate a lot of noise/errors on platforms whose - * firmware carries around a bunch of unused Package objects. - * To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS - * in the OS-specific header. - * - * All errors are always reported for ACPICA applications such as - * AcpiExec. - */ - if (Status == AE_NOT_FOUND) + if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors) { - /* Reference name not found, set the element to NULL */ + /* + * Optionally be silent about the NOT_FOUND case for the referenced + * name. Although this is potentially a serious problem, + * it can generate a lot of noise/errors on platforms whose + * firmware carries around a bunch of unused Package objects. + * To disable these errors, set this global to TRUE: + * AcpiGbl_IgnorePackageResolutionErrors + * + * If the AML actually tries to use such a package, the unresolved + * element(s) will be replaced with NULL elements. + */ + + /* Referenced name not found, set the element to NULL */ AcpiUtRemoveReference (*ElementPtr); *ElementPtr = NULL; return_VOID; } -#endif + Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX, (char *) Element->Reference.Aml, NULL, &ExternalPath); diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 2f0ac5647..477f0c7d4 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -380,6 +380,16 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE); */ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT); +/* + * Optionally ignore AE_NOT_FOUND errors from named reference package elements + * during DSDT/SSDT table loading. This reduces error "noise" in platforms + * whose firmware is carrying around a bunch of unused package objects that + * refer to non-existent named objects. However, If the AML actually tries to + * use such a package, the unresolved element(s) will be replaced with NULL + * elements. + */ +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnorePackageResolutionErrors, FALSE); + /* * This mechanism is used to trace a specified AML method. The method is * traced each time it is executed.