summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dsmethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dsmethod.c')
-rw-r--r--sys/contrib/dev/acpica/dsmethod.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/sys/contrib/dev/acpica/dsmethod.c b/sys/contrib/dev/acpica/dsmethod.c
index 46c7e66..ecff19a 100644
--- a/sys/contrib/dev/acpica/dsmethod.c
+++ b/sys/contrib/dev/acpica/dsmethod.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
- * $Revision: 97 $
+ * $Revision: 101 $
*
*****************************************************************************/
@@ -132,15 +132,12 @@
*
* FUNCTION: AcpiDsParseMethod
*
- * PARAMETERS: ObjHandle - Node of the method
- * Level - Current nesting level
- * Context - Points to a method counter
- * ReturnValue - Not used
+ * PARAMETERS: ObjHandle - Method node
*
* RETURN: Status
*
- * DESCRIPTION: Call the parser and parse the AML that is
- * associated with the method.
+ * DESCRIPTION: Call the parser and parse the AML that is associated with the
+ * method.
*
* MUTEX: Assumes parser is locked
*
@@ -273,8 +270,6 @@ AcpiDsParseMethod (
* increments the thread count, and waits at the method semaphore
* for clearance to execute.
*
- * MUTEX: Locks/unlocks parser.
- *
******************************************************************************/
ACPI_STATUS
@@ -337,7 +332,8 @@ AcpiDsBeginMethodExecution (
*
* FUNCTION: AcpiDsCallControlMethod
*
- * PARAMETERS: WalkState - Current state of the walk
+ * PARAMETERS: Thread - Info for this thread
+ * ThisWalkState - Current walk state
* Op - Current Op to be walked
*
* RETURN: Status
@@ -499,12 +495,13 @@ Cleanup:
*
* FUNCTION: AcpiDsRestartControlMethod
*
- * PARAMETERS: WalkState - State of the method when it was preempted
- * Op - Pointer to new current op
+ * PARAMETERS: WalkState - State for preempted method (caller)
+ * ReturnDesc - Return value from the called method
*
* RETURN: Status
*
- * DESCRIPTION: Restart a method that was preempted
+ * DESCRIPTION: Restart a method that was preempted by another (nested) method
+ * invocation. Handle the return value (if any) from the callee.
*
******************************************************************************/
@@ -519,20 +516,38 @@ AcpiDsRestartControlMethod (
ACPI_FUNCTION_TRACE_PTR ("DsRestartControlMethod", WalkState);
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n",
+ (char *) &WalkState->MethodNode->Name, WalkState->MethodCallOp,
+ ReturnDesc));
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ " ReturnFromThisMethodUsed?=%X ResStack %p Walk %p\n",
+ WalkState->ReturnUsed,
+ WalkState->Results, WalkState));
+
+ /* Did the called method return a value? */
+
if (ReturnDesc)
{
+ /* Are we actually going to use the return value? */
+
if (WalkState->ReturnUsed)
{
- /*
- * Get the return value (if any) from the previous method.
- * NULL if no return value
- */
+ /* Save the return value from the previous method */
+
Status = AcpiDsResultPush (ReturnDesc, WalkState);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ReturnDesc);
return_ACPI_STATUS (Status);
}
+
+ /*
+ * Save as THIS method's return value in case it is returned
+ * immediately to yet another method
+ */
+ WalkState->ReturnDesc = ReturnDesc;
}
else
{
@@ -544,11 +559,6 @@ AcpiDsRestartControlMethod (
}
}
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Method=%p Return=%p ReturnUsed?=%X ResStack=%p State=%p\n",
- WalkState->MethodCallOp, ReturnDesc, WalkState->ReturnUsed,
- WalkState->Results, WalkState));
-
return_ACPI_STATUS (AE_OK);
}
OpenPOWER on IntegriCloud