49 #define _COMPONENT ACPI_UTILITIES
56 u8 * data_space, acpi_size * buffer_space_used);
69 acpi_ut_copy_esimple_to_isimple(union
acpi_object *user_obj,
73 acpi_ut_copy_epackage_to_ipackage(union
acpi_object *external_object,
81 acpi_ut_copy_ielement_to_eelement(
u8 object_type,
114 u8 * data_space, acpi_size * buffer_space_used)
120 *buffer_space_used = 0;
126 if (!internal_object) {
138 external_object->type = internal_object->common.type;
142 switch (internal_object->common.type) {
145 external_object->string.pointer = (
char *)data_space;
146 external_object->string.length = internal_object->string.length;
153 (
void *)internal_object->string.pointer,
154 (acpi_size) internal_object->string.length + 1);
159 external_object->buffer.pointer = data_space;
160 external_object->buffer.length = internal_object->buffer.length;
166 (
void *)internal_object->buffer.pointer,
167 internal_object->buffer.length);
172 external_object->integer.value = internal_object->integer.value;
179 switch (internal_object->reference.class) {
186 external_object->reference.handle =
187 internal_object->reference.node;
188 external_object->reference.actual_type =
202 external_object->processor.proc_id =
203 internal_object->processor.proc_id;
204 external_object->processor.pblk_address =
205 internal_object->processor.address;
206 external_object->processor.pblk_length =
207 internal_object->processor.length;
212 external_object->power_resource.system_level =
213 internal_object->power_resource.system_level;
215 external_object->power_resource.resource_order =
216 internal_object->power_resource.resource_order;
224 "Unsupported object type, cannot convert to external object: %s",
260 this_index = state->
pkg.index;
265 switch (object_type) {
271 status = acpi_ut_copy_isimple_to_esimple(source_object,
287 target_object->
package.elements =
293 state->
pkg.this_target_obj = target_object;
311 info->
length += object_space;
358 external_object->
type = internal_object->
common.type;
373 acpi_ut_copy_ielement_to_eelement,
376 *space_used = info.
length;
407 status = acpi_ut_copy_ipackage_to_epackage(internal_object,
414 status = acpi_ut_copy_isimple_to_esimple(internal_object,
454 acpi_ut_copy_esimple_to_isimple(
union acpi_object *external_object,
464 switch (external_object->
type) {
473 if (!internal_object) {
480 *ret_internal_object =
NULL;
487 "Unsupported object type, cannot convert to internal object: %s",
495 switch (external_object->
type) {
498 internal_object->
string.pointer =
500 external_object->
string.length + 1);
502 if (!internal_object->
string.pointer) {
507 external_object->
string.pointer,
508 external_object->
string.length);
510 internal_object->
string.length = external_object->
string.length;
515 internal_object->
buffer.pointer =
517 if (!internal_object->
buffer.pointer) {
522 external_object->
buffer.pointer,
523 external_object->
buffer.length);
525 internal_object->
buffer.length = external_object->
buffer.length;
551 *ret_internal_object = internal_object;
574 acpi_ut_copy_epackage_to_ipackage(
union acpi_object *external_object,
588 if (!package_object) {
592 package_elements = package_object->
package.elements;
598 for (i = 0; i < external_object->
package.count; i++) {
602 &package_elements[i]);
608 package_elements[
i] =
NULL;
618 *internal_object = package_object;
645 acpi_ut_copy_epackage_to_ipackage(external_object,
652 acpi_ut_copy_esimple_to_isimple(external_object,
684 reference_count = dest_desc->
common.reference_count;
685 next_object = dest_desc->
common.next_object;
701 dest_desc->
common.reference_count = reference_count;
702 dest_desc->
common.next_object = next_object;
710 switch (dest_desc->
common.type) {
717 if ((source_desc->
buffer.pointer) &&
718 (source_desc->
buffer.length)) {
719 dest_desc->
buffer.pointer =
721 if (!dest_desc->
buffer.pointer) {
728 source_desc->
buffer.pointer,
729 source_desc->
buffer.length);
739 if (source_desc->
string.pointer) {
740 dest_desc->
string.pointer =
743 if (!dest_desc->
string.pointer) {
750 source_desc->
string.pointer,
751 (acpi_size) source_desc->
string.length + 1);
775 if (dest_desc->
region.handler) {
823 acpi_ut_copy_ielement_to_ielement(
u8 object_type,
835 this_index = state->
pkg.index;
837 &state->
pkg.dest_object->package.elements[this_index];
839 switch (object_type) {
851 if (!target_object) {
856 acpi_ut_copy_simple_object(source_object,
862 *this_target_ptr = target_object;
866 *this_target_ptr =
NULL;
878 if (!target_object) {
882 target_object->
common.flags = source_object->
common.flags;
886 state->
pkg.this_target_obj = target_object;
890 *this_target_ptr = target_object;
938 1) *
sizeof(
void *));
939 if (!dest_obj->
package.elements) {
949 acpi_ut_copy_ielement_to_ielement,
995 acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc,
998 status = acpi_ut_copy_simple_object(source_desc, *dest_desc);