ReactOS  0.4.15-dev-3287-gfec35dc
psparse.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "acdispat.h"
#include "amlcode.h"
#include "acinterp.h"
#include "acnamesp.h"
Include dependency graph for psparse.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_PARSER
 

Functions

UINT32 AcpiPsGetOpcodeSize (UINT32 Opcode)
 
UINT16 AcpiPsPeekOpcode (ACPI_PARSE_STATE *ParserState)
 
ACPI_STATUS AcpiPsCompleteThisOp (ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
 
ACPI_STATUS AcpiPsNextParseState (ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_STATUS CallbackStatus)
 
ACPI_STATUS AcpiPsParseAml (ACPI_WALK_STATE *WalkState)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_PARSER

Definition at line 61 of file psparse.c.

Function Documentation

◆ AcpiPsCompleteThisOp()

ACPI_STATUS AcpiPsCompleteThisOp ( ACPI_WALK_STATE WalkState,
ACPI_PARSE_OBJECT Op 
)

Definition at line 144 of file psparse.c.

147 {
148  ACPI_PARSE_OBJECT *Prev;
149  ACPI_PARSE_OBJECT *Next;
150  const ACPI_OPCODE_INFO *ParentInfo;
151  ACPI_PARSE_OBJECT *ReplacementOp = NULL;
153 
154 
155  ACPI_FUNCTION_TRACE_PTR (PsCompleteThisOp, Op);
156 
157 
158  /* Check for null Op, can happen if AML code is corrupt */
159 
160  if (!Op)
161  {
162  return_ACPI_STATUS (AE_OK); /* OK for now */
163  }
164 
165  AcpiExStopTraceOpcode (Op, WalkState);
166 
167  /* Delete this op and the subtree below it if asked to */
168 
169  if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) ||
170  (WalkState->OpInfo->Class == AML_CLASS_ARGUMENT))
171  {
173  }
174 
175  /* Make sure that we only delete this subtree */
176 
177  if (Op->Common.Parent)
178  {
179  Prev = Op->Common.Parent->Common.Value.Arg;
180  if (!Prev)
181  {
182  /* Nothing more to do */
183 
184  goto Cleanup;
185  }
186 
187  /*
188  * Check if we need to replace the operator and its subtree
189  * with a return value op (placeholder op)
190  */
191  ParentInfo = AcpiPsGetOpcodeInfo (Op->Common.Parent->Common.AmlOpcode);
192 
193  switch (ParentInfo->Class)
194  {
195  case AML_CLASS_CONTROL:
196 
197  break;
198 
199  case AML_CLASS_CREATE:
200  /*
201  * These opcodes contain TermArg operands. The current
202  * op must be replaced by a placeholder return op
203  */
204  ReplacementOp = AcpiPsAllocOp (
206  if (!ReplacementOp)
207  {
209  }
210  break;
211 
213  /*
214  * These opcodes contain TermArg operands. The current
215  * op must be replaced by a placeholder return op
216  */
217  if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
218  (Op->Common.Parent->Common.AmlOpcode == AML_DATA_REGION_OP) ||
219  (Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) ||
220  (Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
221  (Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
222  (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
223  {
224  ReplacementOp = AcpiPsAllocOp (
226  if (!ReplacementOp)
227  {
229  }
230  }
231  else if ((Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
232  (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2))
233  {
234  if ((Op->Common.AmlOpcode == AML_BUFFER_OP) ||
235  (Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
236  (Op->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
237  {
238  ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode,
239  Op->Common.Aml);
240  if (!ReplacementOp)
241  {
243  }
244  else
245  {
246  ReplacementOp->Named.Data = Op->Named.Data;
247  ReplacementOp->Named.Length = Op->Named.Length;
248  }
249  }
250  }
251  break;
252 
253  default:
254 
255  ReplacementOp = AcpiPsAllocOp (
257  if (!ReplacementOp)
258  {
260  }
261  }
262 
263  /* We must unlink this op from the parent tree */
264 
265  if (Prev == Op)
266  {
267  /* This op is the first in the list */
268 
269  if (ReplacementOp)
270  {
271  ReplacementOp->Common.Parent = Op->Common.Parent;
272  ReplacementOp->Common.Value.Arg = NULL;
273  ReplacementOp->Common.Node = Op->Common.Node;
274  Op->Common.Parent->Common.Value.Arg = ReplacementOp;
275  ReplacementOp->Common.Next = Op->Common.Next;
276  }
277  else
278  {
279  Op->Common.Parent->Common.Value.Arg = Op->Common.Next;
280  }
281  }
282 
283  /* Search the parent list */
284 
285  else while (Prev)
286  {
287  /* Traverse all siblings in the parent's argument list */
288 
289  Next = Prev->Common.Next;
290  if (Next == Op)
291  {
292  if (ReplacementOp)
293  {
294  ReplacementOp->Common.Parent = Op->Common.Parent;
295  ReplacementOp->Common.Value.Arg = NULL;
296  ReplacementOp->Common.Node = Op->Common.Node;
297  Prev->Common.Next = ReplacementOp;
298  ReplacementOp->Common.Next = Op->Common.Next;
299  Next = NULL;
300  }
301  else
302  {
303  Prev->Common.Next = Op->Common.Next;
304  Next = NULL;
305  }
306  }
307  Prev = Next;
308  }
309  }
310 
311 
312 Cleanup:
313 
314  /* Now we can actually delete the subtree rooted at Op */
315 
318 }
void AcpiPsDeleteParseTree(ACPI_PARSE_OBJECT *root)
Definition: pswalk.c:67
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AML_CLASS_CREATE
Definition: amlcode.h:401
#define AML_CLASS_CONTROL
Definition: amlcode.h:404
const ACPI_OPCODE_INFO * AcpiPsGetOpcodeInfo(UINT16 Opcode)
Definition: psopinfo.c:72
ACPI_PARSE_OBJECT * AcpiPsAllocOp(UINT16 Opcode, UINT8 *Aml)
Definition: psutils.c:130
UINT32 ParseFlags
Definition: acstruct.h:95
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AML_VARIABLE_PACKAGE_OP
Definition: amlcode.h:63
#define AML_REGION_OP
Definition: amlcode.h:180
#define AML_CLASS_NAMED_OBJECT
Definition: amlcode.h:403
#define AML_NAME_OP
Definition: amlcode.h:54
void AcpiExStopTraceOpcode(ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState)
Definition: extrace.c:385
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
ACPI_PARSE_OBJ_NAMED Named
Definition: aclocal.h:1079
Status
Definition: gdiplustypes.h:24
#define ACPI_PARSE_TREE_MASK
Definition: acparser.h:57
#define AML_BANK_FIELD_OP
Definition: amlcode.h:187
#define AML_INT_RETURN_VALUE_OP
Definition: amlcode.h:211
#define AML_CLASS_ARGUMENT
Definition: amlcode.h:402
const ACPI_OPCODE_INFO * OpInfo
Definition: acstruct.h:119
static const WCHAR Cleanup[]
Definition: register.c:80
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define NULL
Definition: types.h:112
UINT8 PassNumber
Definition: acstruct.h:87
#define AML_BUFFER_OP
Definition: amlcode.h:61
#define AML_DATA_REGION_OP
Definition: amlcode.h:188
#define AE_OK
Definition: acexcep.h:97
#define AML_PACKAGE_OP
Definition: amlcode.h:62
#define ACPI_PARSE_DELETE_TREE
Definition: acparser.h:55

Referenced by AcpiPsCompleteFinalOp(), and AcpiPsCompleteOp().

◆ AcpiPsGetOpcodeSize()

UINT32 AcpiPsGetOpcodeSize ( UINT32  Opcode)

Definition at line 78 of file psparse.c.

80 {
81 
82  /* Extended (2-byte) opcode if > 255 */
83 
84  if (Opcode > 0x00FF)
85  {
86  return (2);
87  }
88 
89  /* Otherwise, just a single byte opcode */
90 
91  return (1);
92 }
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:330

Referenced by AcpiInstallMethod(), and AcpiPsGetAmlOpcode().

◆ AcpiPsNextParseState()

ACPI_STATUS AcpiPsNextParseState ( ACPI_WALK_STATE WalkState,
ACPI_PARSE_OBJECT Op,
ACPI_STATUS  CallbackStatus 
)

Definition at line 337 of file psparse.c.

341 {
342  ACPI_PARSE_STATE *ParserState = &WalkState->ParserState;
344 
345 
346  ACPI_FUNCTION_TRACE_PTR (PsNextParseState, Op);
347 
348 
349  switch (CallbackStatus)
350  {
351  case AE_CTRL_TERMINATE:
352  /*
353  * A control method was terminated via a RETURN statement.
354  * The walk of this method is complete.
355  */
356  ParserState->Aml = ParserState->AmlEnd;
358  break;
359 
360  case AE_CTRL_BREAK:
361 
362  ParserState->Aml = WalkState->AmlLastWhile;
363  WalkState->ControlState->Common.Value = FALSE;
365  break;
366 
367  case AE_CTRL_CONTINUE:
368 
369  ParserState->Aml = WalkState->AmlLastWhile;
371  break;
372 
373  case AE_CTRL_PENDING:
374 
375  ParserState->Aml = WalkState->AmlLastWhile;
376  break;
377 
378 #if 0
379  case AE_CTRL_SKIP:
380 
381  ParserState->Aml = ParserState->Scope->ParseScope.PkgEnd;
382  Status = AE_OK;
383  break;
384 #endif
385 
386  case AE_CTRL_TRUE:
387  /*
388  * Predicate of an IF was true, and we are at the matching ELSE.
389  * Just close out this package
390  */
391  ParserState->Aml = AcpiPsGetNextPackageEnd (ParserState);
393  break;
394 
395  case AE_CTRL_FALSE:
396  /*
397  * Either an IF/WHILE Predicate was false or we encountered a BREAK
398  * opcode. In both cases, we do not execute the rest of the
399  * package; We simply close out the parent (finishing the walk of
400  * this branch of the tree) and continue execution at the parent
401  * level.
402  */
403  ParserState->Aml = ParserState->Scope->ParseScope.PkgEnd;
404 
405  /* In the case of a BREAK, just force a predicate (if any) to FALSE */
406 
407  WalkState->ControlState->Common.Value = FALSE;
409  break;
410 
411  case AE_CTRL_TRANSFER:
412 
413  /* A method call (invocation) -- transfer control */
414 
416  WalkState->PrevOp = Op;
417  WalkState->MethodCallOp = Op;
418  WalkState->MethodCallNode = (Op->Common.Value.Arg)->Common.Node;
419 
420  /* Will return value (if any) be used by the caller? */
421 
422  WalkState->ReturnUsed = AcpiDsIsResultUsed (Op, WalkState);
423  break;
424 
425  default:
426 
429  {
430  Status = AE_OK;
431  }
432  break;
433  }
434 
436 }
#define ACPI_CNTL_EXCEPTION(Status)
Definition: acexcep.h:103
#define AE_CTRL_END
Definition: acexcep.h:230
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078
ACPI_PARSE_OBJECT * PrevOp
Definition: acstruct.h:125
UINT8 * PkgEnd
Definition: aclocal.h:751
BOOLEAN AcpiDsIsResultUsed(ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState)
Definition: dsutils.c:187
#define AE_CTRL_TRANSFER
Definition: acexcep.h:231
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_GENERIC_STATE * ControlState
Definition: acstruct.h:110
#define AE_CTRL_PENDING
Definition: acexcep.h:225
#define AE_CTRL_FALSE
Definition: acexcep.h:228
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
#define FALSE
Definition: types.h:117
struct acpi_namespace_node * MethodCallNode
Definition: acstruct.h:113
#define AE_CTRL_CONTINUE
Definition: acexcep.h:233
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
UINT8 * AmlEnd
Definition: aclocal.h:1103
#define AE_CTRL_TRUE
Definition: acexcep.h:227
Status
Definition: gdiplustypes.h:24
UINT8 * AcpiPsGetNextPackageEnd(ACPI_PARSE_STATE *ParserState)
Definition: psargs.c:138
ACPI_PARSE_OBJECT * MethodCallOp
Definition: acstruct.h:114
_In_ FLT_PREOP_CALLBACK_STATUS CallbackStatus
Definition: fltkernel.h:1020
ACPI_PARSE_STATE ParserState
Definition: acstruct.h:97
ACPI_COMMON_STATE Common
Definition: aclocal.h:822
UINT8 ReturnUsed
Definition: acstruct.h:85
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define AE_CTRL_BREAK
Definition: acexcep.h:232
ACPI_OBJECT_COMMON Common
Definition: acobject.h:518
ACPI_PSCOPE_STATE ParseScope
Definition: aclocal.h:826
union acpi_generic_state * Scope
Definition: aclocal.h:1108
UINT8 * AmlLastWhile
Definition: acstruct.h:108
#define AE_OK
Definition: acexcep.h:97

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

◆ AcpiPsParseAml()

ACPI_STATUS AcpiPsParseAml ( ACPI_WALK_STATE WalkState)

Definition at line 453 of file psparse.c.

455 {
458  ACPI_THREAD_STATE *PrevWalkList = AcpiGbl_CurrentWalkList;
459  ACPI_WALK_STATE *PreviousWalkState;
460 
461 
462  ACPI_FUNCTION_TRACE (PsParseAml);
463 
465  "Entered with WalkState=%p Aml=%p size=%X\n",
466  WalkState, WalkState->ParserState.Aml,
467  WalkState->ParserState.AmlSize));
468 
469  if (!WalkState->ParserState.Aml)
470  {
472  }
473 
474  /* Create and initialize a new thread state */
475 
477  if (!Thread)
478  {
479  if (WalkState->MethodDesc)
480  {
481  /* Executing a control method - additional cleanup */
482 
483  AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
484  }
485 
486  AcpiDsDeleteWalkState (WalkState);
488  }
489 
490  WalkState->Thread = Thread;
491 
492  /*
493  * If executing a method, the starting SyncLevel is this method's
494  * SyncLevel
495  */
496  if (WalkState->MethodDesc)
497  {
498  WalkState->Thread->CurrentSyncLevel =
499  WalkState->MethodDesc->Method.SyncLevel;
500  }
501 
502  AcpiDsPushWalkState (WalkState, Thread);
503 
504  /*
505  * This global allows the AML debugger to get a handle to the currently
506  * executing control method.
507  */
508  AcpiGbl_CurrentWalkList = Thread;
509 
510  /*
511  * Execute the walk loop as long as there is a valid Walk State. This
512  * handles nested control method invocations without recursion.
513  */
514  ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "State=%p\n", WalkState));
515 
516  Status = AE_OK;
517  while (WalkState)
518  {
519  if (ACPI_SUCCESS (Status))
520  {
521  /*
522  * The ParseLoop executes AML until the method terminates
523  * or calls another method.
524  */
525  Status = AcpiPsParseLoop (WalkState);
526  }
527 
529  "Completed one call to walk loop, %s State=%p\n",
530  AcpiFormatException (Status), WalkState));
531 
532  if (WalkState->MethodPathname && WalkState->MethodIsNested)
533  {
534  /* Optional object evaluation log */
535 
536  ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, "%-26s: %*s%s\n",
537  " Exit nested method",
538  (WalkState->MethodNestingDepth + 1) * 3, " ",
539  &WalkState->MethodPathname[1]));
540 
541  ACPI_FREE (WalkState->MethodPathname);
542  WalkState->MethodIsNested = FALSE;
543  }
544  if (Status == AE_CTRL_TRANSFER)
545  {
546  /*
547  * A method call was detected.
548  * Transfer control to the called control method
549  */
550  Status = AcpiDsCallControlMethod (Thread, WalkState, NULL);
551  if (ACPI_FAILURE (Status))
552  {
553  Status = AcpiDsMethodError (Status, WalkState);
554  }
555 
556  /*
557  * If the transfer to the new method method call worked,
558  * a new walk state was created -- get it
559  */
560  WalkState = AcpiDsGetCurrentWalkState (Thread);
561  continue;
562  }
563  else if (Status == AE_CTRL_TERMINATE)
564  {
565  Status = AE_OK;
566  }
567  else if ((Status != AE_OK) && (WalkState->MethodDesc))
568  {
569  /* Either the method parse or actual execution failed */
570 
572  if (Status == AE_ABORT_METHOD)
573  {
575  WalkState->MethodNode, "Aborting method");
576  AcpiOsPrintf ("\n");
577  }
578  else
579  {
580  ACPI_ERROR_METHOD ("Aborting method",
581  WalkState->MethodNode, NULL, Status);
582  }
584 
585  /* Check for possible multi-thread reentrancy problem */
586 
587  if ((Status == AE_ALREADY_EXISTS) &&
588  (!(WalkState->MethodDesc->Method.InfoFlags &
590  {
591  /*
592  * Method is not serialized and tried to create an object
593  * twice. The probable cause is that the method cannot
594  * handle reentrancy. Mark as "pending serialized" now, and
595  * then mark "serialized" when the last thread exits.
596  */
597  WalkState->MethodDesc->Method.InfoFlags |=
599  }
600  }
601 
602  /* We are done with this walk, move on to the parent if any */
603 
604  WalkState = AcpiDsPopWalkState (Thread);
605 
606  /* Reset the current scope to the beginning of scope stack */
607 
608  AcpiDsScopeStackClear (WalkState);
609 
610  /*
611  * If we just returned from the execution of a control method or if we
612  * encountered an error during the method parse phase, there's lots of
613  * cleanup to do
614  */
615  if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
617  !(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) ||
618  (ACPI_FAILURE (Status)))
619  {
620  AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
621  }
622 
623  /* Delete this walk state and all linked control states */
624 
625  AcpiPsCleanupScope (&WalkState->ParserState);
626  PreviousWalkState = WalkState;
627 
629  "ReturnValue=%p, ImplicitValue=%p State=%p\n",
630  WalkState->ReturnDesc, WalkState->ImplicitReturnObj, WalkState));
631 
632  /* Check if we have restarted a preempted walk */
633 
634  WalkState = AcpiDsGetCurrentWalkState (Thread);
635  if (WalkState)
636  {
637  if (ACPI_SUCCESS (Status))
638  {
639  /*
640  * There is another walk state, restart it.
641  * If the method return value is not used by the parent,
642  * The object is deleted
643  */
644  if (!PreviousWalkState->ReturnDesc)
645  {
646  /*
647  * In slack mode execution, if there is no return value
648  * we should implicitly return zero (0) as a default value.
649  */
650  if (AcpiGbl_EnableInterpreterSlack &&
651  !PreviousWalkState->ImplicitReturnObj)
652  {
653  PreviousWalkState->ImplicitReturnObj =
655  if (!PreviousWalkState->ImplicitReturnObj)
656  {
658  }
659  }
660 
661  /* Restart the calling control method */
662 
663  Status = AcpiDsRestartControlMethod (WalkState,
664  PreviousWalkState->ImplicitReturnObj);
665  }
666  else
667  {
668  /*
669  * We have a valid return value, delete any implicit
670  * return value.
671  */
672  AcpiDsClearImplicitReturn (PreviousWalkState);
673 
674  Status = AcpiDsRestartControlMethod (WalkState,
675  PreviousWalkState->ReturnDesc);
676  }
677  if (ACPI_SUCCESS (Status))
678  {
679  WalkState->WalkType |= ACPI_WALK_METHOD_RESTART;
680  }
681  }
682  else
683  {
684  /* On error, delete any return object or implicit return */
685 
686  AcpiUtRemoveReference (PreviousWalkState->ReturnDesc);
687  AcpiDsClearImplicitReturn (PreviousWalkState);
688  }
689  }
690 
691  /*
692  * Just completed a 1st-level method, save the final internal return
693  * value (if any)
694  */
695  else if (PreviousWalkState->CallerReturnDesc)
696  {
697  if (PreviousWalkState->ImplicitReturnObj)
698  {
699  *(PreviousWalkState->CallerReturnDesc) =
700  PreviousWalkState->ImplicitReturnObj;
701  }
702  else
703  {
704  /* NULL if no return value */
705 
706  *(PreviousWalkState->CallerReturnDesc) =
707  PreviousWalkState->ReturnDesc;
708  }
709  }
710  else
711  {
712  if (PreviousWalkState->ReturnDesc)
713  {
714  /* Caller doesn't want it, must delete it */
715 
716  AcpiUtRemoveReference (PreviousWalkState->ReturnDesc);
717  }
718  if (PreviousWalkState->ImplicitReturnObj)
719  {
720  /* Caller doesn't want it, must delete it */
721 
722  AcpiUtRemoveReference (PreviousWalkState->ImplicitReturnObj);
723  }
724  }
725 
726  AcpiDsDeleteWalkState (PreviousWalkState);
727  }
728 
729  /* Normal exit */
730 
733  AcpiGbl_CurrentWalkList = PrevWalkList;
735 }
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
#define ACPI_FREE(a)
Definition: actypes.h:386
ACPI_THREAD_STATE * Thread
Definition: acstruct.h:127
ACPI_STATUS AcpiDsMethodError(ACPI_STATUS Status, ACPI_WALK_STATE *WalkState)
Definition: dsmethod.c:223
char * MethodPathname
Definition: acstruct.h:117
void AcpiDsPushWalkState(ACPI_WALK_STATE *WalkState, ACPI_THREAD_STATE *Thread)
Definition: dswstate.c:526
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
union acpi_operand_object * ImplicitReturnObj
Definition: acstruct.h:112
void AcpiDsDeleteWalkState(ACPI_WALK_STATE *WalkState)
Definition: dswstate.c:780
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define ACPI_METHOD_SERIALIZED
Definition: acobject.h:237
ACPI_OBJECT_COMMON_HEADER UINT8 InfoFlags
Definition: acobject.h:215
#define AE_ABORT_METHOD
Definition: acexcep.h:132
ACPI_THREAD_STATE * AcpiUtCreateThreadState(void)
Definition: utstate.c:164
#define AE_CTRL_TRANSFER
Definition: acexcep.h:231
ACPI_STATUS AcpiDsRestartControlMethod(ACPI_WALK_STATE *WalkState, ACPI_OPERAND_OBJECT *ReturnDesc)
Definition: dsmethod.c:685
union acpi_operand_object * ReturnDesc
Definition: acstruct.h:123
#define ACPI_DB_PARSE
Definition: acoutput.h:162
UINT32 ParseFlags
Definition: acstruct.h:95
UINT32 ACPI_STATUS
Definition: actypes.h:460
void AcpiExReleaseAllMutexes(ACPI_THREAD_STATE *Thread)
Definition: exmutex.c:536
void AcpiPsCleanupScope(ACPI_PARSE_STATE *state)
Definition: psscope.c:277
#define ACPI_PARSE_EXECUTE
Definition: acparser.h:61
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70
#define FALSE
Definition: types.h:117
ACPI_WALK_STATE * AcpiDsPopWalkState(ACPI_THREAD_STATE *Thread)
Definition: dswstate.c:555
#define AE_BAD_ADDRESS
Definition: acexcep.h:159
#define ACPI_METHOD_SERIALIZED_PENDING
Definition: acobject.h:238
UINT8 WalkType
Definition: acstruct.h:77
Status
Definition: gdiplustypes.h:24
void AcpiNsPrintNodePathname(ACPI_NAMESPACE_NODE *Node, const char *Msg)
Definition: nsutils.c:75
ACPI_WALK_STATE * AcpiDsGetCurrentWalkState(ACPI_THREAD_STATE *Thread)
Definition: dswstate.c:494
ACPI_STATE_COMMON UINT8 CurrentSyncLevel
Definition: aclocal.h:764
UINT16 MethodNestingDepth
Definition: acstruct.h:100
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
union acpi_operand_object * MethodDesc
Definition: acstruct.h:115
ACPI_OPERAND_OBJECT * AcpiUtCreateIntegerObject(UINT64 Value)
Definition: utobject.c:223
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2652
#define ACPI_ERROR_METHOD(s, n, p, e)
Definition: acmacros.h:463
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format,...)
Definition: osl.c:851
void AcpiDsScopeStackClear(ACPI_WALK_STATE *WalkState)
Definition: dswscope.c:67
ACPI_PARSE_STATE ParserState
Definition: acstruct.h:97
struct acpi_namespace_node * MethodNode
Definition: acstruct.h:116
ACPI_OBJECT_METHOD Method
Definition: acobject.h:524
#define ACPI_PARSE_MODE_MASK
Definition: acparser.h:62
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_PARSE_MODULE_LEVEL
Definition: acparser.h:67
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:789
union acpi_operand_object ** CallerReturnDesc
Definition: acstruct.h:109
#define NULL
Definition: types.h:112
ACPI_STATUS AcpiDsCallControlMethod(ACPI_THREAD_STATE *Thread, ACPI_WALK_STATE *ThisWalkState, ACPI_PARSE_OBJECT *Op)
Definition: dsmethod.c:531
#define ACPI_DB_EVALUATION
Definition: acoutput.h:181
unsigned long long UINT64
#define ACPI_WALK_METHOD_RESTART
Definition: acstruct.h:70
UINT8 MethodIsNested
Definition: acstruct.h:101
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
ACPI_STATUS AcpiPsParseLoop(ACPI_WALK_STATE *WalkState)
Definition: psloop.c:259
UINT32 AmlSize
Definition: aclocal.h:1110
#define AE_OK
Definition: acexcep.h:97
void AcpiDsTerminateControlMethod(ACPI_OPERAND_OBJECT *MethodDesc, ACPI_WALK_STATE *WalkState)
Definition: dsmethod.c:779
void AcpiDsClearImplicitReturn(ACPI_WALK_STATE *WalkState)
Definition: dsutils.c:73

Referenced by AcpiDsAutoSerializeMethod(), AcpiDsExecuteArguments(), AcpiNsOneCompleteParse(), AcpiPsExecuteMethod(), and AcpiPsExecuteTable().

◆ AcpiPsPeekOpcode()

UINT16 AcpiPsPeekOpcode ( ACPI_PARSE_STATE ParserState)

Definition at line 108 of file psparse.c.

110 {
111  UINT8 *Aml;
112  UINT16 Opcode;
113 
114 
115  Aml = ParserState->Aml;
116  Opcode = (UINT16) ACPI_GET8 (Aml);
117 
119  {
120  /* Extended opcode, get the second opcode byte */
121 
122  Aml++;
123  Opcode = (UINT16) ((Opcode << 8) | ACPI_GET8 (Aml));
124  }
125 
126  return (Opcode);
127 }
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:330
#define ACPI_GET8(ptr)
Definition: acmacros.h:57
#define AML_EXTENDED_PREFIX
Definition: amlcode.h:68
unsigned short UINT16
unsigned char UINT8
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1297

Referenced by AcpiInstallMethod(), AcpiPsGetAmlOpcode(), and AcpiPsGetNextArg().