summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/aslpredef.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-04-19 23:49:34 +0000
committerjkim <jkim@FreeBSD.org>2013-04-19 23:49:34 +0000
commit1d7102aa1b8c84f1186ae05e3678f2cac71c0f5c (patch)
tree5f5a3414edb3b26bbd9583d16c6368e24578edff /sys/contrib/dev/acpica/compiler/aslpredef.c
parent91a43667738a5b60b71f7b124b2c9686c2338341 (diff)
parent2827e383d552774c11bb806510c3468678d07994 (diff)
downloadFreeBSD-src-1d7102aa1b8c84f1186ae05e3678f2cac71c0f5c.zip
FreeBSD-src-1d7102aa1b8c84f1186ae05e3678f2cac71c0f5c.tar.gz
Merge ACPICA 20130418.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslpredef.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 6b7f3a9..47f4015 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -124,29 +124,30 @@ ApCheckForPredefinedMethod (
default:
/*
- * Matched a predefined method name
+ * Matched a predefined method name - validate the ASL-defined
+ * argument count against the ACPI specification.
*
- * Validate the ASL-defined argument count. Allow two different legal
- * arg counts.
+ * Some methods are allowed to have a "minimum" number of args
+ * (_SCP) because their definition in ACPI has changed over time.
*/
Gbl_ReservedMethods++;
ThisName = &AcpiGbl_PredefinedMethods[Index];
- RequiredArgCount = ThisName->Info.ArgumentList & METHOD_ARG_MASK;
+ RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList);
if (MethodInfo->NumArguments != RequiredArgCount)
{
sprintf (MsgBuffer, "%4.4s requires %u",
ThisName->Info.Name, RequiredArgCount);
- if ((MethodInfo->NumArguments > RequiredArgCount) &&
- !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
+ if (MethodInfo->NumArguments < RequiredArgCount)
{
- AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
+ AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
MsgBuffer);
}
- else
+ else if ((MethodInfo->NumArguments > RequiredArgCount) &&
+ !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
{
- AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
+ AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
MsgBuffer);
}
}
@@ -388,7 +389,7 @@ ApCheckForPredefinedObject (
* it must be implemented as a control method
*/
ThisName = &AcpiGbl_PredefinedMethods[Index];
- if ((ThisName->Info.ArgumentList & METHOD_ARG_MASK) > 0)
+ if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0)
{
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
"with arguments");
OpenPOWER on IntegriCloud