summaryrefslogtreecommitdiff
path: root/source/components/utilities/utxfinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/utilities/utxfinit.c')
-rw-r--r--source/components/utilities/utxfinit.c75
1 files changed, 54 insertions, 21 deletions
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 7502c61f0789..0efd35bda753 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -132,6 +132,25 @@ AcpiInitializeSubsystem (
return_ACPI_STATUS (Status);
}
+ if (!AcpiGbl_OverrideDefaultRegionHandlers)
+ {
+ /*
+ * Install the default operation region handlers. These are the
+ * handlers that are defined by the ACPI specification to be
+ * "always accessible" -- namely, SystemMemory, SystemIO, and
+ * PCI_Config. This also means that no _REG methods need to be
+ * run for these address spaces. We need to have these handlers
+ * installed before any AML code can be executed, especially any
+ * module-level code (11/2015).
+ */
+ Status = AcpiEvInstallRegionHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
+ return_ACPI_STATUS (Status);
+ }
+ }
+
return_ACPI_STATUS (AE_OK);
}
@@ -161,6 +180,33 @@ AcpiEnableSubsystem (
ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
+ /*
+ * The early initialization phase is complete. The namespace is loaded,
+ * and we can now support address spaces other than Memory, I/O, and
+ * PCI_Config.
+ */
+ AcpiGbl_EarlyInitialization = FALSE;
+
+ if (AcpiGbl_OverrideDefaultRegionHandlers)
+ {
+ /*
+ * Install the default operation region handlers. These are the
+ * handlers that are defined by the ACPI specification to be
+ * "always accessible" -- namely, SystemMemory, SystemIO, and
+ * PCI_Config. This also means that no _REG methods need to be
+ * run for these address spaces. We need to have these handlers
+ * installed before any AML code can be executed, especially any
+ * module-level code (11/2015).
+ */
+ Status = AcpiEvInstallRegionHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+
#if (!ACPI_REDUCED_HARDWARE)
/* Enable ACPI mode */
@@ -193,26 +239,6 @@ AcpiEnableSubsystem (
}
}
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /*
- * Install the default OpRegion handlers. These are installed unless
- * other handlers have already been installed via the
- * InstallAddressSpaceHandler interface.
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Installing default address space handlers\n"));
-
- Status = AcpiEvInstallRegionHandlers ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
/*
* Initialize ACPI Event handling (Fixed and General Purpose)
*
@@ -320,8 +346,15 @@ AcpiInitializeObjects (
* 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 AcpiNsLoadTable.
*/
- AcpiNsExecModuleCodeList ();
+ if (AcpiGbl_GroupModuleLevelCode)
+ {
+ AcpiNsExecModuleCodeList ();
+ }
/*
* Initialize the objects that remain uninitialized. This runs the