ReactOS  0.4.13-dev-73-gcfe54aa
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  */
233  if (!(Flags & ACPI_NO_HANDLER_INIT))
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_NO_FACS_INIT
Definition: actypes.h:595
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem(UINT32 Flags)
Definition: utxfinit.c:155
ACPI_STATUS AcpiEvInitializeEvents(void)
Definition: evevent.c:77
ACPI_STATUS AcpiEvInstallXruptHandlers(void)
Definition: evevent.c:131
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_NO_HANDLER_INIT
Definition: actypes.h:599
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_NO_ACPI_ENABLE
Definition: actypes.h:596
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_NO_EVENT_INIT
Definition: actypes.h:598
Status
Definition: gdiplustypes.h:24
#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
ACPI_STATUS AcpiEnable(void)
Definition: evxfevnt.c:68
ACPI_STATUS AcpiTbInitializeFacs(void)
Definition: tbutils.c:75
UINT32 AcpiHwGetMode(void)
Definition: hwacpi.c:179
#define AE_OK
Definition: acexcep.h:97

Referenced by acpi_bus_init().

◆ AcpiInitializeObjects()

ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects ( UINT32  Flags)

Definition at line 267 of file utxfinit.c.

269 {
271 
272 
274 
275 
276  /*
277  * This case handles the legacy option that groups all module-level
278  * code blocks together and defers execution until all of the tables
279  * are loaded. Execute all of these blocks at this time.
280  * Execute any module-level code that was detected during the table
281  * load phase.
282  *
283  * Note: this option is deprecated and will be eliminated in the
284  * future. Use of this option can cause problems with AML code that
285  * depends upon in-order immediate execution of module-level code.
286  */
288 
289  /*
290  * Initialize the objects that remain uninitialized. This
291  * runs the executable AML that may be part of the
292  * declaration of these objects:
293  * OperationRegions, BufferFields, Buffers, and Packages.
294  */
295  if (!(Flags & ACPI_NO_OBJECT_INIT))
296  {
298  if (ACPI_FAILURE (Status))
299  {
301  }
302  }
303 
304  /*
305  * Initialize all device/region objects in the namespace. This runs
306  * the device _STA and _INI methods and region _REG methods.
307  */
309  {
311  if (ACPI_FAILURE (Status))
312  {
314  }
315  }
316 
317  /*
318  * Empty the caches (delete the cached objects) on the assumption that
319  * the table load filled them up more than they will be at runtime --
320  * thus wasting non-paged memory.
321  */
323 
324  AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
326 }
ACPI_STATUS AcpiPurgeCachedObjects(void)
Definition: utxface.c:302
ACPI_STATUS AcpiNsInitializeObjects(void)
Definition: nsinit.c:92
ACPI_STATUS AcpiNsInitializeDevices(UINT32 Flags)
Definition: nsinit.c:156
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_NO_DEVICE_INIT
Definition: actypes.h:601
void AcpiNsExecModuleCodeList(void)
Definition: nseval.c:387
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects(UINT32 Flags)
Definition: utxfinit.c:267
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_NO_ADDRESS_SPACE_INIT
Definition: actypes.h:602
#define ACPI_INITIALIZED_OK
Definition: actypes.h:608
#define ACPI_NO_OBJECT_INIT
Definition: actypes.h:600
#define AE_OK
Definition: acexcep.h:97

Referenced by acpi_bus_init().

◆ 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 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem(void)
Definition: utxfinit.c:76
#define ACPI_DEBUG_EXEC(a)
Definition: acoutput.h:477
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtInitializeInterfaces(void)
Definition: utosi.c:147
#define AE_INFO
Definition: acoutput.h:230
ACPI_STATUS AcpiOsInitialize(void)
Definition: osl.c:21
ACPI_STATUS AcpiUtInitGlobals(void)
Definition: utinit.c:131
#define ACPI_SUBSYSTEM_INITIALIZE
Definition: actypes.h:607
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiUtInitStackPtrTrace(void)
ACPI_STATUS AcpiNsRootInitialize(void)
Definition: nsaccess.c:73
ACPI_STATUS AcpiUtMutexInitialize(void)
Definition: utmutex.c:75
#define AE_OK
Definition: acexcep.h:97

Referenced by Bus_StartFdo().

◆ AeDoObjectOverrides()

void AeDoObjectOverrides ( void  )