summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/compiler')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c21
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprepkg.c43
2 files changed, 33 insertions, 31 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");
diff --git a/sys/contrib/dev/acpica/compiler/aslprepkg.c b/sys/contrib/dev/acpica/compiler/aslprepkg.c
index c8250b5..9cc67f4 100644
--- a/sys/contrib/dev/acpica/compiler/aslprepkg.c
+++ b/sys/contrib/dev/acpica/compiler/aslprepkg.c
@@ -54,12 +54,12 @@
static void
ApCheckPackageElements (
- const char *PredefinedName,
- ACPI_PARSE_OBJECT *Op,
- UINT8 Type1,
- UINT32 Count1,
- UINT8 Type2,
- UINT32 Count2);
+ const char *PredefinedName,
+ ACPI_PARSE_OBJECT *Op,
+ UINT8 Type1,
+ UINT32 Count1,
+ UINT8 Type2,
+ UINT32 Count2);
static void
ApCheckPackageList (
@@ -93,8 +93,9 @@ ApPackageTooLarge (
*
* FUNCTION: ApCheckPackage
*
- * PARAMETERS: ParentOp - Parser op for the package
- * Predefined - Pointer to package-specific info for method
+ * PARAMETERS: ParentOp - Parser op for the package
+ * Predefined - Pointer to package-specific info for
+ * the method
*
* RETURN: None
*
@@ -193,8 +194,8 @@ ApCheckPackage (
case ACPI_PTYPE1_VAR:
/*
- * The package count is variable, there are no sub-packages, and all
- * elements must be of the same type
+ * The package count is variable, there are no sub-packages,
+ * and all elements must be of the same type
*/
for (i = 0; i < Count; i++)
{
@@ -206,9 +207,9 @@ ApCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
- * The package count is variable, there are no sub-packages. There are
- * a fixed number of required elements, and a variable number of
- * optional elements.
+ * The package count is variable, there are no sub-packages.
+ * There are a fixed number of required elements, and a variable
+ * number of optional elements.
*
* Check if package is at least as large as the minimum required
*/
@@ -268,8 +269,8 @@ ApCheckPackage (
if (ACPI_SUCCESS (Status))
{
/*
- * Count cannot be larger than the parent package length, but allow it
- * to be smaller. The >= accounts for the Integer above.
+ * Count cannot be larger than the parent package length, but
+ * allow it to be smaller. The >= accounts for the Integer above.
*/
ExpectedCount = (UINT32) Op->Asl.Value.Integer;
if (ExpectedCount >= Count)
@@ -320,12 +321,12 @@ PackageTooSmall:
*
* FUNCTION: ApCheckPackageElements
*
- * PARAMETERS: PredefinedName - Pointer to validation data structure
- * Op - Parser op for the package
- * Type1 - Object type for first group
- * Count1 - Count for first group
- * Type2 - Object type for second group
- * Count2 - Count for second group
+ * PARAMETERS: PredefinedName - Name of the predefined object
+ * Op - Parser op for the package
+ * Type1 - Object type for first group
+ * Count1 - Count for first group
+ * Type2 - Object type for second group
+ * Count2 - Count for second group
*
* RETURN: None
*
OpenPOWER on IntegriCloud