summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/asltree.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
committerjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
commitdba8c0a565199df70a86f6a036d00c92f0c7675f (patch)
treecf4924274c6e92898c01efb3c8ba31b34f0630f2 /sys/contrib/dev/acpica/compiler/asltree.c
parent0f41551ef9dde560d9d191d7190af02904dbf611 (diff)
downloadFreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.zip
FreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.tar.gz
MFC: r284583, r285797, r285799, r287168, r298714, r298720, r298838,
r300879 Merge ACPICA up to 20160527. Requested by: mav
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/asltree.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/asltree.c87
1 files changed, 76 insertions, 11 deletions
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index 68d8072..d2f128e 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,6 +58,29 @@ TrGetNextNode (
/*******************************************************************************
*
+ * FUNCTION: TrSetParent
+ *
+ * PARAMETERS: Op - To be set to new parent
+ * ParentOp - The parent
+ *
+ * RETURN: None, sets Op parent directly
+ *
+ * DESCRIPTION: Change the parent of a parse op.
+ *
+ ******************************************************************************/
+
+void
+TrSetParent (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *ParentOp)
+{
+
+ Op->Asl.Parent = ParentOp;
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: TrGetNextNode
*
* PARAMETERS: None
@@ -157,10 +180,30 @@ TrReleaseNode (
/*******************************************************************************
*
+ * FUNCTION: TrSetCurrentFilename
+ *
+ * PARAMETERS: Op - An existing parse node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Save the include file filename. Used for debug output only.
+ *
+ ******************************************************************************/
+
+void
+TrSetCurrentFilename (
+ ACPI_PARSE_OBJECT *Op)
+{
+ Op->Asl.Filename = Gbl_PreviousIncludeFilename;
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: TrUpdateNode
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
- * Op - An existing parse node
+ * Op - An existing parse node
*
* RETURN: The updated node
*
@@ -340,6 +383,11 @@ TrPrintNodeCompileFlags (
FlagName = "NODE_METHOD_TYPED";
break;
+ case NODE_COULD_NOT_REDUCE:
+
+ FlagName = "NODE_COULD_NOT_REDUCE";
+ break;
+
case NODE_COMPILE_TIME_CONST:
FlagName = "NODE_COMPILE_TIME_CONST";
@@ -489,7 +537,7 @@ TrSetEndLineNumber (
return;
}
- Op->Asl.EndLine = Gbl_CurrentLineNumber;
+ Op->Asl.EndLine = Gbl_CurrentLineNumber;
Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber;
}
@@ -538,6 +586,7 @@ TrCreateAssignmentNode (
case PARSEOP_ADD:
case PARSEOP_AND:
case PARSEOP_DIVIDE:
+ case PARSEOP_INDEX:
case PARSEOP_MOD:
case PARSEOP_MULTIPLY:
case PARSEOP_NOT:
@@ -752,7 +801,8 @@ TrCreateConstantLeafNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X \n",
+ "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p "
+ "Op %s Value %8.8X%8.8X \n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
return (Op);
@@ -859,7 +909,8 @@ TrCreateValuedLeafNode (
Op = TrAllocateNode (ParseOpcode);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
+ "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p "
+ "Op %s Value %8.8X%8.8X ",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
ACPI_FORMAT_UINT64 (Value));
Op->Asl.Value.Integer = Value;
@@ -945,15 +996,22 @@ TrCreateNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ",
- Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode));
+ Op->Asl.LineNumber, Op->Asl.Column, Op,
+ NumChildren, UtGetOpName(ParseOpcode));
/* Some extra debug output based on the parse opcode */
switch (ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_ASL_CODE:
+
+ Gbl_ParseTreeRoot = Op;
+ Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+ break;
+
+ case PARSEOP_DEFINITION_BLOCK:
- RootNode = Op;
DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
break;
@@ -1074,9 +1132,15 @@ TrLinkChildren (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_ASL_CODE:
+
+ Gbl_ParseTreeRoot = Op;
+ Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+ break;
+
+ case PARSEOP_DEFINITION_BLOCK:
- RootNode = Op;
DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
break;
@@ -1154,6 +1218,7 @@ TrLinkChildren (
Child = Child->Asl.Next;
Child->Asl.Parent = Op;
}
+
PrevChild = Child;
}
@@ -1375,7 +1440,7 @@ TrWalkParseTree (
ACPI_STATUS Status;
- if (!RootNode)
+ if (!Gbl_ParseTreeRoot)
{
return (AE_OK);
}
OpenPOWER on IntegriCloud