Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Module Name: utcopy - Internal to external object translation utilities |
| 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
Len Brown | 75a44ce | 2008-04-23 23:00:13 -0400 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2008, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
| 45 | #include <acpi/amlcode.h> |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 46 | #include <acpi/acnamesp.h> |
| 47 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #define _COMPONENT ACPI_UTILITIES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 50 | ACPI_MODULE_NAME("utcopy") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 52 | /* Local prototypes */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 53 | static acpi_status |
| 54 | acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, |
| 55 | union acpi_object *external_object, |
| 56 | u8 * data_space, acpi_size * buffer_space_used); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 57 | |
| 58 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 59 | acpi_ut_copy_ielement_to_ielement(u8 object_type, |
| 60 | union acpi_operand_object *source_object, |
| 61 | union acpi_generic_state *state, |
| 62 | void *context); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 63 | |
| 64 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 65 | acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, |
| 66 | u8 * buffer, acpi_size * space_used); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 67 | |
| 68 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 69 | acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj, |
| 70 | union acpi_operand_object **return_obj); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 71 | |
| 72 | static acpi_status |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 73 | acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, |
| 74 | union acpi_operand_object **internal_object); |
| 75 | |
| 76 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 77 | acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, |
| 78 | union acpi_operand_object *dest_desc); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 79 | |
| 80 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 81 | acpi_ut_copy_ielement_to_eelement(u8 object_type, |
| 82 | union acpi_operand_object *source_object, |
| 83 | union acpi_generic_state *state, |
| 84 | void *context); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 85 | |
| 86 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 87 | acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, |
| 88 | union acpi_operand_object *dest_obj, |
| 89 | struct acpi_walk_state *walk_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | /******************************************************************************* |
| 92 | * |
| 93 | * FUNCTION: acpi_ut_copy_isimple_to_esimple |
| 94 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 95 | * PARAMETERS: internal_object - Source object to be copied |
| 96 | * external_object - Where to return the copied object |
| 97 | * data_space - Where object data is returned (such as |
| 98 | * buffer and string data) |
| 99 | * buffer_space_used - Length of data_space that was used |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | * |
| 101 | * RETURN: Status |
| 102 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 103 | * DESCRIPTION: This function is called to copy a simple internal object to |
| 104 | * an external object. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 106 | * The data_space buffer is assumed to have sufficient space for |
| 107 | * the object. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | * |
| 109 | ******************************************************************************/ |
| 110 | |
| 111 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 112 | acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, |
| 113 | union acpi_object *external_object, |
| 114 | u8 * data_space, acpi_size * buffer_space_used) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 116 | acpi_status status = AE_OK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 118 | ACPI_FUNCTION_TRACE(ut_copy_isimple_to_esimple); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
| 120 | *buffer_space_used = 0; |
| 121 | |
| 122 | /* |
| 123 | * Check for NULL object case (could be an uninitialized |
| 124 | * package element) |
| 125 | */ |
| 126 | if (!internal_object) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 127 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | /* Always clear the external object */ |
| 131 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 132 | ACPI_MEMSET(external_object, 0, sizeof(union acpi_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | |
| 134 | /* |
| 135 | * In general, the external object will be the same type as |
| 136 | * the internal object |
| 137 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 138 | external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | |
| 140 | /* However, only a limited number of external types are supported */ |
| 141 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 142 | switch (ACPI_GET_OBJECT_TYPE(internal_object)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | case ACPI_TYPE_STRING: |
| 144 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 145 | external_object->string.pointer = (char *)data_space; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | external_object->string.length = internal_object->string.length; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 147 | *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD((acpi_size) |
| 148 | internal_object-> |
| 149 | string. |
| 150 | length + 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 152 | ACPI_MEMCPY((void *)data_space, |
| 153 | (void *)internal_object->string.pointer, |
| 154 | (acpi_size) internal_object->string.length + 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | break; |
| 156 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | case ACPI_TYPE_BUFFER: |
| 158 | |
| 159 | external_object->buffer.pointer = data_space; |
| 160 | external_object->buffer.length = internal_object->buffer.length; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 161 | *buffer_space_used = |
| 162 | ACPI_ROUND_UP_TO_NATIVE_WORD(internal_object->string. |
| 163 | length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 164 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 165 | ACPI_MEMCPY((void *)data_space, |
| 166 | (void *)internal_object->buffer.pointer, |
| 167 | internal_object->buffer.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | break; |
| 169 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | case ACPI_TYPE_INTEGER: |
| 171 | |
| 172 | external_object->integer.value = internal_object->integer.value; |
| 173 | break; |
| 174 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | case ACPI_TYPE_LOCAL_REFERENCE: |
| 176 | |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 177 | /* This is an object reference. */ |
| 178 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | switch (internal_object->reference.opcode) { |
| 180 | case AML_INT_NAMEPATH_OP: |
| 181 | |
| 182 | /* For namepath, return the object handle ("reference") */ |
| 183 | |
| 184 | default: |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 185 | |
| 186 | /* We are referring to the namespace node */ |
| 187 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 188 | external_object->reference.handle = |
| 189 | internal_object->reference.node; |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 190 | external_object->reference.actual_type = |
| 191 | acpi_ns_get_type(internal_object->reference.node); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | break; |
| 193 | } |
| 194 | break; |
| 195 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | case ACPI_TYPE_PROCESSOR: |
| 197 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 198 | external_object->processor.proc_id = |
| 199 | internal_object->processor.proc_id; |
| 200 | external_object->processor.pblk_address = |
| 201 | internal_object->processor.address; |
| 202 | external_object->processor.pblk_length = |
| 203 | internal_object->processor.length; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | break; |
| 205 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | case ACPI_TYPE_POWER: |
| 207 | |
| 208 | external_object->power_resource.system_level = |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 209 | internal_object->power_resource.system_level; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
| 211 | external_object->power_resource.resource_order = |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 212 | internal_object->power_resource.resource_order; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | break; |
| 214 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | default: |
| 216 | /* |
| 217 | * There is no corresponding external object type |
| 218 | */ |
Bob Moore | b1dd909 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 219 | ACPI_ERROR((AE_INFO, |
| 220 | "Unsupported object type, cannot convert to external object: %s", |
| 221 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE |
| 222 | (internal_object)))); |
| 223 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 224 | return_ACPI_STATUS(AE_SUPPORT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | } |
| 226 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 227 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | } |
| 229 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | /******************************************************************************* |
| 231 | * |
| 232 | * FUNCTION: acpi_ut_copy_ielement_to_eelement |
| 233 | * |
| 234 | * PARAMETERS: acpi_pkg_callback |
| 235 | * |
| 236 | * RETURN: Status |
| 237 | * |
| 238 | * DESCRIPTION: Copy one package element to another package element |
| 239 | * |
| 240 | ******************************************************************************/ |
| 241 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 242 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 243 | acpi_ut_copy_ielement_to_eelement(u8 object_type, |
| 244 | union acpi_operand_object *source_object, |
| 245 | union acpi_generic_state *state, |
| 246 | void *context) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 248 | acpi_status status = AE_OK; |
| 249 | struct acpi_pkg_info *info = (struct acpi_pkg_info *)context; |
| 250 | acpi_size object_space; |
| 251 | u32 this_index; |
| 252 | union acpi_object *target_object; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 254 | ACPI_FUNCTION_ENTRY(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 256 | this_index = state->pkg.index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | target_object = (union acpi_object *) |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 258 | &((union acpi_object *)(state->pkg.dest_object))->package. |
| 259 | elements[this_index]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
| 261 | switch (object_type) { |
| 262 | case ACPI_COPY_TYPE_SIMPLE: |
| 263 | |
| 264 | /* |
| 265 | * This is a simple or null object |
| 266 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 267 | status = acpi_ut_copy_isimple_to_esimple(source_object, |
| 268 | target_object, |
| 269 | info->free_space, |
| 270 | &object_space); |
| 271 | if (ACPI_FAILURE(status)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | return (status); |
| 273 | } |
| 274 | break; |
| 275 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | case ACPI_COPY_TYPE_PACKAGE: |
| 277 | |
| 278 | /* |
| 279 | * Build the package object |
| 280 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 281 | target_object->type = ACPI_TYPE_PACKAGE; |
| 282 | target_object->package.count = source_object->package.count; |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 283 | target_object->package.elements = |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 284 | ACPI_CAST_PTR(union acpi_object, info->free_space); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | |
| 286 | /* |
| 287 | * Pass the new package object back to the package walk routine |
| 288 | */ |
| 289 | state->pkg.this_target_obj = target_object; |
| 290 | |
| 291 | /* |
| 292 | * Save space for the array of objects (Package elements) |
| 293 | * update the buffer length counter |
| 294 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 295 | object_space = ACPI_ROUND_UP_TO_NATIVE_WORD((acpi_size) |
| 296 | target_object-> |
| 297 | package.count * |
| 298 | sizeof(union |
| 299 | acpi_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | break; |
| 301 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | default: |
| 303 | return (AE_BAD_PARAMETER); |
| 304 | } |
| 305 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 306 | info->free_space += object_space; |
| 307 | info->length += object_space; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | return (status); |
| 309 | } |
| 310 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | /******************************************************************************* |
| 312 | * |
| 313 | * FUNCTION: acpi_ut_copy_ipackage_to_epackage |
| 314 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 315 | * PARAMETERS: internal_object - Pointer to the object we are returning |
| 316 | * Buffer - Where the object is returned |
| 317 | * space_used - Where the object length is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | * |
| 319 | * RETURN: Status |
| 320 | * |
| 321 | * DESCRIPTION: This function is called to place a package object in a user |
| 322 | * buffer. A package object by definition contains other objects. |
| 323 | * |
| 324 | * The buffer is assumed to have sufficient space for the object. |
| 325 | * The caller must have verified the buffer length needed using the |
| 326 | * acpi_ut_get_object_size function before calling this function. |
| 327 | * |
| 328 | ******************************************************************************/ |
| 329 | |
| 330 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 331 | acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, |
| 332 | u8 * buffer, acpi_size * space_used) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 334 | union acpi_object *external_object; |
| 335 | acpi_status status; |
| 336 | struct acpi_pkg_info info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 338 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_epackage); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | |
| 340 | /* |
| 341 | * First package at head of the buffer |
| 342 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 343 | external_object = ACPI_CAST_PTR(union acpi_object, buffer); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | |
| 345 | /* |
| 346 | * Free space begins right after the first package |
| 347 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 348 | info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); |
| 349 | info.free_space = |
| 350 | buffer + ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | info.object_space = 0; |
| 352 | info.num_packages = 1; |
| 353 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 354 | external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); |
| 355 | external_object->package.count = internal_object->package.count; |
| 356 | external_object->package.elements = ACPI_CAST_PTR(union acpi_object, |
| 357 | info.free_space); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | |
| 359 | /* |
| 360 | * Leave room for an array of ACPI_OBJECTS in the buffer |
| 361 | * and move the free space past it |
| 362 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 363 | info.length += (acpi_size) external_object->package.count * |
| 364 | ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 365 | info.free_space += external_object->package.count * |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 366 | ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 368 | status = acpi_ut_walk_package_tree(internal_object, external_object, |
| 369 | acpi_ut_copy_ielement_to_eelement, |
| 370 | &info); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | |
| 372 | *space_used = info.length; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 373 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | } |
| 375 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | /******************************************************************************* |
| 377 | * |
| 378 | * FUNCTION: acpi_ut_copy_iobject_to_eobject |
| 379 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 380 | * PARAMETERS: internal_object - The internal object to be converted |
| 381 | * buffer_ptr - Where the object is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 382 | * |
| 383 | * RETURN: Status |
| 384 | * |
| 385 | * DESCRIPTION: This function is called to build an API object to be returned to |
| 386 | * the caller. |
| 387 | * |
| 388 | ******************************************************************************/ |
| 389 | |
| 390 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 391 | acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *internal_object, |
| 392 | struct acpi_buffer *ret_buffer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 393 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 394 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 396 | ACPI_FUNCTION_TRACE(ut_copy_iobject_to_eobject); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 398 | if (ACPI_GET_OBJECT_TYPE(internal_object) == ACPI_TYPE_PACKAGE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | /* |
| 400 | * Package object: Copy all subobjects (including |
| 401 | * nested packages) |
| 402 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 403 | status = acpi_ut_copy_ipackage_to_epackage(internal_object, |
| 404 | ret_buffer->pointer, |
| 405 | &ret_buffer->length); |
| 406 | } else { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | /* |
| 408 | * Build a simple object (no nested objects) |
| 409 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 410 | status = acpi_ut_copy_isimple_to_esimple(internal_object, |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 411 | ACPI_CAST_PTR(union |
| 412 | acpi_object, |
| 413 | ret_buffer-> |
| 414 | pointer), |
| 415 | ACPI_ADD_PTR(u8, |
| 416 | ret_buffer-> |
| 417 | pointer, |
| 418 | ACPI_ROUND_UP_TO_NATIVE_WORD |
| 419 | (sizeof |
| 420 | (union |
| 421 | acpi_object))), |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 422 | &ret_buffer->length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 423 | /* |
| 424 | * build simple does not include the object size in the length |
| 425 | * so we add it in here |
| 426 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 427 | ret_buffer->length += sizeof(union acpi_object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | } |
| 429 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 430 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 431 | } |
| 432 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 433 | /******************************************************************************* |
| 434 | * |
| 435 | * FUNCTION: acpi_ut_copy_esimple_to_isimple |
| 436 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 437 | * PARAMETERS: external_object - The external object to be converted |
| 438 | * ret_internal_object - Where the internal object is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | * |
| 440 | * RETURN: Status |
| 441 | * |
| 442 | * DESCRIPTION: This function copies an external object to an internal one. |
| 443 | * NOTE: Pointers can be copied, we don't need to copy data. |
| 444 | * (The pointers have to be valid in our address space no matter |
| 445 | * what we do with them!) |
| 446 | * |
| 447 | ******************************************************************************/ |
| 448 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 449 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 450 | acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, |
| 451 | union acpi_operand_object **ret_internal_object) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 453 | union acpi_operand_object *internal_object; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 455 | ACPI_FUNCTION_TRACE(ut_copy_esimple_to_isimple); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 456 | |
| 457 | /* |
| 458 | * Simple types supported are: String, Buffer, Integer |
| 459 | */ |
| 460 | switch (external_object->type) { |
| 461 | case ACPI_TYPE_STRING: |
| 462 | case ACPI_TYPE_BUFFER: |
| 463 | case ACPI_TYPE_INTEGER: |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 464 | case ACPI_TYPE_LOCAL_REFERENCE: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 466 | internal_object = acpi_ut_create_internal_object((u8) |
| 467 | external_object-> |
| 468 | type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | if (!internal_object) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 470 | return_ACPI_STATUS(AE_NO_MEMORY); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 471 | } |
| 472 | break; |
| 473 | |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 474 | case ACPI_TYPE_ANY: /* This is the case for a NULL object */ |
| 475 | |
| 476 | *ret_internal_object = NULL; |
| 477 | return_ACPI_STATUS(AE_OK); |
| 478 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | default: |
| 480 | /* All other types are not supported */ |
| 481 | |
Bob Moore | b1dd909 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 482 | ACPI_ERROR((AE_INFO, |
| 483 | "Unsupported object type, cannot convert to internal object: %s", |
| 484 | acpi_ut_get_type_name(external_object->type))); |
| 485 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 486 | return_ACPI_STATUS(AE_SUPPORT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 487 | } |
| 488 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | /* Must COPY string and buffer contents */ |
| 490 | |
| 491 | switch (external_object->type) { |
| 492 | case ACPI_TYPE_STRING: |
| 493 | |
| 494 | internal_object->string.pointer = |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 495 | ACPI_ALLOCATE_ZEROED((acpi_size) external_object->string. |
| 496 | length + 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 497 | if (!internal_object->string.pointer) { |
| 498 | goto error_exit; |
| 499 | } |
| 500 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 501 | ACPI_MEMCPY(internal_object->string.pointer, |
| 502 | external_object->string.pointer, |
| 503 | external_object->string.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 504 | |
| 505 | internal_object->string.length = external_object->string.length; |
| 506 | break; |
| 507 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | case ACPI_TYPE_BUFFER: |
| 509 | |
| 510 | internal_object->buffer.pointer = |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 511 | ACPI_ALLOCATE_ZEROED(external_object->buffer.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 512 | if (!internal_object->buffer.pointer) { |
| 513 | goto error_exit; |
| 514 | } |
| 515 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 516 | ACPI_MEMCPY(internal_object->buffer.pointer, |
| 517 | external_object->buffer.pointer, |
| 518 | external_object->buffer.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | |
| 520 | internal_object->buffer.length = external_object->buffer.length; |
Bob Moore | 24a3157 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 521 | |
| 522 | /* Mark buffer data valid */ |
| 523 | |
| 524 | internal_object->buffer.flags |= AOPOBJ_DATA_VALID; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 525 | break; |
| 526 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 527 | case ACPI_TYPE_INTEGER: |
| 528 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 529 | internal_object->integer.value = external_object->integer.value; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | break; |
| 531 | |
Bob Moore | cd0b224 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 532 | case ACPI_TYPE_LOCAL_REFERENCE: |
| 533 | |
| 534 | /* TBD: should validate incoming handle */ |
| 535 | |
| 536 | internal_object->reference.opcode = AML_INT_NAMEPATH_OP; |
| 537 | internal_object->reference.node = |
| 538 | external_object->reference.handle; |
| 539 | break; |
| 540 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | default: |
| 542 | /* Other types can't get here */ |
| 543 | break; |
| 544 | } |
| 545 | |
| 546 | *ret_internal_object = internal_object; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 547 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 549 | error_exit: |
| 550 | acpi_ut_remove_reference(internal_object); |
| 551 | return_ACPI_STATUS(AE_NO_MEMORY); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | } |
| 553 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 554 | /******************************************************************************* |
| 555 | * |
| 556 | * FUNCTION: acpi_ut_copy_epackage_to_ipackage |
| 557 | * |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 558 | * PARAMETERS: external_object - The external object to be converted |
| 559 | * internal_object - Where the internal object is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 560 | * |
| 561 | * RETURN: Status |
| 562 | * |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 563 | * DESCRIPTION: Copy an external package object to an internal package. |
| 564 | * Handles nested packages. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 565 | * |
| 566 | ******************************************************************************/ |
| 567 | |
| 568 | static acpi_status |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 569 | acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, |
| 570 | union acpi_operand_object **internal_object) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 571 | { |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 572 | acpi_status status = AE_OK; |
| 573 | union acpi_operand_object *package_object; |
| 574 | union acpi_operand_object **package_elements; |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 575 | u32 i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 576 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 577 | ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 578 | |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 579 | /* Create the package object */ |
| 580 | |
| 581 | package_object = |
| 582 | acpi_ut_create_package_object(external_object->package.count); |
| 583 | if (!package_object) { |
| 584 | return_ACPI_STATUS(AE_NO_MEMORY); |
| 585 | } |
| 586 | |
| 587 | package_elements = package_object->package.elements; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 | |
| 589 | /* |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 590 | * Recursive implementation. Probably ok, since nested external packages |
| 591 | * as parameters should be very rare. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 592 | */ |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 593 | for (i = 0; i < external_object->package.count; i++) { |
| 594 | status = |
| 595 | acpi_ut_copy_eobject_to_iobject(&external_object->package. |
| 596 | elements[i], |
| 597 | &package_elements[i]); |
| 598 | if (ACPI_FAILURE(status)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 600 | /* Truncate package and delete it */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 | |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 602 | package_object->package.count = i; |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 603 | package_elements[i] = NULL; |
| 604 | acpi_ut_remove_reference(package_object); |
| 605 | return_ACPI_STATUS(status); |
| 606 | } |
| 607 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 608 | |
Bob Moore | 24a3157 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 609 | /* Mark package data valid */ |
| 610 | |
| 611 | package_object->package.flags |= AOPOBJ_DATA_VALID; |
| 612 | |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 613 | *internal_object = package_object; |
| 614 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 615 | } |
| 616 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 617 | /******************************************************************************* |
| 618 | * |
| 619 | * FUNCTION: acpi_ut_copy_eobject_to_iobject |
| 620 | * |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 621 | * PARAMETERS: external_object - The external object to be converted |
| 622 | * internal_object - Where the internal object is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 623 | * |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 624 | * RETURN: Status - the status of the call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 625 | * |
| 626 | * DESCRIPTION: Converts an external object to an internal object. |
| 627 | * |
| 628 | ******************************************************************************/ |
| 629 | |
| 630 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 631 | acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object, |
| 632 | union acpi_operand_object **internal_object) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 633 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 634 | acpi_status status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 635 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 636 | ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 637 | |
| 638 | if (external_object->type == ACPI_TYPE_PACKAGE) { |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 639 | status = |
| 640 | acpi_ut_copy_epackage_to_ipackage(external_object, |
| 641 | internal_object); |
| 642 | } else { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 643 | /* |
| 644 | * Build a simple object (no nested objects) |
| 645 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 646 | status = |
| 647 | acpi_ut_copy_esimple_to_isimple(external_object, |
| 648 | internal_object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 649 | } |
| 650 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 651 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 652 | } |
| 653 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 | /******************************************************************************* |
| 655 | * |
| 656 | * FUNCTION: acpi_ut_copy_simple_object |
| 657 | * |
| 658 | * PARAMETERS: source_desc - The internal object to be copied |
| 659 | * dest_desc - New target object |
| 660 | * |
| 661 | * RETURN: Status |
| 662 | * |
| 663 | * DESCRIPTION: Simple copy of one internal object to another. Reference count |
| 664 | * of the destination object is preserved. |
| 665 | * |
| 666 | ******************************************************************************/ |
| 667 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 668 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 669 | acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, |
| 670 | union acpi_operand_object *dest_desc) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 671 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 672 | u16 reference_count; |
| 673 | union acpi_operand_object *next_object; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | |
| 675 | /* Save fields from destination that we don't want to overwrite */ |
| 676 | |
| 677 | reference_count = dest_desc->common.reference_count; |
| 678 | next_object = dest_desc->common.next_object; |
| 679 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 680 | /* Copy the entire source object over the destination object */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 681 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 682 | ACPI_MEMCPY((char *)dest_desc, (char *)source_desc, |
| 683 | sizeof(union acpi_operand_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 684 | |
| 685 | /* Restore the saved fields */ |
| 686 | |
| 687 | dest_desc->common.reference_count = reference_count; |
| 688 | dest_desc->common.next_object = next_object; |
| 689 | |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 690 | /* New object is not static, regardless of source */ |
| 691 | |
| 692 | dest_desc->common.flags &= ~AOPOBJ_STATIC_POINTER; |
| 693 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 694 | /* Handle the objects with extra data */ |
| 695 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 696 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 697 | case ACPI_TYPE_BUFFER: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 698 | /* |
| 699 | * Allocate and copy the actual buffer if and only if: |
| 700 | * 1) There is a valid buffer pointer |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 701 | * 2) The buffer has a length > 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | */ |
| 703 | if ((source_desc->buffer.pointer) && |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 704 | (source_desc->buffer.length)) { |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 705 | dest_desc->buffer.pointer = |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 706 | ACPI_ALLOCATE(source_desc->buffer.length); |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 707 | if (!dest_desc->buffer.pointer) { |
| 708 | return (AE_NO_MEMORY); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | } |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 710 | |
| 711 | /* Copy the actual buffer data */ |
| 712 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 713 | ACPI_MEMCPY(dest_desc->buffer.pointer, |
| 714 | source_desc->buffer.pointer, |
| 715 | source_desc->buffer.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 716 | } |
| 717 | break; |
| 718 | |
| 719 | case ACPI_TYPE_STRING: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | /* |
| 721 | * Allocate and copy the actual string if and only if: |
| 722 | * 1) There is a valid string pointer |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 723 | * (Pointer to a NULL string is allowed) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | */ |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 725 | if (source_desc->string.pointer) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 726 | dest_desc->string.pointer = |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 727 | ACPI_ALLOCATE((acpi_size) source_desc->string. |
| 728 | length + 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 729 | if (!dest_desc->string.pointer) { |
| 730 | return (AE_NO_MEMORY); |
| 731 | } |
| 732 | |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 733 | /* Copy the actual string data */ |
| 734 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 735 | ACPI_MEMCPY(dest_desc->string.pointer, |
| 736 | source_desc->string.pointer, |
| 737 | (acpi_size) source_desc->string.length + 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 738 | } |
| 739 | break; |
| 740 | |
| 741 | case ACPI_TYPE_LOCAL_REFERENCE: |
| 742 | /* |
| 743 | * We copied the reference object, so we now must add a reference |
| 744 | * to the object pointed to by the reference |
Lin Ming | bc7a36a | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 745 | * |
| 746 | * DDBHandle reference (from Load/load_table is a special reference, |
| 747 | * it's Reference.Object is the table index, so does not need to |
| 748 | * increase the reference count |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 749 | */ |
Lin Ming | bc7a36a | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 750 | if (source_desc->reference.opcode == AML_LOAD_OP) { |
| 751 | break; |
| 752 | } |
| 753 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 754 | acpi_ut_add_reference(source_desc->reference.object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 755 | break; |
| 756 | |
Fiodor Suietov | 6b366e2 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 757 | case ACPI_TYPE_REGION: |
| 758 | /* |
| 759 | * We copied the Region Handler, so we now must add a reference |
| 760 | */ |
| 761 | if (dest_desc->region.handler) { |
| 762 | acpi_ut_add_reference(dest_desc->region.handler); |
| 763 | } |
| 764 | break; |
| 765 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 766 | default: |
| 767 | /* Nothing to do for other simple objects */ |
| 768 | break; |
| 769 | } |
| 770 | |
| 771 | return (AE_OK); |
| 772 | } |
| 773 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 774 | /******************************************************************************* |
| 775 | * |
| 776 | * FUNCTION: acpi_ut_copy_ielement_to_ielement |
| 777 | * |
| 778 | * PARAMETERS: acpi_pkg_callback |
| 779 | * |
| 780 | * RETURN: Status |
| 781 | * |
| 782 | * DESCRIPTION: Copy one package element to another package element |
| 783 | * |
| 784 | ******************************************************************************/ |
| 785 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 786 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 787 | acpi_ut_copy_ielement_to_ielement(u8 object_type, |
| 788 | union acpi_operand_object *source_object, |
| 789 | union acpi_generic_state *state, |
| 790 | void *context) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 791 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 792 | acpi_status status = AE_OK; |
| 793 | u32 this_index; |
| 794 | union acpi_operand_object **this_target_ptr; |
| 795 | union acpi_operand_object *target_object; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 796 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 797 | ACPI_FUNCTION_ENTRY(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 798 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 799 | this_index = state->pkg.index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 800 | this_target_ptr = (union acpi_operand_object **) |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 801 | &state->pkg.dest_object->package.elements[this_index]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 802 | |
| 803 | switch (object_type) { |
| 804 | case ACPI_COPY_TYPE_SIMPLE: |
| 805 | |
| 806 | /* A null source object indicates a (legal) null package element */ |
| 807 | |
| 808 | if (source_object) { |
| 809 | /* |
| 810 | * This is a simple object, just copy it |
| 811 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 812 | target_object = |
| 813 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE |
| 814 | (source_object)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 815 | if (!target_object) { |
| 816 | return (AE_NO_MEMORY); |
| 817 | } |
| 818 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 819 | status = |
| 820 | acpi_ut_copy_simple_object(source_object, |
| 821 | target_object); |
| 822 | if (ACPI_FAILURE(status)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 823 | goto error_exit; |
| 824 | } |
| 825 | |
| 826 | *this_target_ptr = target_object; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 827 | } else { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 828 | /* Pass through a null element */ |
| 829 | |
| 830 | *this_target_ptr = NULL; |
| 831 | } |
| 832 | break; |
| 833 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 834 | case ACPI_COPY_TYPE_PACKAGE: |
| 835 | |
| 836 | /* |
| 837 | * This object is a package - go down another nesting level |
| 838 | * Create and build the package object |
| 839 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 840 | target_object = |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 841 | acpi_ut_create_package_object(source_object->package.count); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 842 | if (!target_object) { |
| 843 | return (AE_NO_MEMORY); |
| 844 | } |
| 845 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 846 | target_object->common.flags = source_object->common.flags; |
| 847 | |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 848 | /* Pass the new package object back to the package walk routine */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 849 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 850 | state->pkg.this_target_obj = target_object; |
| 851 | |
Bob Moore | 6287ee3 | 2007-04-03 19:59:37 -0400 | [diff] [blame] | 852 | /* Store the object pointer in the parent package object */ |
| 853 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 854 | *this_target_ptr = target_object; |
| 855 | break; |
| 856 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 857 | default: |
| 858 | return (AE_BAD_PARAMETER); |
| 859 | } |
| 860 | |
| 861 | return (status); |
| 862 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 863 | error_exit: |
| 864 | acpi_ut_remove_reference(target_object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 865 | return (status); |
| 866 | } |
| 867 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 868 | /******************************************************************************* |
| 869 | * |
| 870 | * FUNCTION: acpi_ut_copy_ipackage_to_ipackage |
| 871 | * |
| 872 | * PARAMETERS: *source_obj - Pointer to the source package object |
| 873 | * *dest_obj - Where the internal object is returned |
| 874 | * |
| 875 | * RETURN: Status - the status of the call |
| 876 | * |
| 877 | * DESCRIPTION: This function is called to copy an internal package object |
| 878 | * into another internal package object. |
| 879 | * |
| 880 | ******************************************************************************/ |
| 881 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 882 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 883 | acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, |
| 884 | union acpi_operand_object *dest_obj, |
| 885 | struct acpi_walk_state *walk_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 887 | acpi_status status = AE_OK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 888 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 889 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_ipackage); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 890 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 891 | dest_obj->common.type = ACPI_GET_OBJECT_TYPE(source_obj); |
| 892 | dest_obj->common.flags = source_obj->common.flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 893 | dest_obj->package.count = source_obj->package.count; |
| 894 | |
| 895 | /* |
| 896 | * Create the object array and walk the source package tree |
| 897 | */ |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 898 | dest_obj->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size) |
| 899 | source_obj->package. |
| 900 | count + |
| 901 | 1) * sizeof(void *)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 902 | if (!dest_obj->package.elements) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 903 | ACPI_ERROR((AE_INFO, "Package allocation failure")); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 904 | return_ACPI_STATUS(AE_NO_MEMORY); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 905 | } |
| 906 | |
| 907 | /* |
| 908 | * Copy the package element-by-element by walking the package "tree". |
| 909 | * This handles nested packages of arbitrary depth. |
| 910 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 911 | status = acpi_ut_walk_package_tree(source_obj, dest_obj, |
| 912 | acpi_ut_copy_ielement_to_ielement, |
| 913 | walk_state); |
| 914 | if (ACPI_FAILURE(status)) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 915 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 916 | /* On failure, delete the destination package object */ |
| 917 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 918 | acpi_ut_remove_reference(dest_obj); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 919 | } |
| 920 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 921 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 922 | } |
| 923 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 924 | /******************************************************************************* |
| 925 | * |
| 926 | * FUNCTION: acpi_ut_copy_iobject_to_iobject |
| 927 | * |
| 928 | * PARAMETERS: walk_state - Current walk state |
| 929 | * source_desc - The internal object to be copied |
| 930 | * dest_desc - Where the copied object is returned |
| 931 | * |
| 932 | * RETURN: Status |
| 933 | * |
| 934 | * DESCRIPTION: Copy an internal object to a new internal object |
| 935 | * |
| 936 | ******************************************************************************/ |
| 937 | |
| 938 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 939 | acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, |
| 940 | union acpi_operand_object **dest_desc, |
| 941 | struct acpi_walk_state *walk_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 942 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 943 | acpi_status status = AE_OK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 944 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 945 | ACPI_FUNCTION_TRACE(ut_copy_iobject_to_iobject); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 946 | |
| 947 | /* Create the top level object */ |
| 948 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 949 | *dest_desc = |
| 950 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE(source_desc)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 951 | if (!*dest_desc) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 952 | return_ACPI_STATUS(AE_NO_MEMORY); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 953 | } |
| 954 | |
| 955 | /* Copy the object and possible subobjects */ |
| 956 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 957 | if (ACPI_GET_OBJECT_TYPE(source_desc) == ACPI_TYPE_PACKAGE) { |
| 958 | status = |
| 959 | acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc, |
| 960 | walk_state); |
| 961 | } else { |
| 962 | status = acpi_ut_copy_simple_object(source_desc, *dest_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 963 | } |
| 964 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 965 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 966 | } |