summaryrefslogtreecommitdiff
path: root/source/components/utilities
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-12-18 18:35:46 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-12-18 18:35:46 +0000
commit1c6f3e7bf6ed0a9ff1bd466e319cdf456e6e91dc (patch)
tree9ffecbf2e9ce4e63aac5515363a488b761a02b03 /source/components/utilities
parentb9098066cd6284319bca922f13e59517f774a103 (diff)
Notes
Diffstat (limited to 'source/components/utilities')
-rw-r--r--source/components/utilities/utinit.c1
-rw-r--r--source/components/utilities/utstring.c9
-rw-r--r--source/components/utilities/utxfinit.c75
3 files changed, 63 insertions, 22 deletions
diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c
index 9689abb435164..2c7061678d35c 100644
--- a/source/components/utilities/utinit.c
+++ b/source/components/utilities/utinit.c
@@ -226,7 +226,6 @@ AcpiUtInitGlobals (
AcpiGbl_NextOwnerIdOffset = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_OsiMutex = NULL;
- AcpiGbl_RegMethodsExecuted = FALSE;
AcpiGbl_MaxLoopIterations = 0xFFFF;
/* Hardware oriented */
diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c
index c8b41f10ad78f..5c761b785b14f 100644
--- a/source/components/utilities/utstring.c
+++ b/source/components/utilities/utstring.c
@@ -271,6 +271,15 @@ AcpiUtRepairName (
ACPI_FUNCTION_NAME (UtRepairName);
+ /*
+ * Special case for the root node. This can happen if we get an
+ * error during the execution of module-level code.
+ */
+ if (ACPI_COMPARE_NAME (Name, "\\___"))
+ {
+ return;
+ }
+
ACPI_MOVE_NAME (&OriginalName, Name);
/* Check each character in the name */
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 7502c61f07890..0efd35bda753c 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