ReactOS  0.4.14-dev-1233-gf5658fd
psscope.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
Include dependency graph for psscope.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_PARSER
 

Functions

ACPI_PARSE_OBJECTAcpiPsGetParentScope (ACPI_PARSE_STATE *ParserState)
 
BOOLEAN AcpiPsHasCompletedScope (ACPI_PARSE_STATE *ParserState)
 
ACPI_STATUS AcpiPsInitScope (ACPI_PARSE_STATE *ParserState, ACPI_PARSE_OBJECT *RootOp)
 
ACPI_STATUS AcpiPsPushScope (ACPI_PARSE_STATE *ParserState, ACPI_PARSE_OBJECT *Op, UINT32 RemainingArgs, UINT32 ArgCount)
 
void AcpiPsPopScope (ACPI_PARSE_STATE *ParserState, ACPI_PARSE_OBJECT **Op, UINT32 *ArgList, UINT32 *ArgCount)
 
void AcpiPsCleanupScope (ACPI_PARSE_STATE *ParserState)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_PARSER

Definition at line 48 of file psscope.c.

Function Documentation

◆ AcpiPsCleanupScope()

void AcpiPsCleanupScope ( ACPI_PARSE_STATE ParserState)

Definition at line 277 of file psscope.c.

279 {
280  ACPI_GENERIC_STATE *Scope;
281 
282 
283  ACPI_FUNCTION_TRACE_PTR (PsCleanupScope, ParserState);
284 
285 
286  if (!ParserState)
287  {
288  return_VOID;
289  }
290 
291  /* Delete anything on the scope stack */
292 
293  while (ParserState->Scope)
294  {
295  Scope = AcpiUtPopGenericState (&ParserState->Scope);
296  AcpiUtDeleteGenericState (Scope);
297  }
298 
299  return_VOID;
300 }
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
ACPI_GENERIC_STATE * AcpiUtPopGenericState(ACPI_GENERIC_STATE **ListHead)
Definition: utstate.c:93
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
#define return_VOID
Definition: acoutput.h:495
union acpi_generic_state * Scope
Definition: aclocal.h:1108

Referenced by AcpiDsDeleteWalkState(), AcpiPsExecuteMethod(), and AcpiPsParseAml().

◆ AcpiPsGetParentScope()

ACPI_PARSE_OBJECT* AcpiPsGetParentScope ( ACPI_PARSE_STATE ParserState)

Definition at line 65 of file psscope.c.

67 {
68 
69  return (ParserState->Scope->ParseScope.Op);
70 }
union acpi_parse_object * Op
Definition: aclocal.h:749
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108

Referenced by AcpiDsLoad1BeginOp(), and AcpiPsCreateOp().

◆ AcpiPsHasCompletedScope()

BOOLEAN AcpiPsHasCompletedScope ( ACPI_PARSE_STATE ParserState)

Definition at line 88 of file psscope.c.

90 {
91 
92  return ((BOOLEAN)
93  ((ParserState->Aml >= ParserState->Scope->ParseScope.ArgEnd ||
94  !ParserState->Scope->ParseScope.ArgCount)));
95 }
ACPI_STATE_COMMON UINT32 ArgCount
Definition: aclocal.h:748
unsigned char BOOLEAN
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108
UINT8 * ArgEnd
Definition: aclocal.h:750

Referenced by AcpiPsCompleteOp(), and AcpiPsParseLoop().

◆ AcpiPsInitScope()

ACPI_STATUS AcpiPsInitScope ( ACPI_PARSE_STATE ParserState,
ACPI_PARSE_OBJECT RootOp 
)

Definition at line 112 of file psscope.c.

115 {
116  ACPI_GENERIC_STATE *Scope;
117 
118 
119  ACPI_FUNCTION_TRACE_PTR (PsInitScope, RootOp);
120 
121 
122  Scope = AcpiUtCreateGenericState ();
123  if (!Scope)
124  {
126  }
127 
128  Scope->Common.DescriptorType = ACPI_DESC_TYPE_STATE_RPSCOPE;
129  Scope->ParseScope.Op = RootOp;
131  Scope->ParseScope.ArgEnd = ParserState->AmlEnd;
132  Scope->ParseScope.PkgEnd = ParserState->AmlEnd;
133 
134  ParserState->Scope = Scope;
135  ParserState->StartOp = RootOp;
136 
138 }
ACPI_STATE_COMMON UINT32 ArgCount
Definition: aclocal.h:748
UINT8 * PkgEnd
Definition: aclocal.h:751
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130
#define ACPI_VAR_ARGS
Definition: acparser.h:52
#define ACPI_DESC_TYPE_STATE_RPSCOPE
Definition: acobject.h:566
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
UINT8 * AmlEnd
Definition: aclocal.h:1103
union acpi_parse_object * StartOp
Definition: aclocal.h:1106
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
union acpi_parse_object * Op
Definition: aclocal.h:749
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108
UINT8 * ArgEnd
Definition: aclocal.h:750
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiDsInitAmlWalk().

