summaryrefslogtreecommitdiff
path: root/sys/contrib/dev/acpica/psxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/psxface.c')
-rw-r--r--sys/contrib/dev/acpica/psxface.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/sys/contrib/dev/acpica/psxface.c b/sys/contrib/dev/acpica/psxface.c
index 4a153a8f0dab..026f0ca77c87 100644
--- a/sys/contrib/dev/acpica/psxface.c
+++ b/sys/contrib/dev/acpica/psxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
- * $Revision: 71 $
+ * $Revision: 75 $
*
*****************************************************************************/
@@ -131,7 +131,7 @@
*
* FUNCTION: AcpiPsxExecute
*
- * PARAMETERS: MethodNode - A method object containing both the AML
+ * PARAMETERS: Info->Node - A method object containing both the AML
* address and length.
* **Params - List of parameters to pass to method,
* terminated by NULL. Params itself may be
@@ -147,9 +147,7 @@
ACPI_STATUS
AcpiPsxExecute (
- ACPI_NAMESPACE_NODE *MethodNode,
- ACPI_OPERAND_OBJECT **Params,
- ACPI_OPERAND_OBJECT **ReturnObjDesc)
+ ACPI_PARAMETER_INFO *Info)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
@@ -163,12 +161,12 @@ AcpiPsxExecute (
/* Validate the Node and get the attached object */
- if (!MethodNode)
+ if (!Info || !Info->Node)
{
return_ACPI_STATUS (AE_NULL_ENTRY);
}
- ObjDesc = AcpiNsGetAttachedObject (MethodNode);
+ ObjDesc = AcpiNsGetAttachedObject (Info->Node);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NULL_OBJECT);
@@ -176,21 +174,22 @@ AcpiPsxExecute (
/* Init for new method, wait on concurrency semaphore */
- Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc, NULL);
+ Status = AcpiDsBeginMethodExecution (Info->Node, ObjDesc, NULL);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
- if (Params)
+ if ((Info->ParameterType == ACPI_PARAM_ARGS) &&
+ (Info->Parameters))
{
/*
* The caller "owns" the parameters, so give each one an extra
* reference
*/
- for (i = 0; Params[i]; i++)
+ for (i = 0; Info->Parameters[i]; i++)
{
- AcpiUtAddReference (Params[i]);
+ AcpiUtAddReference (Info->Parameters[i]);
}
}
@@ -200,7 +199,7 @@ AcpiPsxExecute (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Parse **** Entry=%p obj=%p\n",
- MethodNode, ObjDesc));
+ Info->Node, ObjDesc));
/* Create and init a Root Node */
@@ -228,8 +227,9 @@ AcpiPsxExecute (
goto Cleanup2;
}
- Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, NULL, NULL, 1);
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
+ ObjDesc->Method.AmlStart,
+ ObjDesc->Method.AmlLength, NULL, 1);
if (ACPI_FAILURE (Status))
{
goto Cleanup3;
@@ -242,7 +242,6 @@ AcpiPsxExecute (
if (ACPI_FAILURE (Status))
{
goto Cleanup1; /* Walk state is already deleted */
-
}
/*
@@ -250,7 +249,7 @@ AcpiPsxExecute (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Execution **** Entry=%p obj=%p\n",
- MethodNode, ObjDesc));
+ Info->Node, ObjDesc));
/* Create and init a Root Node */
@@ -263,8 +262,8 @@ AcpiPsxExecute (
/* Init new op with the method name and pointer back to the NS node */
- AcpiPsSetName (Op, MethodNode->Name.Integer);
- Op->Common.Node = MethodNode;
+ AcpiPsSetName (Op, Info->Node->Name.Integer);
+ Op->Common.Node = Info->Node;
/* Create and initialize a new walk state */
@@ -275,8 +274,9 @@ AcpiPsxExecute (
goto Cleanup2;
}
- Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, Params, ReturnObjDesc, 3);
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
+ ObjDesc->Method.AmlStart,
+ ObjDesc->Method.AmlLength, Info, 3);
if (ACPI_FAILURE (Status))
{
goto Cleanup3;
@@ -296,15 +296,16 @@ Cleanup2:
AcpiPsDeleteParseTree (Op);
Cleanup1:
- if (Params)
+ if ((Info->ParameterType == ACPI_PARAM_ARGS) &&
+ (Info->Parameters))
{
/* Take away the extra reference that we gave the parameters above */
- for (i = 0; Params[i]; i++)
+ for (i = 0; Info->Parameters[i]; i++)
{
/* Ignore errors, just do them all */
- (void) AcpiUtUpdateObjectReference (Params[i], REF_DECREMENT);
+ (void) AcpiUtUpdateObjectReference (Info->Parameters[i], REF_DECREMENT);
}
}
@@ -317,11 +318,11 @@ Cleanup1:
* If the method has returned an object, signal this to the caller with
* a control exception code
*/
- if (*ReturnObjDesc)
+ if (Info->ReturnObject)
{
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned ObjDesc=%p\n",
- *ReturnObjDesc));
- ACPI_DUMP_STACK_ENTRY (*ReturnObjDesc);
+ Info->ReturnObject));
+ ACPI_DUMP_STACK_ENTRY (Info->ReturnObject);
Status = AE_CTRL_RETURN_VALUE;
}