summaryrefslogtreecommitdiff
path: root/source/components/dispatcher
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2018-12-13 19:04:25 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2018-12-13 19:04:25 +0000
commitd28459aaaf532373b12c80aa5b869f8b591954e7 (patch)
tree22941844047df08d63d286d7dfbf38f3a8f79e0f /source/components/dispatcher
parent4d4b15a0e8524e15826ac932bd05252dbd246422 (diff)
Notes
Diffstat (limited to 'source/components/dispatcher')
-rw-r--r--source/components/dispatcher/dsmethod.c12
-rw-r--r--source/components/dispatcher/dsobject.c10
-rw-r--r--source/components/dispatcher/dspkginit.c26
-rw-r--r--source/components/dispatcher/dsutils.c2
-rw-r--r--source/components/dispatcher/dswload.c6
-rw-r--r--source/components/dispatcher/dswload2.c6
-rw-r--r--source/components/dispatcher/dswstate.c2
7 files changed, 40 insertions, 24 deletions
diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c
index 3db8010f7311..009151f91061 100644
--- a/source/components/dispatcher/dsmethod.c
+++ b/source/components/dispatcher/dsmethod.c
@@ -720,6 +720,8 @@ AcpiDsCallControlMethod (
goto Cleanup;
}
+ NextWalkState->MethodNestingDepth = ThisWalkState->MethodNestingDepth + 1;
+
/*
* Delete the operands on the previous walkstate operand stack
* (they were copied to new objects)
@@ -738,6 +740,16 @@ AcpiDsCallControlMethod (
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
MethodNode->Name.Ascii, NextWalkState));
+ ThisWalkState->MethodPathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
+ ThisWalkState->MethodIsNested = TRUE;
+
+ /* Optional object evaluation log */
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
+ "%-26s: %*s%s\n", " Nested method call",
+ NextWalkState->MethodNestingDepth * 3, " ",
+ &ThisWalkState->MethodPathname[1]));
+
/* Invoke an internal method if necessary */
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
diff --git a/source/components/dispatcher/dsobject.c b/source/components/dispatcher/dsobject.c
index e9b7413a2feb..4ec23d466c48 100644
--- a/source/components/dispatcher/dsobject.c
+++ b/source/components/dispatcher/dsobject.c
@@ -161,7 +161,6 @@
ACPI_MODULE_NAME ("dsobject")
-#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiDsBuildInternalObject
@@ -460,7 +459,6 @@ AcpiDsCreateNode (
return_ACPI_STATUS (Status);
}
-#endif /* ACPI_NO_METHOD_EXECUTION */
/*******************************************************************************
@@ -571,9 +569,7 @@ AcpiDsInitObjectFromOp (
/* Truncate value if we are executing from a 32-bit ACPI table */
-#ifndef ACPI_NO_METHOD_EXECUTION
(void) AcpiExTruncateFor32bitTable (ObjDesc);
-#endif
break;
case AML_REVISION_OP:
@@ -594,7 +590,6 @@ AcpiDsInitObjectFromOp (
ObjDesc->Integer.Value = Op->Common.Value.Integer;
-#ifndef ACPI_NO_METHOD_EXECUTION
if (AcpiExTruncateFor32bitTable (ObjDesc))
{
/* Warn if we found a 64-bit constant in a 32-bit table */
@@ -604,7 +599,6 @@ AcpiDsInitObjectFromOp (
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
(UINT32) ObjDesc->Integer.Value));
}
-#endif
break;
default:
@@ -642,12 +636,10 @@ AcpiDsInitObjectFromOp (
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;
-#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
-#endif
break;
case AML_TYPE_METHOD_ARGUMENT:
@@ -657,12 +649,10 @@ AcpiDsInitObjectFromOp (
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_ARG;
-#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
-#endif
break;
default: /* Object name or Debug object */
diff --git a/source/components/dispatcher/dspkginit.c b/source/components/dispatcher/dspkginit.c
index 9e1cd6115fd4..1e7e7383a088 100644
--- a/source/components/dispatcher/dspkginit.c
+++ b/source/components/dispatcher/dspkginit.c
@@ -308,6 +308,32 @@ AcpiDsBuildInternalPackageObj (
{
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
+ if (!Arg->Common.Node)
+ {
+ /*
+ * This is the case where an expression has returned a value.
+ * The use of expressions (TermArgs) within individual
+ * package elements is not supported by the AML interpreter,
+ * even though the ASL grammar supports it. Example:
+ *
+ * Name (INT1, 0x1234)
+ *
+ * Name (PKG3, Package () {
+ * Add (INT1, 0xAAAA0000)
+ * })
+ *
+ * 1) No known AML interpreter supports this type of construct
+ * 2) This fixes a fault if the construct is encountered
+ */
+ ACPI_EXCEPTION ((AE_INFO, AE_SUPPORT,
+ "Expressions within package elements are not supported"));
+
+ /* Cleanup the return object, it is not needed */
+
+ AcpiUtRemoveReference (WalkState->Results->Results.ObjDesc[0]);
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
{
/*
diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c
index c03f9268f886..20a9e25602d4 100644
--- a/source/components/dispatcher/dsutils.c
+++ b/source/components/dispatcher/dsutils.c
@@ -209,7 +209,6 @@ AcpiDsClearImplicitReturn (
}
-#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiDsDoImplicitReturn
@@ -583,7 +582,6 @@ AcpiDsClearOperands (
WalkState->NumOperands = 0;
return_VOID;
}
-#endif
/*******************************************************************************
diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c
index 91f5b3050042..db0f0e8596dd 100644
--- a/source/components/dispatcher/dswload.c
+++ b/source/components/dispatcher/dswload.c
@@ -221,12 +221,10 @@ AcpiDsInitCallbacks (
/* Execution pass */
-#ifndef ACPI_NO_METHOD_EXECUTION
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsExecBeginOp;
WalkState->AscendingCallback = AcpiDsExecEndOp;
-#endif
break;
default:
@@ -517,7 +515,7 @@ AcpiDsLoad1BeginOp (
/* Initialize the op */
-#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
+#ifdef ACPI_CONSTANT_EVAL_ONLY
Op->Named.Path = Path;
#endif
@@ -580,7 +578,6 @@ AcpiDsLoad1EndOp (
ObjectType = WalkState->OpInfo->ObjectType;
-#ifndef ACPI_NO_METHOD_EXECUTION
if (WalkState->OpInfo->Flags & AML_FIELD)
{
/*
@@ -626,7 +623,6 @@ AcpiDsLoad1EndOp (
}
}
}
-#endif
if (Op->Common.AmlOpcode == AML_NAME_OP)
{
diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c
index 4b6e41d8dd30..7387690e2a09 100644
--- a/source/components/dispatcher/dswload2.c
+++ b/source/components/dispatcher/dswload2.c
@@ -529,10 +529,8 @@ AcpiDsLoad2EndOp (
ACPI_NAMESPACE_NODE *Node;
ACPI_PARSE_OBJECT *Arg;
ACPI_NAMESPACE_NODE *NewNode;
-#ifndef ACPI_NO_METHOD_EXECUTION
UINT32 i;
UINT8 RegionSpace;
-#endif
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
@@ -622,7 +620,6 @@ AcpiDsLoad2EndOp (
switch (WalkState->OpInfo->Type)
{
-#ifndef ACPI_NO_METHOD_EXECUTION
case AML_TYPE_CREATE_FIELD:
/*
@@ -718,13 +715,11 @@ AcpiDsLoad2EndOp (
}
break;
-#endif /* ACPI_NO_METHOD_EXECUTION */
case AML_TYPE_NAMED_COMPLEX:
switch (Op->Common.AmlOpcode)
{
-#ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP:
case AML_DATA_REGION_OP:
@@ -809,7 +804,6 @@ AcpiDsLoad2EndOp (
}
break;
-#endif /* ACPI_NO_METHOD_EXECUTION */
default:
diff --git a/source/components/dispatcher/dswstate.c b/source/components/dispatcher/dswstate.c
index 7994cb12dd1c..409d7f71fa64 100644
--- a/source/components/dispatcher/dswstate.c
+++ b/source/components/dispatcher/dswstate.c
@@ -733,7 +733,7 @@ AcpiDsCreateWalkState (
/* Init the method args/local */
-#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
+#ifndef ACPI_CONSTANT_EVAL_ONLY
AcpiDsMethodDataInit (WalkState);
#endif