summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2016-12-21 07:58:22 -0800
committerRobert Moore <Robert.Moore@intel.com>2016-12-21 07:58:22 -0800
commitb7dae343fbb8c392999a66f5e08be5744a5d07e2 (patch)
treebb044b563f2680bcb21fdb366c76f66a531d4331
parent23b5bbe6d78afd3c5abf3adb91a1b098a3000b2e (diff)
downloadacpica-b7dae343fbb8c392999a66f5e08be5744a5d07e2.tar.gz
Fix a problem with recent extra support for control method invocations
This change fixes a problem with the recent support that enables control method invocations as Target operands to many ASL operators. Eliminates errors similar to: Needed type [Reference], found [Processor]
-rw-r--r--source/components/parser/psargs.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c
index 9b3d6a807..4375b8eb3 100644
--- a/source/components/parser/psargs.c
+++ b/source/components/parser/psargs.c
@@ -370,6 +370,20 @@ AcpiPsGetNextNamepath (
PossibleMethodCall &&
(Node->Type == ACPI_TYPE_METHOD))
{
+ if ((GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_SUPERNAME) ||
+ (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_TARGET))
+ {
+ /*
+ * AcpiPsGetNextNamestring has increased the AML pointer past
+ * the method invocation namestring, so we need to restore the
+ * saved AML pointer back to the original method invocation
+ * namestring.
+ */
+ WalkState->ParserState.Aml = Start;
+ WalkState->ArgCount = 1;
+ AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP);
+ }
+
/* This name is actually a control method invocation */
MethodDesc = AcpiNsGetAttachedObject (Node);
@@ -959,7 +973,10 @@ AcpiPsGetNextArg (
AcpiUtGetArgumentTypeName (ArgType), ArgType));
Subop = AcpiPsPeekOpcode (ParserState);
- if (Subop == 0)
+ if (Subop == 0 ||
+ AcpiPsIsLeadingChar (Subop) ||
+ ACPI_IS_ROOT_PREFIX (Subop) ||
+ ACPI_IS_PARENT_PREFIX (Subop))
{
/* NULL target (zero). Convert to a NULL namepath */
@@ -971,6 +988,13 @@ AcpiPsGetNextArg (
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
Arg, ACPI_POSSIBLE_METHOD_CALL);
+
+ if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
+ {
+ AcpiPsFreeOp (Arg);
+ Arg = NULL;
+ WalkState->ArgCount = 1;
+ }
}
else
{