ReactOS 0.4.16-dev-329-g9223134
utxfinit.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "acdebug.h"
#include "actables.h"
Include dependency graph for utxfinit.c:

Go to the source code of this file.

Macros

#define EXPORT_ACPI_INTERFACES
 
#define _COMPONENT   ACPI_UTILITIES
 

Functions

void AeDoObjectOverrides (void)
 
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem (void)
 
ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem (UINT32 Flags)
 
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects (UINT32 Flags)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 53 of file utxfinit.c.

◆ EXPORT_ACPI_INTERFACES

#define EXPORT_ACPI_INTERFACES

Definition at line 44 of file utxfinit.c.

Function Documentation

◆ AcpiEnableSubsystem()

ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem ( UINT32  Flags)

Definition at line 155 of file utxfinit.c.

157{
159
160
162
163
164 /*
165 * The early initialization phase is complete. The namespace is loaded,
166 * and we can now support address spaces other than Memory, I/O, and
167 * PCI_Config.
168 */
169 AcpiGbl_EarlyInitialization = FALSE;
170
171#if (!ACPI_REDUCED_HARDWARE)
172
173 /* Enable ACPI mode */
174
175 if (!(Flags & ACPI_NO_ACPI_ENABLE))
176 {
177 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
178
179 AcpiGbl_OriginalMode = AcpiHwGetMode();
180
181 Status = AcpiEnable ();
182 if (ACPI_FAILURE (Status))
183 {
184 ACPI_WARNING ((AE_INFO, "AcpiEnable failed"));
186 }
187 }
188
189 /*
190 * Obtain a permanent mapping for the FACS. This is required for the
191 * Global Lock and the Firmware Waking Vector
192 */
193 if (!(Flags & ACPI_NO_FACS_INIT))
194 {
196 if (ACPI_FAILURE (Status))
197 {
198 ACPI_WARNING ((AE_INFO, "Could not map the FACS table"));
200 }
201 }
202
203 /*
204 * Initialize ACPI Event handling (Fixed and General Purpose)
205 *
206 * Note1: We must have the hardware and events initialized before we can
207 * execute any control methods safely. Any control method can require
208 * ACPI hardware support, so the hardware must be fully initialized before
209 * any method execution!
210 *
211 * Note2: Fixed events are initialized and enabled here. GPEs are
212 * initialized, but cannot be enabled until after the hardware is
213 * completely initialized (SCI and GlobalLock activated) and the various
214 * initialization control methods are run (_REG, _STA, _INI) on the
215 * entire namespace.
216 */
217 if (!(Flags & ACPI_NO_EVENT_INIT))
218 {
220 "[Init] Initializing ACPI events\n"));
221
223 if (ACPI_FAILURE (Status))
224 {
226 }
227 }
228
229 /*
230 * Install the SCI handler and Global Lock handler. This completes the
231 * hardware initialization.
232 */
234 {
236 "[Init] Installing SCI/GL handlers\n"));
237
239 if (ACPI_FAILURE (Status))
240 {
242 }
243 }
244
245#endif /* !ACPI_REDUCED_HARDWARE */
246
248}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_OK
Definition: acexcep.h:97
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define ACPI_DB_EXEC
Definition: acoutput.h:165
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define AE_INFO
Definition: acoutput.h:230
ACPI_STATUS AcpiTbInitializeFacs(void)
Definition: tbutils.c:75
#define ACPI_NO_EVENT_INIT
Definition: actypes.h:607
#define ACPI_NO_ACPI_ENABLE
Definition: actypes.h:605
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_NO_FACS_INIT
Definition: actypes.h:604
#define ACPI_NO_HANDLER_INIT
Definition: actypes.h:608
#define FALSE
Definition: types.h:117
UINT32 AcpiHwGetMode(void)
Definition: hwacpi.c:179
ACPI_STATUS AcpiEvInitializeEvents(void)
Definition: evevent.c:77
ACPI_STATUS AcpiEvInstallXruptHandlers(void)
Definition: evevent.c:131
ACPI_STATUS AcpiEnable(void)
Definition: evxfevnt.c:68
Status
Definition: gdiplustypes.h:25
ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem(UINT32 Flags)
Definition: utxfinit.c:155
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by acpi_bus_init(), and AcpiEnableSubsystem().

