ReactOS  0.4.14-dev-323-g6fe6a88
dswscope.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
Include dependency graph for dswscope.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_DISPATCHER
 

Functions

void AcpiDsScopeStackClear (ACPI_WALK_STATE *WalkState)
 
ACPI_STATUS AcpiDsScopeStackPush (ACPI_NAMESPACE_NODE *Node, ACPI_OBJECT_TYPE Type, ACPI_WALK_STATE *WalkState)
 
ACPI_STATUS AcpiDsScopeStackPop (ACPI_WALK_STATE *WalkState)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_DISPATCHER

Definition at line 49 of file dswscope.c.

Function Documentation

◆ AcpiDsScopeStackClear()

void AcpiDsScopeStackClear ( ACPI_WALK_STATE WalkState)

Definition at line 67 of file dswscope.c.

69 {
70  ACPI_GENERIC_STATE *ScopeInfo;
71 
72  ACPI_FUNCTION_NAME (DsScopeStackClear);
73 
74 
75  while (WalkState->ScopeInfo)
76  {
77  /* Pop a scope off the stack */
78 
79  ScopeInfo = WalkState->ScopeInfo;
80  WalkState->ScopeInfo = ScopeInfo->Scope.Next;
81 
83  "Popped object type (%s)\n",
84  AcpiUtGetTypeName (ScopeInfo->Common.Value)));
85 
86  AcpiUtDeleteGenericState (ScopeInfo);
87  }
88 }
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_GENERIC_STATE * ScopeInfo
Definition: acstruct.h:124
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#define ACPI_DB_EXEC
Definition: acoutput.h:165
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:249
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
ACPI_SCOPE_STATE Scope
Definition: aclocal.h:825

Referenced by AcpiPsExecuteMethod(), and AcpiPsParseAml().

◆ AcpiDsScopeStackPop()

ACPI_STATUS AcpiDsScopeStackPop ( ACPI_WALK_STATE WalkState)

Definition at line 192 of file dswscope.c.

194 {
195  ACPI_GENERIC_STATE *ScopeInfo;
196  ACPI_GENERIC_STATE *NewScopeInfo;
197 
198 
199  ACPI_FUNCTION_TRACE (DsScopeStackPop);
200 
201 
202  /*
203  * Pop scope info object off the stack.
204  */
205  ScopeInfo = AcpiUtPopGenericState (&WalkState->ScopeInfo);
206  if (!ScopeInfo)
207  {
209  }
210 
211  WalkState->ScopeDepth--;
212 
214  "[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
215  (UINT32) WalkState->ScopeDepth,
216  AcpiUtGetNodeName (ScopeInfo->Scope.Node),
217  AcpiUtGetTypeName (ScopeInfo->Common.Value)));
218 
219  NewScopeInfo = WalkState->ScopeInfo;
220  if (NewScopeInfo)
221  {
222  ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
223  AcpiUtGetNodeName (NewScopeInfo->Scope.Node),
224  AcpiUtGetTypeName (NewScopeInfo->Common.Value)));
225  }
226  else
227  {
229  }
230 
231  AcpiUtDeleteGenericState (ScopeInfo);
233 }
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
ACPI_GENERIC_STATE * AcpiUtPopGenericState(ACPI_GENERIC_STATE **ListHead)
Definition: utstate.c:93
unsigned int UINT32
#define ACPI_NAMESPACE_ROOT
Definition: acnames.h:93
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_GENERIC_STATE * ScopeInfo
Definition: acstruct.h:124
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#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_STATE_COMMON ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:740
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:249
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
UINT8 ScopeDepth
Definition: acstruct.h:86
#define AE_STACK_UNDERFLOW
Definition: acexcep.h:121
#define AE_OK
Definition: acexcep.h:97
ACPI_SCOPE_STATE Scope
Definition: aclocal.h:825

Referenced by AcpiDsExecBeginOp(), AcpiDsLoad1EndOp(), and AcpiDsLoad2EndOp().

◆ AcpiDsScopeStackPush()

ACPI_STATUS AcpiDsScopeStackPush ( ACPI_NAMESPACE_NODE Node,
ACPI_OBJECT_TYPE  Type,
ACPI_WALK_STATE WalkState 
)

Definition at line 107 of file dswscope.c.

111 {
112  ACPI_GENERIC_STATE *ScopeInfo;
113  ACPI_GENERIC_STATE *OldScopeInfo;
114 
115 
116  ACPI_FUNCTION_TRACE (DsScopeStackPush);
117 
118 
119  if (!Node)
120  {
121  /* Invalid scope */
122 
123  ACPI_ERROR ((AE_INFO, "Null scope parameter"));
125  }
126 
127  /* Make sure object type is valid */
128 
130  {
132  "Invalid object type: 0x%X", Type));
133  }
134 
135  /* Allocate a new scope object */
136 
137  ScopeInfo = AcpiUtCreateGenericState ();
138  if (!ScopeInfo)
139  {
141  }
142 
143  /* Init new scope object */
144 
145  ScopeInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE;
146  ScopeInfo->Scope.Node = Node;
147  ScopeInfo->Common.Value = (UINT16) Type;
148 
149  WalkState->ScopeDepth++;
150 
152  "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth));
153 
154  OldScopeInfo = WalkState->ScopeInfo;
155  if (OldScopeInfo)
156  {
158  "[%4.4s] (%s)",
159  AcpiUtGetNodeName (OldScopeInfo->Scope.Node),
160  AcpiUtGetTypeName (OldScopeInfo->Common.Value)));
161  }
162  else
163  {
165  }
166 
168  ", New scope -> [%4.4s] (%s)\n",
169  AcpiUtGetNodeName (ScopeInfo->Scope.Node),
170  AcpiUtGetTypeName (ScopeInfo->Common.Value)));
171 
172  /* Push new scope object onto stack */
173 
174  AcpiUtPushGenericState (&WalkState->ScopeInfo, ScopeInfo);
176 }
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
BOOLEAN AcpiUtValidObjectType(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:680
Type
Definition: Type.h:6
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130
void AcpiUtPushGenericState(ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State)
Definition: utstate.c:65
unsigned int UINT32
union node Node
Definition: types.h:1255
#define ACPI_NAMESPACE_ROOT
Definition: acnames.h:93
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_GENERIC_STATE * ScopeInfo
Definition: acstruct.h:124
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#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_STATE_COMMON ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:740
unsigned short UINT16
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:249
#define ACPI_DESC_TYPE_STATE_WSCOPE
Definition: acobject.h:567
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
UINT8 ScopeDepth
Definition: acstruct.h:86
#define AE_OK
Definition: acexcep.h:97
ACPI_SCOPE_STATE Scope
Definition: aclocal.h:825
Definition: dlist.c:348

Referenced by AcpiDsExecBeginOp(), AcpiDsInitAmlWalk(), AcpiDsLoad1BeginOp(), AcpiDsLoad2BeginOp(), AcpiNsLookup(), AcpiNsOneCompleteParse(), and AcpiPsExecuteTable().