From 2ce2407975c39f9560ca07a87b0f2f43c51d14ed Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 12 Jul 2012 13:58:26 -0700 Subject: [PATCH] Enable Scope change to root during module-level code execution. Allows constructs like this: If (XXXX) Scope (\) ... --- source/components/dispatcher/dswload.c | 14 ++++++++++++++ source/components/dispatcher/dswload2.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c index 1f689d673..7a4a84f11 100644 --- a/source/components/dispatcher/dswload.c +++ b/source/components/dispatcher/dswload.c @@ -313,6 +313,20 @@ AcpiDsLoad1BeginOp ( WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; break; + case ACPI_TYPE_METHOD: + + /* + * Allow scope change to root during execution of module-level + * code. Root is typed METHOD during this time. + */ + if ((Node == AcpiGbl_RootNode) && + (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) + { + break; + } + + /*lint -fallthrough */ + default: /* All other types are an error */ diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c index 85a86ec1b..139ff95c4 100644 --- a/source/components/dispatcher/dswload2.c +++ b/source/components/dispatcher/dswload2.c @@ -315,6 +315,20 @@ AcpiDsLoad2BeginOp ( WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; break; + case ACPI_TYPE_METHOD: + + /* + * Allow scope change to root during execution of module-level + * code. Root is typed METHOD during this time. + */ + if ((Node == AcpiGbl_RootNode) && + (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) + { + break; + } + + /*lint -fallthrough */ + default: /* All other types are an error */