ReactOS 0.4.16-dev-237-gd6eebaa
utstate.c File Reference
#include "acpi.h"
#include "accommon.h"
Include dependency graph for utstate.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_UTILITIES
 

Functions

void AcpiUtPushGenericState (ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State)
 
ACPI_GENERIC_STATEAcpiUtPopGenericState (ACPI_GENERIC_STATE **ListHead)
 
ACPI_GENERIC_STATEAcpiUtCreateGenericState (void)
 
ACPI_THREAD_STATEAcpiUtCreateThreadState (void)
 
ACPI_GENERIC_STATEAcpiUtCreateUpdateState (ACPI_OPERAND_OBJECT *Object, UINT16 Action)
 
ACPI_GENERIC_STATEAcpiUtCreatePkgState (void *InternalObject, void *ExternalObject, UINT32 Index)
 
ACPI_GENERIC_STATEAcpiUtCreateControlState (void)
 
void AcpiUtDeleteGenericState (ACPI_GENERIC_STATE *State)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 47 of file utstate.c.

Function Documentation

◆ AcpiUtCreateControlState()

ACPI_GENERIC_STATE * AcpiUtCreateControlState ( void  )

Definition at line 300 of file utstate.c.

302{
304
305
307
308
309 /* Create the generic state object */
310
312 if (!State)
313 {
314 return (NULL);
315 }
316
317 /* Init fields specific to the control struct */
318
319 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL;
321
322 return (State);
323}
#define ACPI_CONTROL_CONDITIONAL_EXECUTING
Definition: aclocal.h:670
#define ACPI_DESC_TYPE_STATE_CONTROL
Definition: acobject.h:567
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
#define NULL
Definition: types.h:112
State(char *beg, char *end)
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130

Referenced by AcpiDsExecBeginControlOp().

◆ AcpiUtCreateGenericState()

ACPI_GENERIC_STATE * AcpiUtCreateGenericState ( void  )

Definition at line 130 of file utstate.c.

132{
134
135
137
138
139 State = AcpiOsAcquireObject (AcpiGbl_StateCache);
140 if (State)
141 {
142 /* Initialize */
143 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE;
144 }
145
146 return (State);
147}
#define ACPI_DESC_TYPE_STATE
Definition: acobject.h:564
void * AcpiOsAcquireObject(ACPI_CACHE_T *Cache)

Referenced by AcpiDsResultStackPush(), AcpiDsScopeStackPush(), AcpiEvQueueNotifyRequest(), AcpiPsInitScope(), AcpiPsPushScope(), AcpiUtCreateControlState(), AcpiUtCreatePkgState(), AcpiUtCreateThreadState(), and AcpiUtCreateUpdateState().

◆ AcpiUtCreatePkgState()

ACPI_GENERIC_STATE * AcpiUtCreatePkgState ( void InternalObject,
void ExternalObject,
UINT32  Index 
)

Definition at line 255 of file utstate.c.

259{
261
262
264
265
266 /* Create the generic state object */
267
269 if (!State)
270 {
271 return (NULL);
272 }
273
274 /* Init fields specific to the update struct */
275
276 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PACKAGE;
277 State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject;
278 State->Pkg.DestObject = ExternalObject;
279 State->Pkg.Index= Index;
280 State->Pkg.NumPackages = 1;
281
282 return (State);
283}
#define ACPI_DESC_TYPE_STATE_PACKAGE
Definition: acobject.h:566
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by AcpiUtWalkPackageTree().

◆ AcpiUtCreateThreadState()

ACPI_THREAD_STATE * AcpiUtCreateThreadState ( void  )

Definition at line 164 of file utstate.c.

166{
168
169
171
172
173 /* Create the generic state object */
174
176 if (!State)
177 {
178 return (NULL);
179 }
180
181 /* Init fields specific to the update struct */
182
183 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_THREAD;
184 State->Thread.ThreadId = AcpiOsGetThreadId ();
185
186 /* Check for invalid thread ID - zero is very bad, it will break things */
187
188 if (!State->Thread.ThreadId)
189 {
190 ACPI_ERROR ((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId"));
191 State->Thread.ThreadId = (ACPI_THREAD_ID) 1;
192 }
193
194 return ((ACPI_THREAD_STATE *) State);
195}
#define ACPI_DESC_TYPE_STATE_THREAD
Definition: acobject.h:573
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
ACPI_THREAD_ID AcpiOsGetThreadId(void)
Definition: osl.c:217
#define ACPI_THREAD_ID
Definition: actypes.h:144

Referenced by AcpiPsParseAml().

◆ AcpiUtCreateUpdateState()

ACPI_GENERIC_STATE * AcpiUtCreateUpdateState ( ACPI_OPERAND_OBJECT Object,
UINT16  Action 
)

Definition at line 214 of file utstate.c.

217{
219
220
222
223
224 /* Create the generic state object */
225
227 if (!State)
228 {
229 return (NULL);
230 }
231
232 /* Init fields specific to the update struct */
233
234 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE;
235 State->Update.Object = Object;
236 State->Update.Value = Action;
237 return (State);
238}
#define ACPI_DESC_TYPE_STATE_UPDATE
Definition: acobject.h:565
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510

Referenced by AcpiUtCreateUpdateStateAndPush().

◆ AcpiUtDeleteGenericState()

void AcpiUtDeleteGenericState ( ACPI_GENERIC_STATE State)

Definition at line 340 of file utstate.c.

342{
344
345
346 /* Ignore null state */
347
348 if (State)
349 {
350 (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
351 }
352
353 return;
354}
ACPI_STATUS AcpiOsReleaseObject(ACPI_CACHE_T *Cache, void *Object)

Referenced by AcpiDsDeleteWalkState(), AcpiDsExecEndControlOp(), AcpiDsResultStackPop(), AcpiDsScopeStackClear(), AcpiDsScopeStackPop(), AcpiEvNotifyDispatch(), AcpiEvQueueNotifyRequest(), AcpiPsCleanupScope(), AcpiPsCompleteOp(), AcpiPsParseAml(), AcpiPsPopScope(), AcpiUtUpdateObjectReference(), and AcpiUtWalkPackageTree().

◆ AcpiUtPopGenericState()

ACPI_GENERIC_STATE * AcpiUtPopGenericState ( ACPI_GENERIC_STATE **  ListHead)

Definition at line 93 of file utstate.c.

95{
97
98
100
101
102 /* Remove the state object at the head of the list (stack) */
103
104 State = *ListHead;
105 if (State)
106 {
107 /* Update the list head */
108
109 *ListHead = State->Common.Next;
110 }
111
112 return (State);
113}

Referenced by AcpiDsExecEndControlOp(), AcpiDsResultStackPop(), AcpiDsScopeStackPop(), AcpiPsCleanupScope(), AcpiPsCompleteOp(), AcpiPsParseLoop(), AcpiPsPopScope(), AcpiUtUpdateObjectReference(), and AcpiUtWalkPackageTree().

◆ AcpiUtPushGenericState()

void AcpiUtPushGenericState ( ACPI_GENERIC_STATE **  ListHead,
ACPI_GENERIC_STATE State 
)

Definition at line 65 of file utstate.c.

68{
70
71
72 /* Push the state object onto the front of the list (stack) */
73
74 State->Common.Next = *ListHead;
75 *ListHead = State;
76 return;
77}

Referenced by AcpiDsExecBeginControlOp(), AcpiDsResultStackPush(), AcpiDsScopeStackPush(), AcpiPsPushScope(), AcpiUtCreateUpdateStateAndPush(), and AcpiUtWalkPackageTree().