ReactOS  0.4.14-dev-1007-g90d795b
utinit.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "acevents.h"
#include "actables.h"
Include dependency graph for utinit.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_UTILITIES
 

Functions

static void AcpiUtTerminate (void)
 
static void AcpiUtFreeGpeLists (void)
 
ACPI_STATUS AcpiUtInitGlobals (void)
 
void AcpiUtSubsystemShutdown (void)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 50 of file utinit.c.

Function Documentation

◆ AcpiUtFreeGpeLists()

static void AcpiUtFreeGpeLists ( void  )
static

Definition at line 84 of file utinit.c.

86 {
87  ACPI_GPE_BLOCK_INFO *GpeBlock;
88  ACPI_GPE_BLOCK_INFO *NextGpeBlock;
89  ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
90  ACPI_GPE_XRUPT_INFO *NextGpeXruptInfo;
91 
92 
93  /* Free global GPE blocks and related info structures */
94 
95  GpeXruptInfo = AcpiGbl_GpeXruptListHead;
96  while (GpeXruptInfo)
97  {
98  GpeBlock = GpeXruptInfo->GpeBlockListHead;
99  while (GpeBlock)
100  {
101  NextGpeBlock = GpeBlock->Next;
102  ACPI_FREE (GpeBlock->EventInfo);
103  ACPI_FREE (GpeBlock->RegisterInfo);
104  ACPI_FREE (GpeBlock);
105 
106  GpeBlock = NextGpeBlock;
107  }
108  NextGpeXruptInfo = GpeXruptInfo->Next;
109  ACPI_FREE (GpeXruptInfo);
110  GpeXruptInfo = NextGpeXruptInfo;
111  }
112 }
struct acpi_gpe_block_info * Next
Definition: aclocal.h:585
#define ACPI_FREE(a)
Definition: actypes.h:386
struct acpi_gpe_xrupt_info * Next
Definition: aclocal.h:603
ACPI_GPE_BLOCK_INFO * GpeBlockListHead
Definition: aclocal.h:604
ACPI_GPE_REGISTER_INFO * RegisterInfo
Definition: aclocal.h:587
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588

Referenced by AcpiUtTerminate().

◆ AcpiUtInitGlobals()

ACPI_STATUS AcpiUtInitGlobals ( void  )

Definition at line 131 of file utinit.c.

