summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsaccess.c
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2017-06-05 16:41:55 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-27 22:25:25 +0200
commita9d8ea79d7464352820973b237f1d192afc3c14c (patch)
tree3eca51537a06a88afdb9a8eca6124218e0544715 /drivers/acpi/acpica/nsaccess.c
parentbdcf4cdbdc889477cd945d487dbb31fef4977849 (diff)
downloadlinux-a9d8ea79d7464352820973b237f1d192afc3c14c.tar.bz2
ACPICA: Disassembler: allow conflicting external declarations to be emitted.
ACPICA commit 0ed9f2e2ccc112439eaa355b5952a05d6fdb7814 An external declaration is a conflicting declaration when a name has been declared as an external and a named object within the same file. Link: https://github.com/acpica/acpica/commit/0ed9f2e2 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>
Diffstat (limited to 'drivers/acpi/acpica/nsaccess.c')
-rw-r--r--drivers/acpi/acpica/nsaccess.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index fb265b5737de..e5f4fa496572 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -47,6 +47,10 @@
#include "acnamesp.h"
#include "acdispat.h"
+#ifdef ACPI_ASL_COMPILER
+#include "acdisasm.h"
+#endif
+
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsaccess")
@@ -580,6 +584,29 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
(char *)&current_node->name,
current_node));
}
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * If this ACPI name already exists within the namespace as an
+ * external declaration, then mark the external as a conflicting
+ * declaration and proceed to process the current node as if it did
+ * not exist in the namespace. If this node is not processed as
+ * normal, then it could cause improper namespace resolution
+ * by failing to open a new scope.
+ */
+ if (acpi_gbl_disasm_flag &&
+ (status == AE_ALREADY_EXISTS) &&
+ ((this_node->flags & ANOBJ_IS_EXTERNAL) ||
+ (walk_state
+ && walk_state->opcode == AML_EXTERNAL_OP))) {
+ this_node->flags &= ~ANOBJ_IS_EXTERNAL;
+ this_node->type = (u8)this_search_type;
+ if (walk_state->opcode != AML_EXTERNAL_OP) {
+ acpi_dm_mark_external_conflict
+ (this_node);
+ }
+ break;
+ }
+#endif
*return_node = this_node;
return_ACPI_STATUS(status);