aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-12-29 01:04:19 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-31 21:47:38 -0500
commit2785ce8d0da1cac9d8f78615e116cf929e9a9123 (patch)
tree8027dee7b359730e79bdfdc43edddf7441cd5c8a
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>
-rw-r--r--drivers/acpi/acpica/nsload.c17
-rw-r--r--drivers/acpi/acpica/utxfinit.c8
-rw-r--r--include/acpi/acpixf.h5
3 files changed, 29 insertions, 1 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:
149 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 149 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
150 "**** Completed Table Object Initialization\n")); 150 "**** Completed Table Object Initialization\n"));
151 151
152 /*
153 * Execute any module-level code that was detected during the table load
154 * phase. Although illegal since ACPI 2.0, there are many machines that
155 * contain this type of code. Each block of detected executable AML code
156 * outside of any control method is wrapped with a temporary control
157 * method object and placed on a global list. The methods on this list
158 * are executed below.
159 *
160 * This case executes the module-level code for each table immediately
161 * after the table has been loaded. This provides compatibility with
162 * other ACPI implementations. Optionally, the execution can be deferred
163 * until later, see acpi_initialize_objects.
164 */
165 if (!acpi_gbl_group_module_level_code) {
166 acpi_ns_exec_module_code_list();
167 }
168
152 return_ACPI_STATUS(status); 169 return_ACPI_STATUS(status);
153} 170}
154 171
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 1c7ed4986963..e38facd3e32f 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -292,8 +292,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
292 * outside of any control method is wrapped with a temporary control 292 * outside of any control method is wrapped with a temporary control
293 * method object and placed on a global list. The methods on this list 293 * method object and placed on a global list. The methods on this list
294 * are executed below. 294 * are executed below.
295 *
296 * This case executes the module-level code for all tables only after
297 * all of the tables have been loaded. It is a legacy option and is
298 * not compatible with other ACPI implementations. See acpi_ns_load_table.
295 */ 299 */
296 acpi_ns_exec_module_code_list(); 300 if (acpi_gbl_group_module_level_code) {
301 acpi_ns_exec_module_code_list();
302 }
297 303
298 /* 304 /*
299 * Initialize the objects that remain uninitialized. This runs the 305 * Initialize the objects that remain uninitialized. This runs the
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d60507b755f6..8c95e82691a5 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -190,6 +190,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
190ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); 190ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
191 191
192/* 192/*
193 * Optionally support group module level code.
194 */
195ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
196
197/*
193 * Optionally use 32-bit FADT addresses if and when there is a conflict 198 * Optionally use 32-bit FADT addresses if and when there is a conflict
194 * (address mismatch) between the 32-bit and 64-bit versions of the 199 * (address mismatch) between the 32-bit and 64-bit versions of the
195 * address. Although ACPICA adheres to the ACPI specification which 200 * address. Although ACPICA adheres to the ACPI specification which