本文整理汇总了C++中TrWalkParseTree函数的典型用法代码示例。如果您正苦于以下问题:C++ TrWalkParseTree函数的具体用法?C++ TrWalkParseTree怎么用?C++ TrWalkParseTree使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TrWalkParseTree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LdLoadNamespace
ACPI_STATUS
LdLoadNamespace (
ACPI_PARSE_OBJECT *RootOp)
{
ACPI_WALK_STATE *WalkState;
DbgPrint (ASL_DEBUG_OUTPUT, "\nCreating namespace\n\n");
/* Create a new walk state */
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
if (!WalkState)
{
return (AE_NO_MEMORY);
}
/* Walk the entire parse tree, first pass */
TrWalkParseTree (RootOp, ASL_WALK_VISIT_TWICE, LdNamespace1Begin,
LdCommonNamespaceEnd, WalkState);
/* Second pass to handle forward references */
TrWalkParseTree (RootOp, ASL_WALK_VISIT_TWICE, LdNamespace2Begin,
LdCommonNamespaceEnd, WalkState);
/* Dump the namespace if debug is enabled */
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
return (AE_OK);
}
示例2: LkCrossReferenceNamespace
ACPI_STATUS
LkCrossReferenceNamespace (
void)
{
ACPI_WALK_STATE *WalkState;
DbgPrint (ASL_DEBUG_OUTPUT, "\nCross referencing namespace\n\n");
/*
* Create a new walk state for use when looking up names
* within the namespace (Passed as context to the callbacks)
*/
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
if (!WalkState)
{
return (AE_NO_MEMORY);
}
/* Walk the entire parse tree */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, LkNamespaceLocateBegin,
LkNamespaceLocateEnd, WalkState);
return (AE_OK);
}
示例3: AnMethodTypingWalkEnd
ACPI_STATUS
AnMethodTypingWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
UINT32 ThisNodeBtype;
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
break;
case PARSEOP_RETURN:
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
{
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) &&
(ThisNodeBtype == (ACPI_UINT32_MAX -1)))
{
/*
* The called method is untyped at this time (typically a
* forward reference).
*
* Check for a recursive method call first.
*/
if (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op)
{
/* We must type the method here */
TrWalkParseTree (Op->Asl.Child->Asl.Node->Op,
ASL_WALK_VISIT_UPWARD, NULL,
AnMethodTypingWalkEnd, NULL);
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
}
}
/* Returns a value, save the value type */
if (Op->Asl.ParentMethod)
{
Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype;
}
}
break;
default:
break;
}
return (AE_OK);
}
示例4: XfCrossReferenceNamespace
ACPI_STATUS
XfCrossReferenceNamespace (
void)
{
ACPI_WALK_STATE *WalkState;
/*
* Create a new walk state for use when looking up names
* within the namespace (Passed as context to the callbacks)
*/
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
if (!WalkState)
{
return (AE_NO_MEMORY);
}
/* Walk the entire parse tree */
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
XfNamespaceLocateBegin, XfNamespaceLocateEnd, WalkState);
ACPI_FREE (WalkState);
return (AE_OK);
}
示例5: CgGenerateAmlOutput
void
CgGenerateAmlOutput (
void)
{
/* Generate the AML output file */
TrWalkParseTree (AslGbl_CurrentDB,
ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_DB_SEPARATELY,
CgAmlWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
CgUpdateHeader (AslGbl_CurrentDB);
}
示例6: LsDumpParseTree
void
LsDumpParseTree (
void)
{
if (!Gbl_DebugFlag)
{
return;
}
DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
LsTreeWriteWalk, NULL, NULL);
}
示例7: LsGenerateListing
static void
LsGenerateListing (
UINT32 FileId)
{
UINT32 WalkMode = ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_DB_SEPARATELY;
/* Start at the beginning of both the source and AML files */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
AslGbl_SourceLine = 0;
AslGbl_CurrentHexColumn = 0;
LsPushNode (AslGbl_Files[ASL_FILE_INPUT].Filename);
if (FileId == ASL_FILE_C_OFFSET_OUTPUT)
{
AslGbl_CurrentAmlOffset = 0;
/* Offset table file has a special header and footer */
LsDoOffsetTableHeader (FileId);
TrWalkParseTree (AslGbl_CurrentDB, WalkMode,
LsAmlOffsetWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
LsDoOffsetTableFooter (FileId);
return;
}
/* Process all parse nodes */
TrWalkParseTree (AslGbl_CurrentDB, WalkMode,
LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
/* Final processing */
LsFinishSourceListing (FileId);
}
示例8: MpXrefDevices
static void
MpXrefDevices (
ACPI_GPIO_INFO *Info)
{
/* Walk the entire parse tree */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
MpNamespaceXrefBegin, NULL, Info);
if (!Info->References)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // **** No references in table");
}
}
示例9: CgGenerateAmlOutput
void
CgGenerateAmlOutput (
void)
{
/* Generate the AML output file */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
CgAmlWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
CgCloseTable ();
}
示例10: CgGenerateAmlOutput
void
CgGenerateAmlOutput (
void)
{
DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n");
/* Generate the AML output file */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
CgAmlWriteWalk, NULL, NULL);
CgCloseTable ();
}
示例11: LsDumpParseTree
void
LsDumpParseTree (
void)
{
if (!AslGbl_DebugFlag)
{
return;
}
DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
LsTreeWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
}
示例12: ApFindNameInDeviceTree
BOOLEAN
ApFindNameInDeviceTree (
char *Name,
ACPI_PARSE_OBJECT *Op)
{
ACPI_STATUS Status;
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
ApDeviceSubtreeWalk, NULL, Name);
if (Status == AE_CTRL_TRUE)
{
return (TRUE); /* Found a match */
}
return (FALSE);
}
示例13: LsGenerateListing
static void
LsGenerateListing (
UINT32 FileId)
{
/* Start at the beginning of both the source and AML files */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
Gbl_SourceLine = 0;
Gbl_CurrentHexColumn = 0;
LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
/* Process all parse nodes */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
NULL, (void *) ACPI_TO_POINTER (FileId));
/* Final processing */
LsFinishSourceListing (FileId);
}
示例14: CgGenerateAmlOutput
void
CgGenerateAmlOutput (
void)
{
DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n");
/* Generate the AML output file */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
CgAmlWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT,
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
" Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n",
76, " ");
CgCloseTable ();
}
示例15: CmDoAslMiddleAndBackEnd
int
CmDoAslMiddleAndBackEnd (
void)
{
UINT8 Event;
ACPI_STATUS Status;
/* Interpret and generate all compile-time constants */
Event = UtBeginEvent ("Constant folding via AML interpreter");
DbgPrint (ASL_DEBUG_OUTPUT,
"Interpreting compile-time constant expressions\n\n");
if (AslGbl_FoldConstants)
{
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD,
NULL, OpcAmlConstantWalk, NULL);
}
else
{
DbgPrint (ASL_PARSE_OUTPUT, " Optional folding disabled\n");
}
UtEndEvent (Event);
/* Update AML opcodes if necessary, after constant folding */
Event = UtBeginEvent ("Updating AML opcodes after constant folding");
DbgPrint (ASL_DEBUG_OUTPUT,
"Updating AML opcodes after constant folding\n\n");
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD,
NULL, OpcAmlOpcodeUpdateWalk, NULL);
UtEndEvent (Event);
/* Calculate all AML package lengths */
Event = UtBeginEvent ("Generate AML package lengths");
DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n");
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL,
LnPackageLengthWalk, NULL);
UtEndEvent (Event);
if (AslGbl_ParseOnlyFlag)
{
AePrintErrorLog (ASL_FILE_STDERR);
UtDisplaySummary (ASL_FILE_STDERR);
if (AslGbl_DebugFlag)
{
/* Print error summary to the stdout also */
AePrintErrorLog (ASL_FILE_STDOUT);
UtDisplaySummary (ASL_FILE_STDOUT);
}
return (0);
}
/*
* Create an internal namespace and use it as a symbol table
*/
/* Namespace loading */
Event = UtBeginEvent ("Create ACPI Namespace");
DbgPrint (ASL_DEBUG_OUTPUT, "Creating ACPI Namespace\n\n");
Status = LdLoadNamespace (AslGbl_ParseTreeRoot);
UtEndEvent (Event);
if (ACPI_FAILURE (Status))
{
return (-1);
}
/* Namespace cross-reference */
AslGbl_NamespaceEvent = UtBeginEvent (
"Cross reference parse tree and Namespace");
DbgPrint (ASL_DEBUG_OUTPUT, "Cross referencing namespace\n\n");
Status = XfCrossReferenceNamespace ();
if (ACPI_FAILURE (Status))
{
return (-1);
}
/* Namespace - Check for non-referenced objects */
LkFindUnreferencedObjects ();
UtEndEvent (AslGbl_NamespaceEvent);
/* Resolve External Declarations */
Event = UtBeginEvent ("Resolve all Externals");
DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
if (AslGbl_DoExternalsInPlace)
{
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
ExAmlExternalWalkBegin, NULL, NULL);
}
else
{
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
//.........这里部分代码省略.........