aboutsummaryrefslogtreecommitdiff
path: root/source/components/dispatcher/dswload.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2019-12-13 16:51:08 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2019-12-13 16:51:08 +0000
commit856462eaaec9052a60d62b66076257e7fad337c7 (patch)
treef331b79154052fd6dc5f70c176975966370af8d9 /source/components/dispatcher/dswload.c
parent858f47305dae045d81f39451ade697ba99b3266f (diff)
downloadsrc-vendor/acpica/20191213.tar.gz
src-vendor/acpica/20191213.zip
Import ACPICA 20191213.vendor/acpica/20191213
Diffstat (limited to 'source/components/dispatcher/dswload.c')
-rw-r--r--source/components/dispatcher/dswload.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c
index b55794281798..fa6b80e9a7a4 100644
--- a/source/components/dispatcher/dswload.c
+++ b/source/components/dispatcher/dswload.c
@@ -567,6 +567,28 @@ AcpiDsLoad1EndOp (
Op = WalkState->Op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
+ /*
+ * Disassembler: handle create field operators here.
+ *
+ * CreateBufferField is a deferred op that is typically processed in load
+ * pass 2. However, disassembly of control method contents walk the parse
+ * tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed
+ * in a later walk. This is a problem when there is a control method that
+ * has the same name as the AML_CREATE object. In this case, any use of the
+ * name segment will be detected as a method call rather than a reference
+ * to a buffer field.
+ *
+ * This earlier creation during disassembly solves this issue by inserting
+ * the named object in the ACPI namespace so that references to this name
+ * would be a name string rather than a method call.
+ */
+ if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) &&
+ (WalkState->OpInfo->Flags & AML_CREATE))
+ {
+ Status = AcpiDsCreateBufferField (Op, WalkState);
+ return_ACPI_STATUS (Status);
+ }
+
/* We are only interested in opcodes that have an associated name */
if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD)))