diff options
Diffstat (limited to 'sys/contrib/dev/acpica/utxface.c')
-rw-r--r-- | sys/contrib/dev/acpica/utxface.c | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/sys/contrib/dev/acpica/utxface.c b/sys/contrib/dev/acpica/utxface.c index 6a99631..e0d8500 100644 --- a/sys/contrib/dev/acpica/utxface.c +++ b/sys/contrib/dev/acpica/utxface.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utxface - External interfaces for "global" ACPI functions - * $Revision: 101 $ + * $Revision: 104 $ * *****************************************************************************/ @@ -223,24 +223,8 @@ AcpiEnableSubsystem ( /* - * 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 = AcpiEvInitAddressSpaces (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* * We must initialize the hardware before we can enable ACPI. - * FADT values are validated here. + * The values from the FADT are validated here. */ if (!(Flags & ACPI_NO_HARDWARE_INIT)) { @@ -254,7 +238,7 @@ AcpiEnableSubsystem ( } /* - * Enable ACPI on this platform + * Enable ACPI mode */ if (!(Flags & ACPI_NO_ACPI_ENABLE)) { @@ -271,8 +255,9 @@ AcpiEnableSubsystem ( } /* - * Note: - * We must have the hardware AND events initialized before we can execute + * Initialize ACPI Event handling + * + * NOTE: We must have the hardware AND events initialized before we can execute * ANY control methods SAFELY. Any control method can require ACPI hardware * support, so the hardware MUST be initialized before execution! */ @@ -287,7 +272,7 @@ AcpiEnableSubsystem ( } } - /* Install SCI handler, Global Lock handler, GPE handlers */ + /* Install the SCI handler, Global Lock handler, and GPE handlers */ if (!(Flags & ACPI_NO_HANDLER_INIT)) { @@ -325,15 +310,21 @@ AcpiInitializeObjects ( ACPI_FUNCTION_TRACE ("AcpiInitializeObjects"); + /* - * Initialize all device objects in the namespace - * This runs the _STA and _INI methods. + * Install the default OpRegion handlers. These are installed unless + * other handlers have already been installed via the + * InstallAddressSpaceHandler interface. + * + * NOTE: This will cause _REG methods to be run. Any objects accessed + * by the _REG methods will be automatically initialized, even if they + * contain executable AML (see call to AcpiNsInitializeObjects below). */ - if (!(Flags & ACPI_NO_DEVICE_INIT)) + if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n")); - Status = AcpiNsInitializeDevices (); + Status = AcpiEvInitAddressSpaces (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -342,8 +333,8 @@ AcpiInitializeObjects ( /* * Initialize the objects that remain uninitialized. This - * runs the executable AML that is part of the declaration of OpRegions - * and Fields. + * runs the executable AML that may be part of the declaration of these + * objects: OperationRegions, BufferFields, Buffers, and Packages. */ if (!(Flags & ACPI_NO_OBJECT_INIT)) { @@ -357,6 +348,21 @@ AcpiInitializeObjects ( } /* + * Initialize all device objects in the namespace + * This runs the _STA and _INI methods. + */ + if (!(Flags & ACPI_NO_DEVICE_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n")); + + Status = AcpiNsInitializeDevices (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* * Empty the caches (delete the cached objects) on the assumption that * the table load filled them up more than they will be at runtime -- * thus wasting non-paged memory. @@ -530,10 +536,10 @@ AcpiGetSystemInfo ( /* Current status of the ACPI tables, per table type */ - InfoPtr->NumTableTypes = NUM_ACPI_TABLES; - for (i = 0; i < NUM_ACPI_TABLES; i++) + InfoPtr->NumTableTypes = NUM_ACPI_TABLE_TYPES; + for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) { - InfoPtr->TableInfo[i].Count = AcpiGbl_AcpiTables[i].Count; + InfoPtr->TableInfo[i].Count = AcpiGbl_TableLists[i].Count; } return_ACPI_STATUS (AE_OK); |