◆ AcpiInitializeObjects()

ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects ( UINT32  Flags)

Definition at line 267 of file utxfinit.c.

269{
271
272
274
275
276#ifdef ACPI_OBSOLETE_BEHAVIOR
277 /*
278 * 05/2019: Removed, initialization now happens at both object
279 * creation and table load time
280 */
281
282 /*
283 * Initialize the objects that remain uninitialized. This
284 * runs the executable AML that may be part of the
285 * declaration of these objects: OperationRegions, BufferFields,
286 * BankFields, Buffers, and Packages.
287 */
288 if (!(Flags & ACPI_NO_OBJECT_INIT))
289 {
291 if (ACPI_FAILURE (Status))
292 {
294 }
295 }
296#endif
297
298 /*
299 * Initialize all device/region objects in the namespace. This runs
300 * the device _STA and _INI methods and region _REG methods.
301 */
303 {
305 if (ACPI_FAILURE (Status))
306 {
308 }
309 }
310
311 /*
312 * Empty the caches (delete the cached objects) on the assumption that
313 * the table load filled them up more than they will be at runtime --
314 * thus wasting non-paged memory.
315 */
317
318 AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
320}
ACPI_STATUS AcpiNsInitializeDevices(UINT32 Flags)
Definition: nsinit.c:157
ACPI_STATUS AcpiNsInitializeObjects(void)
Definition: nsinit.c:92
#define ACPI_NO_OBJECT_INIT
Definition: actypes.h:609
#define ACPI_NO_ADDRESS_SPACE_INIT
Definition: actypes.h:611
#define ACPI_NO_DEVICE_INIT
Definition: actypes.h:610
#define ACPI_INITIALIZED_OK
Definition: actypes.h:617
ACPI_STATUS AcpiPurgeCachedObjects(void)
Definition: utxface.c:302
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects(UINT32 Flags)
Definition: utxfinit.c:267

Referenced by acpi_bus_init(), and AcpiInitializeObjects().

◆ AcpiInitializeSubsystem()

ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem ( void  )

Definition at line 76 of file utxfinit.c.

78{
80
81
83
84
85 AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE;
87
88 /* Initialize the OS-Dependent layer */
89
91 if (ACPI_FAILURE (Status))
92 {
93 ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization"));
95 }
96
97 /* Initialize all globals used by the subsystem */
98
100 if (ACPI_FAILURE (Status))
101 {
102 ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals"));
104 }
105
106 /* Create the default mutex objects */
107
109 if (ACPI_FAILURE (Status))
110 {
111 ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation"));
113 }
114
115 /*
116 * Initialize the namespace manager and
117 * the root of the namespace tree
118 */
120 if (ACPI_FAILURE (Status))
121 {
122 ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization"));
124 }
125
126 /* Initialize the global OSI interfaces list with the static names */
127
129 if (ACPI_FAILURE (Status))
130 {
131 ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
133 }
134
136}
ACPI_STATUS AcpiNsRootInitialize(void)
Definition: nsaccess.c:73
#define ACPI_DEBUG_EXEC(a)
Definition: acoutput.h:477
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
ACPI_STATUS AcpiOsInitialize(void)
Definition: osl.c:21
#define ACPI_SUBSYSTEM_INITIALIZE
Definition: actypes.h:616
ACPI_STATUS AcpiUtInitializeInterfaces(void)
Definition: utosi.c:150
ACPI_STATUS AcpiUtMutexInitialize(void)
Definition: utmutex.c:75
void AcpiUtInitStackPtrTrace(void)
ACPI_STATUS AcpiUtInitGlobals(void)
Definition: utinit.c:131
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem(void)
Definition: utxfinit.c:76

Referenced by AcpiInitializeSubsystem(), and Bus_StartFdo().

◆ AeDoObjectOverrides()

void AeDoObjectOverrides ( void  )