Blob Blame History Raw
From: Erik Schmauss <erik.schmauss@intel.com>
Date: Mon, 10 Jul 2017 15:23:02 +0800
Subject: ACPICA: iASL compiler: allow compilation of externals with paths that
 refer to existing names
Patch-mainline: v4.14-rc1
Git-commit: 3ddd3f6a94108a5d2abfaa2a2f809b1520361e5e
References: bsc#1117419

ACPICA commit 9a252114197409290813bee570e9d53c22b99d32

This change allows compilation of code like the following:

definition_block (...)
{
    External (ABCD.EFGH)
    Device (ABCD)
    {
        Name (IJLK,0)
    }
}

but does not allow compilation of code like the following:

definition_block (...)
{
    External (ABCD)
    Device (ABCD)
    {
        Name (EFGH,0)
    }
}

Link: https://github.com/acpica/acpica/commit/9a252114
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/acpi/acpica/aclocal.h  |    1 +
 drivers/acpi/acpica/nsaccess.c |    6 ++++++
 2 files changed, 7 insertions(+)

--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -199,6 +199,7 @@ struct acpi_namespace_node {
 #define ANOBJ_EVALUATED                 0x20	/* Set on first evaluation of node */
 #define ANOBJ_ALLOCATED_BUFFER          0x40	/* Method AML buffer is dynamic (install_method) */
 
+#define IMPLICIT_EXTERNAL               0x02	/* iASL only: This object created implicitly via External */
 #define ANOBJ_IS_EXTERNAL               0x08	/* iASL only: This object created via External() */
 #define ANOBJ_METHOD_NO_RETVAL          0x10	/* iASL only: Method has no return value */
 #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* iASL only: Method has at least one return value */
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -634,6 +634,12 @@ acpi_ns_lookup(union acpi_generic_state
 					    this_node->object;
 				}
 			}
+#ifdef ACPI_ASL_COMPILER
+			if (!acpi_gbl_disasm_flag &&
+			    (this_node->flags & ANOBJ_IS_EXTERNAL)) {
+				this_node->flags |= IMPLICIT_EXTERNAL;
+			}
+#endif
 		}
 
 		/* Special handling for the last segment (num_segments == 0) */