ACPICA: Add per-table execution of module-level code
authorBob Moore <robert.moore@intel.com>
Tue, 29 Dec 2015 06:04:19 +0000 (14:04 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Jan 2016 02:47:38 +0000 (03:47 +0100)
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>
drivers/acpi/acpica/nsload.c
drivers/acpi/acpica/utxfinit.c
include/acpi/acpixf.h

index c1069165625d0f5be2031952e36d8aaa9de836ec..14c953e6fe9e27e279a891383d7146c098c854b3 100644 (file)
@@ -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);
 }
 
index 1c7ed4986963d999a2d9957ec9e99cbb9fd89792..e38facd3e32f51902683354aec9266fe61f1f9f2 100644 (file)
@@ -292,8 +292,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
         * 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 all tables only after
+        * all of the tables have been loaded. It is a legacy option and is
+        * not compatible with other ACPI implementations. See acpi_ns_load_table.
         */
-       acpi_ns_exec_module_code_list();
+       if (acpi_gbl_group_module_level_code) {
+               acpi_ns_exec_module_code_list();
+       }
 
        /*
         * Initialize the objects that remain uninitialized. This runs the
index d60507b755f6dc692fde4aa534c90f5d54486705..8c95e82691a5a326b0d2d58609c7f0e251975a80 100644 (file)
@@ -189,6 +189,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
  */
 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
 
+/*
+ * Optionally support group module level code.
+ */
+ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
+
 /*
  * Optionally use 32-bit FADT addresses if and when there is a conflict
  * (address mismatch) between the 32-bit and 64-bit versions of the
This page took 0.029062 seconds and 5 git commands to generate.