FreeBSD/sys/contrib/dev/acpica/components/debugger/dbtest.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDbWriteToObject
 *
 * PARAMETERS:  Node                - Parent NS node for the object
 *              Value               - Value to be written
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Performs a write to the specified object by invoking the
 *              special debugger control method that writes the object. Thus,
 *              the AML interpreter is doing all of the work, increasing the
 *              validity of the test.
 *
 ******************************************************************************/
AcpiDbWriteToObject
PARAMETERS:  Node                - Parent NS node for the object
Value               - Value to be written

Status

Performs a write to the specified object by invoking the
special debugger control method that writes the object. Thus,
the AML interpreter is doing all of the work, increasing the
validity of the test.
AcpiDbWriteToObject PARAMETERS : Node - Parent NS node for the object Value - Value to be written Status Performs a write to the specified object by invoking the special debugger control method that writes the object . Thus the AML interpreter is doing all of the work increasing the validity of the test .
static ACPI_STATUS
AcpiDbWriteToObject (
    ACPI_NAMESPACE_NODE     *Node,
    ACPI_OBJECT             *Value)
{
    ACPI_OBJECT_LIST        ParamObjects;
    ACPI_OBJECT             Params[2];
    ACPI_STATUS             Status;
    Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
    Params[0].Reference.ActualType = Node->Type;
    Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
    memcpy (&Params[1], Value, sizeof (ACPI_OBJECT));
    ParamObjects.Count = 2;
    ParamObjects.Pointer = Params;
    AcpiGbl_MethodExecuting = TRUE;
    Status = AcpiEvaluateObject (WriteHandle, NULL, &ParamObjects, NULL);
    AcpiGbl_MethodExecuting = FALSE;
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could not write to object, %s",
            AcpiFormatException (Status));
    }
    return (Status);
}
static ACPI_STATUS AcpiDbWriteToObject ( ACPI_NAMESPACE_NODE * Node , ACPI_OBJECT * Value ) { ACPI_OBJECT_LIST ParamObjects ; ACPI_OBJECT Params [ 2 ] ; ACPI_STATUS Status ; Params [ 0 ] . Type = ACPI_TYPE_LOCAL_REFERENCE ; Params [ 0 ] . Reference . ActualType = Node -> Type ; Params [ 0 ] . Reference . Handle = ACPI_CAST_PTR ( ACPI_HANDLE , Node ) ; memcpy ( & Params [ 1 ] , Value , sizeof ( ACPI_OBJECT ) ) ; ParamObjects . Count = 2 ; ParamObjects . Pointer = Params ; AcpiGbl_MethodExecuting = TRUE ; Status = AcpiEvaluateObject ( WriteHandle , NULL , & ParamObjects , NULL ) ; AcpiGbl_MethodExecuting = FALSE ; if ( ACPI_FAILURE ( Status ) ) { AcpiOsPrintf ( " " , AcpiFormatException ( Status ) ) ; } return ( Status ) ; }
FUNCTION:    AcpiDbWriteToObject
 PARAMETERS:  Node                - Parent NS node for the object
              Value               - Value to be written
FUNCTION : AcpiDbWriteToObject PARAMETERS : Node - Parent NS node for the object Value - Value to be written
/* Copy the incoming user parameter */