summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/dswload.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-01-27 10:56:49 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-01-27 10:56:49 +0100
commitff7a672f83b355365478a1fdfb60933ef34d8d02 (patch)
tree567cc291244e8922502072962e90ff820d82a0a2 /drivers/acpi/acpica/dswload.c
parentcea79e7e2f24125b895bbfcdf98c8cfd1fb684d1 (diff)
parentbe91c44288bea4d48d64604e9073801383776623 (diff)
Merge branch 'acpica'
* acpica: ACPICA: Update version to 20200110 ACPICA: All acpica: Update copyrights to 2020 Including tool signons. ACPICA: Update the list of maintainers ACPICA: Update version to 20191213 ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator ACPICA: acpisrc: add unix line ending support for non-windows build ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1 ACPICA: debugger: fix spelling mistake "adress" -> "address"
Diffstat (limited to 'drivers/acpi/acpica/dswload.c')
-rw-r--r--drivers/acpi/acpica/dswload.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index c88fd31208a5..697974e37edf 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -3,7 +3,7 @@
*
* Module Name: dswload - Dispatcher first pass namespace load callbacks
*
- * Copyright (C) 2000 - 2019, Intel Corp.
+ * Copyright (C) 2000 - 2020, Intel Corp.
*
*****************************************************************************/
@@ -410,6 +410,27 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op,
walk_state));
+ /*
+ * Disassembler: handle create field operators here.
+ *
+ * create_buffer_field 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 ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) &&
+ (walk_state->op_info->flags & AML_CREATE)) {
+ status = acpi_ds_create_buffer_field(op, walk_state);
+ return_ACPI_STATUS(status);
+ }
+
/* We are only interested in opcodes that have an associated name */
if (!(walk_state->op_info->flags & (AML_NAMED | AML_FIELD))) {