summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/aslpredef.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-04-28 22:25:27 +0000
committerjkim <jkim@FreeBSD.org>2010-04-28 22:25:27 +0000
commit4c851553838a2dd95a2de9b439d36e29fb5db240 (patch)
treee511715a703db6625626ee660200d7e96f82d8d2 /sys/contrib/dev/acpica/compiler/aslpredef.c
parentc28c8b4fa8609196c4f255f1331dbe009fba337c (diff)
parent4bf52321c35e1ae073f65020f92e80d53bdf79d8 (diff)
downloadFreeBSD-src-4c851553838a2dd95a2de9b439d36e29fb5db240.zip
FreeBSD-src-4c851553838a2dd95a2de9b439d36e29fb5db240.tar.gz
Merge ACPICA 20100428.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslpredef.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c78
1 files changed, 55 insertions, 23 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index b9632f9..c3e49cd 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -243,11 +243,11 @@ ApCheckForPredefinedMethod (
break;
- case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */
+ case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
Gbl_ReservedMethods++;
- /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */
+ /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */
if (MethodInfo->NumArguments != 0)
{
@@ -346,12 +346,12 @@ ApCheckPredefinedReturnValue (
case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
- case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */
+ case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
/* Just return, nothing to do */
return;
- default: /* a real predefined ACPI name */
+ default: /* A standard predefined ACPI name */
/* Exit if no return value expected */
@@ -425,29 +425,59 @@ ApCheckForPredefinedObject (
* or a predefined scope name
*/
Index = ApCheckForPredefinedName (Op, Name);
- if (Index > ACPI_VALID_RESERVED_NAME_MAX)
+
+ switch (Index)
{
+ case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
+ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
+ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
+
+ /* Nothing to do */
return;
- }
- /*
- * We found a matching predefind name.
- * Check if this predefined name requires input arguments
- */
- if (PredefinedNames[Index].Info.ParamCount > 0)
- {
+ case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
+
/*
- * This predefined name must always be defined as a control
- * method because it is required to have input arguments.
+ * These names must be control methods, by definition in ACPI spec.
+ * Also because they are defined to return no value. None of them
+ * require any arguments.
*/
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
- "with arguments");
- }
+ "with zero arguments");
+ return;
- /* Typecheck the actual object, it is the next argument */
+ default: /* A standard predefined ACPI name */
- ApCheckObjectType (Op->Asl.Child->Asl.Next,
- PredefinedNames[Index].Info.ExpectedBtypes);
+ /*
+ * If this predefined name requires input arguments, then
+ * it must be implemented as a control method
+ */
+ if (PredefinedNames[Index].Info.ParamCount > 0)
+ {
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
+ "with arguments");
+ return;
+ }
+
+ /*
+ * If no return value is expected from this predefined name, then
+ * it follows that it must be implemented as a control method
+ * (with zero args, because the args > 0 case was handled above)
+ * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
+ */
+ if (!PredefinedNames[Index].Info.ExpectedBtypes)
+ {
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
+ "with zero arguments");
+ return;
+ }
+
+ /* Typecheck the actual object, it is the next argument */
+
+ ApCheckObjectType (Op->Asl.Child->Asl.Next,
+ PredefinedNames[Index].Info.ExpectedBtypes);
+ return;
+ }
}
@@ -514,7 +544,7 @@ ApCheckForPredefinedName (
}
}
- /* Check for _Lxx, _Exx, _Qxx, _T_x. Warning if unknown predefined name */
+ /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */
return (ApCheckForSpecialName (Op, Name));
}
@@ -530,7 +560,7 @@ ApCheckForPredefinedName (
* RETURN: None
*
* DESCRIPTION: Check for the "special" predefined names -
- * _Lxx, _Exx, _Qxx, and _T_x
+ * _Lxx, _Exx, _Qxx, _Wxx, and _T_x
*
******************************************************************************/
@@ -541,14 +571,16 @@ ApCheckForSpecialName (
{
/*
- * Check for the "special" predefined names. We know the first char is an
- * underscore already.
+ * Check for the "special" predefined names. We already know that the
+ * first character is an underscore.
* GPE: _Lxx
* GPE: _Exx
+ * GPE: _Wxx
* EC: _Qxx
*/
if ((Name[1] == 'L') ||
(Name[1] == 'E') ||
+ (Name[1] == 'W') ||
(Name[1] == 'Q'))
{
/* The next two characters must be hex digits */
OpenPOWER on IntegriCloud