acpi_status
acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *internal_object,
                                struct acpi_buffer *ret_buffer)
{
    acpi_status status;

    ACPI_FUNCTION_TRACE(ut_copy_iobject_to_eobject);

    if (ACPI_GET_OBJECT_TYPE(internal_object) == ACPI_TYPE_PACKAGE) {
        /*
         * Package object:  Copy all subobjects (including
         * nested packages)
         */
        status = acpi_ut_copy_ipackage_to_epackage(internal_object,
                 ret_buffer->pointer,
                 &ret_buffer->length);
    } else {
        /*
         * Build a simple object (no nested objects)
         */
        status = acpi_ut_copy_isimple_to_esimple(internal_object,
                 ACPI_CAST_PTR(union
                               acpi_object,
                               ret_buffer->
                               pointer),
                 ACPI_ADD_PTR(u8,
                              ret_buffer->
                              pointer,
                              ACPI_ROUND_UP_TO_NATIVE_WORD
                              (sizeof
                               (union
                                acpi_object))),
                 &ret_buffer->length);
        /*
         * build simple does not include the object size in the length
         * so we add it in here
         */
        ret_buffer->length += sizeof(union acpi_object);
    }

    return_ACPI_STATUS(status);
}
Esempio n. 2
0
acpi_status
acpi_ut_copy_iobject_to_eobject (
	acpi_operand_object     *internal_object,
	acpi_buffer             *ret_buffer)
{
	acpi_status             status;


	FUNCTION_TRACE ("Ut_copy_iobject_to_eobject");


	if (IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE)) {
		/*
		 * Package object:  Copy all subobjects (including
		 * nested packages)
		 */
		status = acpi_ut_copy_ipackage_to_epackage (internal_object,
				  ret_buffer->pointer, &ret_buffer->length);
	}

	else {
		/*
		 * Build a simple object (no nested objects)
		 */
		status = acpi_ut_copy_isimple_to_esimple (internal_object,
				  (acpi_object *) ret_buffer->pointer,
				  ((u8 *) ret_buffer->pointer +
				  ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object))),
				  &ret_buffer->length);
		/*
		 * build simple does not include the object size in the length
		 * so we add it in here
		 */
		ret_buffer->length += sizeof (acpi_object);
	}

	return_ACPI_STATUS (status);
}