summaryrefslogtreecommitdiff
path: root/source/compiler/aslxref.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/aslxref.c')
-rw-r--r--source/compiler/aslxref.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c
index d903ef1ba876..8a1f1a4c5e7f 100644
--- a/source/compiler/aslxref.c
+++ b/source/compiler/aslxref.c
@@ -1055,7 +1055,7 @@ XfNamespaceLocateBegin (
NextOp = NextOp->Asl.Next;
}
- if (Node->Value != ASL_EXTERNAL_METHOD &&
+ if (Node->Value != ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS &&
Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL)
{
/*
@@ -1064,8 +1064,17 @@ XfNamespaceLocateBegin (
*/
if (PassedArgs != Node->Value)
{
- sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName,
- Node->Value);
+ if (Node->Flags & ANOBJ_IS_EXTERNAL)
+ {
+ sprintf (AslGbl_MsgBuffer,
+ "according to previous use, %s requires %u",
+ Op->Asl.ExternalName, Node->Value);
+ }
+ else
+ {
+ sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName,
+ Node->Value);
+ }
if (PassedArgs < Node->Value)
{
@@ -1077,6 +1086,22 @@ XfNamespaceLocateBegin (
}
}
}
+
+ /*
+ * At this point, a method call to an external method has been
+ * detected. As of 11/19/2019, iASL does not support parameter counts
+ * for methods declared as external. Therefore, save the parameter
+ * count of the first method call and use this count check other
+ * method calls to ensure that the methods are being called with the
+ * same amount of parameters.
+ */
+ else if (Node->Type == ACPI_TYPE_METHOD &&
+ (Node->Flags & ANOBJ_IS_EXTERNAL) &&
+ Node->Value == ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS &&
+ Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL)
+ {
+ Node->Value = PassedArgs;
+ }
}
/* 4) Check for an ASL Field definition */