summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/psargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/psargs.c')
-rw-r--r--sys/contrib/dev/acpica/psargs.c61
1 files changed, 35 insertions, 26 deletions
diff --git a/sys/contrib/dev/acpica/psargs.c b/sys/contrib/dev/acpica/psargs.c
index 4610358..33d5587 100644
--- a/sys/contrib/dev/acpica/psargs.c
+++ b/sys/contrib/dev/acpica/psargs.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
- * $Revision: 76 $
+ * $Revision: 1.81 $
*
*****************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -124,6 +124,16 @@
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psargs")
+/* Local prototypes */
+
+static UINT32
+AcpiPsGetNextPackageLength (
+ ACPI_PARSE_STATE *ParserState);
+
+static ACPI_PARSE_OBJECT *
+AcpiPsGetNextField (
+ ACPI_PARSE_STATE *ParserState);
+
/*******************************************************************************
*
@@ -138,7 +148,7 @@
*
******************************************************************************/
-UINT32
+static UINT32
AcpiPsGetNextPackageLength (
ACPI_PARSE_STATE *ParserState)
{
@@ -152,7 +162,6 @@ AcpiPsGetNextPackageLength (
EncodedLength = (UINT32) ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
-
switch (EncodedLength >> 6) /* bits 6-7 contain encoding scheme */
{
case 0: /* 1-byte encoding (bits 0-5) */
@@ -193,7 +202,7 @@ AcpiPsGetNextPackageLength (
break;
}
- return_VALUE (Length);
+ return_UINT32 (Length);
}
@@ -367,15 +376,16 @@ AcpiPsGetNextNamepath (
* parent tree, but don't open a new scope -- we just want to lookup the
* object (MUST BE mode EXECUTE to perform upsearch)
*/
- Status = AcpiNsLookup (&ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
+ Status = AcpiNsLookup (&ScopeInfo, Path, ACPI_TYPE_ANY,
+ ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ NULL, &Node);
if (ACPI_SUCCESS (Status) && MethodCall)
{
if (Node->Type == ACPI_TYPE_METHOD)
{
- /*
- * This name is actually a control method invocation
- */
+ /* This name is actually a control method invocation */
+
MethodDesc = AcpiNsGetAttachedObject (Node);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Control Method - %p Desc %p Path=%p\n",
@@ -447,7 +457,7 @@ AcpiPsGetNextNamepath (
/*
* We got a NOT_FOUND during table load or we encountered
* a CondRefOf(x) where the target does not exist.
- * -- either case is ok
+ * Either case is ok
*/
Status = AE_OK;
}
@@ -575,12 +585,13 @@ AcpiPsGetNextSimpleArg (
*
******************************************************************************/
-ACPI_PARSE_OBJECT *
+static ACPI_PARSE_OBJECT *
AcpiPsGetNextField (
ACPI_PARSE_STATE *ParserState)
{
- UINT32 AmlOffset = (UINT32) ACPI_PTR_DIFF (ParserState->Aml,
- ParserState->AmlStart);
+ UINT32 AmlOffset = (UINT32)
+ ACPI_PTR_DIFF (ParserState->Aml,
+ ParserState->AmlStart);
ACPI_PARSE_OBJECT *Field;
UINT16 Opcode;
UINT32 Name;
@@ -589,7 +600,7 @@ AcpiPsGetNextField (
ACPI_FUNCTION_TRACE ("PsGetNextField");
- /* determine field type */
+ /* Determine field type */
switch (ACPI_GET8 (ParserState->Aml))
{
@@ -611,7 +622,6 @@ AcpiPsGetNextField (
break;
}
-
/* Allocate a new field op */
Field = AcpiPsAllocOp (Opcode);
@@ -674,10 +684,10 @@ AcpiPsGetNextField (
*
* FUNCTION: AcpiPsGetNextArg
*
- * PARAMETERS: ParserState - Current parser state object
+ * PARAMETERS: WalkState - Current state
+ * ParserState - Current parser state object
* ArgType - The argument type (AML_*_ARG)
- * ArgCount - If the argument points to a control method
- * the method's argument is returned here.
+ * ReturnArg - Where the next arg is returned
*
* RETURN: Status, and an op object containing the next argument.
*
@@ -712,7 +722,7 @@ AcpiPsGetNextArg (
case ARGP_NAME:
case ARGP_NAMESTRING:
- /* constants, strings, and namestrings are all the same size */
+ /* Constants, strings, and namestrings are all the same size */
Arg = AcpiPsAllocOp (AML_BYTE_OP);
if (!Arg)
@@ -753,7 +763,6 @@ AcpiPsGetNextArg (
{
Arg = Field;
}
-
Prev = Field;
}
@@ -778,8 +787,8 @@ AcpiPsGetNextArg (
/* Fill in bytelist data */
- Arg->Common.Value.Size = (UINT32) ACPI_PTR_DIFF (ParserState->PkgEnd,
- ParserState->Aml);
+ Arg->Common.Value.Size = (UINT32)
+ ACPI_PTR_DIFF (ParserState->PkgEnd, ParserState->Aml);
Arg->Named.Data = ParserState->Aml;
/* Skip to End of byte data */
@@ -810,7 +819,7 @@ AcpiPsGetNextArg (
}
else
{
- /* single complex argument, nothing returned */
+ /* Single complex argument, nothing returned */
WalkState->ArgCount = 1;
}
@@ -820,7 +829,7 @@ AcpiPsGetNextArg (
case ARGP_DATAOBJ:
case ARGP_TERMARG:
- /* single complex argument, nothing returned */
+ /* Single complex argument, nothing returned */
WalkState->ArgCount = 1;
break;
@@ -832,7 +841,7 @@ AcpiPsGetNextArg (
if (ParserState->Aml < ParserState->PkgEnd)
{
- /* non-empty list of variable arguments, nothing returned */
+ /* Non-empty list of variable arguments, nothing returned */
WalkState->ArgCount = ACPI_VAR_ARGS;
}
OpenPOWER on IntegriCloud