133 {
135  UINT32 i;
136 
137 
138  ACPI_FUNCTION_TRACE (UtInitGlobals);
139 
140 
141  /* Create all memory caches */
142 
144  if (ACPI_FAILURE (Status))
145  {
147  }
148 
149  /* Address Range lists */
150 
151  for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
152  {
153  AcpiGbl_AddressRangeList[i] = NULL;
154  }
155 
156  /* Mutex locked flags */
157 
158  for (i = 0; i < ACPI_NUM_MUTEX; i++)
159  {
160  AcpiGbl_MutexInfo[i].Mutex = NULL;
161  AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
162  AcpiGbl_MutexInfo[i].UseCount = 0;
163  }
164 
165  for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
166  {
167  AcpiGbl_OwnerIdMask[i] = 0;
168  }
169 
170  /* Last OwnerID is never valid */
171 
172  AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
173 
174  /* Event counters */
175 
176  AcpiMethodCount = 0;
177  AcpiSciCount = 0;
178  AcpiGpeCount = 0;
179 
180  for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
181  {
182  AcpiFixedEventCount[i] = 0;
183  }
184 
185 #if (!ACPI_REDUCED_HARDWARE)
186 
187  /* GPE/SCI support */
188 
189  AcpiGbl_AllGpesInitialized = FALSE;
190  AcpiGbl_GpeXruptListHead = NULL;
191  AcpiGbl_GpeFadtBlocks[0] = NULL;
192  AcpiGbl_GpeFadtBlocks[1] = NULL;
193  AcpiCurrentGpeCount = 0;
194 
195  AcpiGbl_GlobalEventHandler = NULL;
196  AcpiGbl_SciHandlerList = NULL;
197 
198 #endif /* !ACPI_REDUCED_HARDWARE */
199 
200  /* Global handlers */
201 
202  AcpiGbl_GlobalNotify[0].Handler = NULL;
203  AcpiGbl_GlobalNotify[1].Handler = NULL;
204  AcpiGbl_ExceptionHandler = NULL;
205  AcpiGbl_InitHandler = NULL;
206  AcpiGbl_TableHandler = NULL;
207  AcpiGbl_InterfaceHandler = NULL;
208 
209  /* Global Lock support */
210 
211  AcpiGbl_GlobalLockSemaphore = NULL;
212  AcpiGbl_GlobalLockMutex = NULL;
213  AcpiGbl_GlobalLockAcquired = FALSE;
214  AcpiGbl_GlobalLockHandle = 0;
215  AcpiGbl_GlobalLockPresent = FALSE;
216 
217  /* Miscellaneous variables */
218 
219  AcpiGbl_DSDT = NULL;
220  AcpiGbl_CmSingleStep = FALSE;
221  AcpiGbl_Shutdown = FALSE;
222  AcpiGbl_NsLookupCount = 0;
223  AcpiGbl_PsFindCount = 0;
224  AcpiGbl_AcpiHardwarePresent = TRUE;
225  AcpiGbl_LastOwnerIdIndex = 0;
226  AcpiGbl_NextOwnerIdOffset = 0;
227  AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
228  AcpiGbl_OsiMutex = NULL;
229 
230  /* Hardware oriented */
231 
232  AcpiGbl_EventsInitialized = FALSE;
233  AcpiGbl_SystemAwakeAndRunning = TRUE;
234 
235  /* Namespace */
236 
237  AcpiGbl_RootNode = NULL;
238  AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
239  AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
240  AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
241  AcpiGbl_RootNodeStruct.Parent = NULL;
242  AcpiGbl_RootNodeStruct.Child = NULL;
243  AcpiGbl_RootNodeStruct.Peer = NULL;
244  AcpiGbl_RootNodeStruct.Object = NULL;
245 
246 
247 #ifdef ACPI_DISASSEMBLER
248  AcpiGbl_ExternalList = NULL;
249  AcpiGbl_NumExternalMethods = 0;
250  AcpiGbl_ResolvedExternalMethods = 0;
251 #endif
252 
253 #ifdef ACPI_DEBUG_OUTPUT
254  AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
255 #endif
256 
257 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
258  AcpiGbl_DisplayFinalMemStats = FALSE;
259  AcpiGbl_DisableMemTracking = FALSE;
260 #endif
261 
263 }
#define ACPI_NUM_MUTEX
Definition: aclocal.h:92
#define ACPI_MUTEX_NOT_ACQUIRED
Definition: aclocal.h:119
#define TRUE
Definition: types.h:120
#define ACPI_NUM_OWNERID_MASKS
Definition: acconfig.h:136
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ACPI_STATUS AcpiUtCreateCaches(void)
Definition: utalloc.c:104
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_ADDRESS_RANGE_MAX
Definition: acconfig.h:148
#define ACPI_ROOT_NAME
Definition: acnames.h:91
#define ACPI_NUM_FIXED_EVENTS
Definition: actypes.h:761
#define DEBUGGER_THREADING
Definition: acefi.h:52
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
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_DESC_TYPE_NAMED
Definition: acobject.h:575
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiInitializeSubsystem().

◆ AcpiUtSubsystemShutdown()

void AcpiUtSubsystemShutdown ( void  )

Definition at line 304 of file utinit.c.

306 {
307  ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
308 
309 
310  /* Just exit if subsystem is already shutdown */
311 
312  if (AcpiGbl_Shutdown)
313  {
314  ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
315  return_VOID;
316  }
317 
318  /* Subsystem appears active, go ahead and shut it down */
319 
320  AcpiGbl_Shutdown = TRUE;
321  AcpiGbl_StartupFlags = 0;
322  ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
323 
324 #ifndef ACPI_ASL_COMPILER
325 
326  /* Close the AcpiEvent Handling */
327 
328  AcpiEvTerminate ();
329 
330  /* Delete any dynamic _OSI interfaces */
331 
333 #endif
334 
335  /* Close the Namespace */
336 
337  AcpiNsTerminate ();
338 
339  /* Delete the ACPI tables */
340 
341  AcpiTbTerminate ();
342 
343  /* Close the globals */
344 
345  AcpiUtTerminate ();
346 
347  /* Purge the local caches */
348 
350  return_VOID;
351 }
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiUtDeleteCaches(void)
Definition: utalloc.c:218
void AcpiTbTerminate(void)
Definition: tbdata.c:776
ACPI_STATUS AcpiUtInterfaceTerminate(void)
Definition: utosi.c:192
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define return_VOID
Definition: acoutput.h:495
#define ACPI_DB_INFO
Definition: acoutput.h:153
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiNsTerminate(void)
Definition: nsutils.c:693
static void AcpiUtTerminate(void)
Definition: utinit.c:279
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
void AcpiEvTerminate(void)
Definition: evmisc.c:263

Referenced by AcpiTerminate().

◆ AcpiUtTerminate()

static void AcpiUtTerminate ( void  )
static

Definition at line 279 of file utinit.c.

281 {
282  ACPI_FUNCTION_TRACE (UtTerminate);
283 
286  return_VOID;
287 }
static void AcpiUtFreeGpeLists(void)
Definition: utinit.c:84
#define return_VOID
Definition: acoutput.h:495
void AcpiUtDeleteAddressLists(void)
Definition: utaddress.c:292
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480

Referenced by AcpiUtSubsystemShutdown().