summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/nsload.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-12-29 14:04:19 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-01 03:47:38 +0100
commit2785ce8d0da1cac9d8f78615e116cf929e9a9123 (patch)
tree8027dee7b359730e79bdfdc43edddf7441cd5c8a /drivers/acpi/acpica/nsload.c
parent2247235379d9e9fa46f725a82e0c05ae96254007 (diff)
ACPICA: Add per-table execution of module-level code
ACPICA commit 071eff738c59eda1792ac24b3b688b61691d7e7c Execute any module-level code after each ACPI table (DSDT or SSDT) is loaded into the namespace (rather than after all AML tables have been loaded). This matches the behavior of other ACPI implementations and is required to support BIOS code that depends on this behavior. Link: https://github.com/acpica/acpica/commit/071eff73 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/nsload.c')
-rw-r--r--drivers/acpi/acpica/nsload.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index c1069165625d..14c953e6fe9e 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -149,6 +149,23 @@ unlock:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"**** Completed Table Object Initialization\n"));
+ /*
+ * Execute any module-level code that was detected during the table load
+ * phase. Although illegal since ACPI 2.0, there are many machines that
+ * contain this type of code. Each block of detected executable AML code
+ * outside of any control method is wrapped with a temporary control
+ * method object and placed on a global list. The methods on this list
+ * are executed below.
+ *
+ * This case executes the module-level code for each table immediately
+ * after the table has been loaded. This provides compatibility with
+ * other ACPI implementations. Optionally, the execution can be deferred
+ * until later, see acpi_initialize_objects.
+ */
+ if (!acpi_gbl_group_module_level_code) {
+ acpi_ns_exec_module_code_list();
+ }
+
return_ACPI_STATUS(status);
}