◆ AcpiPsPopScope()

void AcpiPsPopScope ( ACPI_PARSE_STATE ParserState,
ACPI_PARSE_OBJECT **  Op,
UINT32 ArgList,
UINT32 ArgCount 
)

Definition at line 219 of file psscope.c.

224 {
225  ACPI_GENERIC_STATE *Scope = ParserState->Scope;
226 
227 
228  ACPI_FUNCTION_TRACE (PsPopScope);
229 
230 
231  /* Only pop the scope if there is in fact a next scope */
232 
233  if (Scope->Common.Next)
234  {
235  Scope = AcpiUtPopGenericState (&ParserState->Scope);
236 
237  /* Return to parsing previous op */
238 
239  *Op = Scope->ParseScope.Op;
240  *ArgList = Scope->ParseScope.ArgList;
241  *ArgCount = Scope->ParseScope.ArgCount;
242  ParserState->PkgEnd = Scope->ParseScope.PkgEnd;
243 
244  /* All done with this scope state structure */
245 
246  AcpiUtDeleteGenericState (Scope);
247  }
248  else
249  {
250  /* Empty parse stack, prepare to fetch next opcode */
251 
252  *Op = NULL;
253  *ArgList = 0;
254  *ArgCount = 0;
255  }
256 
258  "Popped Op %p Args %X\n", *Op, *ArgCount));
259  return_VOID;
260 }
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
UINT8 * PkgEnd
Definition: aclocal.h:1105
ACPI_STATE_COMMON UINT32 ArgCount
Definition: aclocal.h:748
UINT8 * PkgEnd
Definition: aclocal.h:751
#define ACPI_DB_PARSE
Definition: acoutput.h:162
ACPI_GENERIC_STATE * AcpiUtPopGenericState(ACPI_GENERIC_STATE **ListHead)
Definition: utstate.c:93
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define return_VOID
Definition: acoutput.h:495
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
union acpi_parse_object * Op
Definition: aclocal.h:749
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108
UINT32 ArgList
Definition: aclocal.h:752

Referenced by AcpiPsCompleteFinalOp(), AcpiPsCompleteOp(), and AcpiPsParseLoop().

◆ AcpiPsPushScope()

ACPI_STATUS AcpiPsPushScope ( ACPI_PARSE_STATE ParserState,
ACPI_PARSE_OBJECT Op,
UINT32  RemainingArgs,
UINT32  ArgCount 
)

Definition at line 157 of file psscope.c.

162 {
163  ACPI_GENERIC_STATE *Scope;
164 
165 
166  ACPI_FUNCTION_TRACE_PTR (PsPushScope, Op);
167 
168 
169  Scope = AcpiUtCreateGenericState ();
170  if (!Scope)
171  {
173  }
174 
175  Scope->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PSCOPE;
176  Scope->ParseScope.Op = Op;
177  Scope->ParseScope.ArgList = RemainingArgs;
178  Scope->ParseScope.ArgCount = ArgCount;
179  Scope->ParseScope.PkgEnd = ParserState->PkgEnd;
180 
181  /* Push onto scope stack */
182 
183  AcpiUtPushGenericState (&ParserState->Scope, Scope);
184 
185  if (ArgCount == ACPI_VAR_ARGS)
186  {
187  /* Multiple arguments */
188 
189  Scope->ParseScope.ArgEnd = ParserState->PkgEnd;
190  }
191  else
192  {
193  /* Single argument */
194 
195  Scope->ParseScope.ArgEnd = ACPI_TO_POINTER (ACPI_MAX_PTR);
196  }
197 
199 }
UINT8 * PkgEnd
Definition: aclocal.h:1105
ACPI_STATE_COMMON UINT32 ArgCount
Definition: aclocal.h:748
UINT8 * PkgEnd
Definition: aclocal.h:751
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130
#define ACPI_VAR_ARGS
Definition: acparser.h:52
#define ACPI_DESC_TYPE_STATE_PSCOPE
Definition: acobject.h:567
void AcpiUtPushGenericState(ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State)
Definition: utstate.c:65
#define ACPI_TO_POINTER(i)
Definition: actypes.h:552
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
union acpi_parse_object * Op
Definition: aclocal.h:749
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108
UINT8 * ArgEnd
Definition: aclocal.h:750
#define AE_OK
Definition: acexcep.h:97
UINT32 ArgList
Definition: aclocal.h:752

Referenced by AcpiPsParseLoop().