diff options
Diffstat (limited to 'sys/contrib/dev/acpica/nseval.c')
-rw-r--r-- | sys/contrib/dev/acpica/nseval.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/sys/contrib/dev/acpica/nseval.c b/sys/contrib/dev/acpica/nseval.c index a584e77..51b50da 100644 --- a/sys/contrib/dev/acpica/nseval.c +++ b/sys/contrib/dev/acpica/nseval.c @@ -2,7 +2,7 @@ * * Module Name: nseval - Object evaluation interfaces -- includes control * method lookup and execution. - * $Revision: 112 $ + * $Revision: 116 $ * ******************************************************************************/ @@ -119,7 +119,6 @@ #define __NSEVAL_C__ #include "acpi.h" -#include "amlcode.h" #include "acparser.h" #include "acinterp.h" #include "acnamesp.h" @@ -134,12 +133,12 @@ * FUNCTION: AcpiNsEvaluateRelative * * PARAMETERS: Handle - The relative containing object - * *Pathname - Name of method to execute, If NULL, the + * Pathname - Name of method to execute, If NULL, the * handle is the object to execute - * **Params - List of parameters to pass to the method, + * Params - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. - * *ReturnObject - Where to put method's return value (if + * ReturnObject - Where to put method's return value (if * any). If NULL, no value is returned. * * RETURN: Status @@ -240,9 +239,9 @@ Cleanup: * FUNCTION: AcpiNsEvaluateByName * * PARAMETERS: Pathname - Fully qualified pathname to the object - * *ReturnObject - Where to put method's return value (if + * ReturnObject - Where to put method's return value (if * any). If NULL, no value is returned. - * **Params - List of parameters to pass to the method, + * Params - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. * @@ -329,10 +328,10 @@ Cleanup: * FUNCTION: AcpiNsEvaluateByHandle * * PARAMETERS: Handle - Method Node to execute - * **Params - List of parameters to pass to the method, + * Params - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. - * *ReturnObject - Where to put method's return value (if + * ReturnObject - Where to put method's return value (if * any). If NULL, no value is returned. * * RETURN: Status @@ -393,7 +392,6 @@ AcpiNsEvaluateByHandle ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* * Two major cases here: * 1) The object is an actual control method -- execute it. @@ -411,7 +409,6 @@ AcpiNsEvaluateByHandle ( Status = AcpiNsExecuteControlMethod (Node, Params, &LocalReturnObject); } - else { /* @@ -421,7 +418,6 @@ AcpiNsEvaluateByHandle ( Status = AcpiNsGetObjectValue (Node, &LocalReturnObject); } - /* * Check if there is a return value on the stack that must * be dealt with @@ -443,13 +439,9 @@ AcpiNsEvaluateByHandle ( *ReturnObject = LocalReturnObject; } + /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ - /* Map AE_RETURN_VALUE to AE_OK, we are done with it */ - - if (Status == AE_CTRL_RETURN_VALUE) - { - Status = AE_OK; - } + Status = AE_OK; } /* @@ -464,11 +456,11 @@ AcpiNsEvaluateByHandle ( * * FUNCTION: AcpiNsExecuteControlMethod * - * PARAMETERS: MethodNode - The object/method - * **Params - List of parameters to pass to the method, + * PARAMETERS: MethodNode - The method to execute + * Params - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. - * **ReturnObjDesc - List of result objects to be returned + * ReturnObjDesc - List of result objects to be returned * from the method. * * RETURN: Status @@ -506,7 +498,7 @@ AcpiNsExecuteControlMethod ( ACPI_DUMP_PATHNAME (MethodNode, "NsExecuteControlMethod: Executing", ACPI_LV_INFO, _COMPONENT); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %x\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n", ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1)); /* @@ -543,7 +535,8 @@ AcpiNsExecuteControlMethod ( * * FUNCTION: AcpiNsGetObjectValue * - * PARAMETERS: Node - The object + * PARAMETERS: Node - The object + * ReturnObjDesc - Where the objects value is returned * * RETURN: Status * @@ -559,7 +552,7 @@ AcpiNsGetObjectValue ( ACPI_OPERAND_OBJECT **ReturnObjDesc) { ACPI_STATUS Status = AE_OK; - ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_NAMESPACE_NODE *ResolvedNode = Node; ACPI_FUNCTION_TRACE ("NsGetObjectValue"); @@ -570,7 +563,6 @@ AcpiNsGetObjectValue ( * Node may be a field that must be read, etc.) -- we can't just grab * the object out of the node. */ - ObjDesc = (ACPI_OPERAND_OBJECT *) Node; /* * Use ResolveNodeToValue() to get the associated value. This call @@ -599,18 +591,18 @@ AcpiNsGetObjectValue ( Status = AcpiExEnterInterpreter (); if (ACPI_SUCCESS (Status)) { - Status = AcpiExResolveNodeToValue ((ACPI_NAMESPACE_NODE **) &ObjDesc, NULL); + Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL); /* * If AcpiExResolveNodeToValue() succeeded, the return value was - * placed in ObjDesc. + * placed in ResolvedNode. */ AcpiExExitInterpreter (); if (ACPI_SUCCESS (Status)) { Status = AE_CTRL_RETURN_VALUE; - *ReturnObjDesc = ObjDesc; - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning obj %p\n", *ReturnObjDesc)); + *ReturnObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ResolvedNode); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning obj %p\n", ResolvedNode)); } } |