Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | /****************************************************************************** |
| 3 | * |
| 4 | * Module Name: exstore - AML Interpreter object store support |
| 5 | * |
| 6 | *****************************************************************************/ |
| 7 | |
| 8 | /* |
Len Brown | 75a44ce | 2008-04-23 23:00:13 -0400 | [diff] [blame] | 9 | * Copyright (C) 2000 - 2008, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * All rights reserved. |
| 11 | * |
| 12 | * Redistribution and use in source and binary forms, with or without |
| 13 | * modification, are permitted provided that the following conditions |
| 14 | * are met: |
| 15 | * 1. Redistributions of source code must retain the above copyright |
| 16 | * notice, this list of conditions, and the following disclaimer, |
| 17 | * without modification. |
| 18 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 19 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 20 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 21 | * including a substantially similar Disclaimer requirement for further |
| 22 | * binary redistribution. |
| 23 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 24 | * of any contributors may be used to endorse or promote products derived |
| 25 | * from this software without specific prior written permission. |
| 26 | * |
| 27 | * Alternatively, this software may be distributed under the terms of the |
| 28 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 29 | * Software Foundation. |
| 30 | * |
| 31 | * NO WARRANTY |
| 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 33 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 34 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 35 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 36 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 37 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 38 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 39 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 40 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 41 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 42 | * POSSIBILITY OF SUCH DAMAGES. |
| 43 | */ |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #include <acpi/acpi.h> |
| 46 | #include <acpi/acdispat.h> |
| 47 | #include <acpi/acinterp.h> |
| 48 | #include <acpi/amlcode.h> |
| 49 | #include <acpi/acnamesp.h> |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 50 | #include <acpi/acparser.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | #define _COMPONENT ACPI_EXECUTER |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 53 | ACPI_MODULE_NAME("exstore") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 55 | /* Local prototypes */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 56 | static void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 57 | acpi_ex_do_debug_object(union acpi_operand_object *source_desc, |
| 58 | u32 level, u32 index); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 59 | |
| 60 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 61 | acpi_ex_store_object_to_index(union acpi_operand_object *val_desc, |
| 62 | union acpi_operand_object *dest_desc, |
| 63 | struct acpi_walk_state *walk_state); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 64 | |
| 65 | /******************************************************************************* |
| 66 | * |
| 67 | * FUNCTION: acpi_ex_do_debug_object |
| 68 | * |
| 69 | * PARAMETERS: source_desc - Value to be stored |
| 70 | * Level - Indentation level (used for packages) |
| 71 | * Index - Current package element, zero if not pkg |
| 72 | * |
| 73 | * RETURN: None |
| 74 | * |
| 75 | * DESCRIPTION: Handles stores to the Debug Object. |
| 76 | * |
| 77 | ******************************************************************************/ |
| 78 | |
| 79 | static void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 80 | acpi_ex_do_debug_object(union acpi_operand_object *source_desc, |
| 81 | u32 level, u32 index) |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 82 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 83 | u32 i; |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 84 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 85 | ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 86 | |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 87 | /* Print line header as long as we are not in the middle of an object display */ |
| 88 | |
| 89 | if (!((level > 0) && index == 0)) { |
| 90 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", |
| 91 | level, " ")); |
| 92 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 93 | |
| 94 | /* Display index for package output only */ |
| 95 | |
| 96 | if (index > 0) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 97 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 98 | "(%.2u) ", index - 1)); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | if (!source_desc) { |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 102 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[Null Object]\n")); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 103 | return_VOID; |
| 104 | } |
| 105 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 106 | if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 107 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s ", |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 108 | acpi_ut_get_object_type_name |
| 109 | (source_desc))); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 110 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 111 | if (!acpi_ut_valid_internal_object(source_desc)) { |
| 112 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 113 | "%p, Invalid Internal Object!\n", |
| 114 | source_desc)); |
| 115 | return_VOID; |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 116 | } |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 117 | } else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == |
| 118 | ACPI_DESC_TYPE_NAMED) { |
| 119 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: %p\n", |
| 120 | acpi_ut_get_type_name(((struct |
| 121 | acpi_namespace_node |
| 122 | *)source_desc)-> |
| 123 | type), |
| 124 | source_desc)); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 125 | return_VOID; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 126 | } else { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 127 | return_VOID; |
| 128 | } |
| 129 | |
Bob Moore | 61ce421 | 2008-04-10 19:06:39 +0400 | [diff] [blame] | 130 | /* source_desc is of type ACPI_DESC_TYPE_OPERAND */ |
| 131 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 132 | switch (ACPI_GET_OBJECT_TYPE(source_desc)) { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 133 | case ACPI_TYPE_INTEGER: |
| 134 | |
| 135 | /* Output correct integer width */ |
| 136 | |
| 137 | if (acpi_gbl_integer_byte_width == 4) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 138 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "0x%8.8X\n", |
| 139 | (u32) source_desc->integer. |
| 140 | value)); |
| 141 | } else { |
| 142 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 143 | "0x%8.8X%8.8X\n", |
| 144 | ACPI_FORMAT_UINT64(source_desc-> |
| 145 | integer. |
| 146 | value))); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 147 | } |
| 148 | break; |
| 149 | |
| 150 | case ACPI_TYPE_BUFFER: |
| 151 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 152 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]\n", |
| 153 | (u32) source_desc->buffer.length)); |
| 154 | ACPI_DUMP_BUFFER(source_desc->buffer.pointer, |
| 155 | (source_desc->buffer.length < |
Bob Moore | 422f4f9 | 2008-04-10 19:06:37 +0400 | [diff] [blame] | 156 | 256) ? source_desc->buffer.length : 256); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 157 | break; |
| 158 | |
| 159 | case ACPI_TYPE_STRING: |
| 160 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 161 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n", |
| 162 | source_desc->string.length, |
| 163 | source_desc->string.pointer)); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 164 | break; |
| 165 | |
| 166 | case ACPI_TYPE_PACKAGE: |
| 167 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 168 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 169 | "[Contains 0x%.2X Elements]\n", |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 170 | source_desc->package.count)); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 171 | |
| 172 | /* Output the entire contents of the package */ |
| 173 | |
| 174 | for (i = 0; i < source_desc->package.count; i++) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 175 | acpi_ex_do_debug_object(source_desc->package. |
| 176 | elements[i], level + 4, i + 1); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 177 | } |
| 178 | break; |
| 179 | |
| 180 | case ACPI_TYPE_LOCAL_REFERENCE: |
| 181 | |
| 182 | if (source_desc->reference.opcode == AML_INDEX_OP) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 183 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 184 | "[%s, 0x%X]\n", |
| 185 | acpi_ps_get_opcode_name |
| 186 | (source_desc->reference.opcode), |
| 187 | source_desc->reference.offset)); |
| 188 | } else { |
Bob Moore | 61ce421 | 2008-04-10 19:06:39 +0400 | [diff] [blame] | 189 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]", |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 190 | acpi_ps_get_opcode_name |
| 191 | (source_desc->reference.opcode))); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 192 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 193 | |
Bob Moore | 61ce421 | 2008-04-10 19:06:39 +0400 | [diff] [blame] | 194 | if (source_desc->reference.opcode == AML_LOAD_OP) { /* Load and load_table */ |
| 195 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
Bob Moore | 57e664c | 2008-09-27 10:40:39 +0800 | [diff] [blame^] | 196 | " Table Index %X\n", |
| 197 | source_desc->reference.value)); |
Bob Moore | 61ce421 | 2008-04-10 19:06:39 +0400 | [diff] [blame] | 198 | break; |
| 199 | } |
| 200 | |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 201 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, " ")); |
| 202 | |
| 203 | /* Check for valid node first, then valid object */ |
| 204 | |
| 205 | if (source_desc->reference.node) { |
| 206 | if (ACPI_GET_DESCRIPTOR_TYPE |
| 207 | (source_desc->reference.node) != |
| 208 | ACPI_DESC_TYPE_NAMED) { |
| 209 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 210 | " %p - Not a valid namespace node\n", |
| 211 | source_desc->reference. |
| 212 | node)); |
| 213 | } else { |
| 214 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
| 215 | "Node %p [%4.4s] ", |
| 216 | source_desc->reference. |
| 217 | node, |
| 218 | (source_desc->reference. |
| 219 | node)->name.ascii)); |
| 220 | |
| 221 | switch ((source_desc->reference.node)->type) { |
| 222 | |
| 223 | /* These types have no attached object */ |
| 224 | |
| 225 | case ACPI_TYPE_DEVICE: |
| 226 | acpi_os_printf("Device\n"); |
| 227 | break; |
| 228 | |
| 229 | case ACPI_TYPE_THERMAL: |
| 230 | acpi_os_printf("Thermal Zone\n"); |
| 231 | break; |
| 232 | |
| 233 | default: |
| 234 | acpi_ex_do_debug_object((source_desc-> |
| 235 | reference. |
| 236 | node)->object, |
| 237 | level + 4, 0); |
| 238 | break; |
| 239 | } |
| 240 | } |
| 241 | } else if (source_desc->reference.object) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 242 | if (ACPI_GET_DESCRIPTOR_TYPE |
| 243 | (source_desc->reference.object) == |
| 244 | ACPI_DESC_TYPE_NAMED) { |
| 245 | acpi_ex_do_debug_object(((struct |
| 246 | acpi_namespace_node *) |
| 247 | source_desc->reference. |
| 248 | object)->object, |
| 249 | level + 4, 0); |
| 250 | } else { |
| 251 | acpi_ex_do_debug_object(source_desc->reference. |
| 252 | object, level + 4, 0); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 253 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 254 | } |
| 255 | break; |
| 256 | |
| 257 | default: |
| 258 | |
Bob Moore | d884657 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 259 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p\n", |
| 260 | source_desc)); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 261 | break; |
| 262 | } |
| 263 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 264 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "\n")); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 265 | return_VOID; |
| 266 | } |
| 267 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | /******************************************************************************* |
| 269 | * |
| 270 | * FUNCTION: acpi_ex_store |
| 271 | * |
| 272 | * PARAMETERS: *source_desc - Value to be stored |
| 273 | * *dest_desc - Where to store it. Must be an NS node |
| 274 | * or an union acpi_operand_object of type |
| 275 | * Reference; |
| 276 | * walk_state - Current walk state |
| 277 | * |
| 278 | * RETURN: Status |
| 279 | * |
| 280 | * DESCRIPTION: Store the value described by source_desc into the location |
| 281 | * described by dest_desc. Called by various interpreter |
| 282 | * functions to store the result of an operation into |
| 283 | * the destination operand -- not just simply the actual "Store" |
| 284 | * ASL operator. |
| 285 | * |
| 286 | ******************************************************************************/ |
| 287 | |
| 288 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 289 | acpi_ex_store(union acpi_operand_object *source_desc, |
| 290 | union acpi_operand_object *dest_desc, |
| 291 | struct acpi_walk_state *walk_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 293 | acpi_status status = AE_OK; |
| 294 | union acpi_operand_object *ref_desc = dest_desc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 296 | ACPI_FUNCTION_TRACE_PTR(ex_store, dest_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | |
| 298 | /* Validate parameters */ |
| 299 | |
| 300 | if (!source_desc || !dest_desc) { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 301 | ACPI_ERROR((AE_INFO, "Null parameter")); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 302 | return_ACPI_STATUS(AE_AML_NO_OPERAND); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | /* dest_desc can be either a namespace node or an ACPI object */ |
| 306 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 307 | if (ACPI_GET_DESCRIPTOR_TYPE(dest_desc) == ACPI_DESC_TYPE_NAMED) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | /* |
| 309 | * Dest is a namespace node, |
| 310 | * Storing an object into a Named node. |
| 311 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 312 | status = acpi_ex_store_object_to_node(source_desc, |
| 313 | (struct |
| 314 | acpi_namespace_node *) |
| 315 | dest_desc, walk_state, |
| 316 | ACPI_IMPLICIT_CONVERSION); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 318 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | /* Destination object must be a Reference or a Constant object */ |
| 322 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 323 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | case ACPI_TYPE_LOCAL_REFERENCE: |
| 325 | break; |
| 326 | |
| 327 | case ACPI_TYPE_INTEGER: |
| 328 | |
| 329 | /* Allow stores to Constants -- a Noop as per ACPI spec */ |
| 330 | |
| 331 | if (dest_desc->common.flags & AOPOBJ_AML_CONSTANT) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 332 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | /*lint -fallthrough */ |
| 336 | |
| 337 | default: |
| 338 | |
| 339 | /* Destination is not a Reference object */ |
| 340 | |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 341 | ACPI_ERROR((AE_INFO, |
| 342 | "Target is not a Reference or Constant object - %s [%p]", |
| 343 | acpi_ut_get_object_type_name(dest_desc), |
| 344 | dest_desc)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 346 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | /* |
| 350 | * Examine the Reference opcode. These cases are handled: |
| 351 | * |
| 352 | * 1) Store to Name (Change the object associated with a name) |
| 353 | * 2) Store to an indexed area of a Buffer or Package |
| 354 | * 3) Store to a Method Local or Arg |
| 355 | * 4) Store to the debug object |
| 356 | */ |
| 357 | switch (ref_desc->reference.opcode) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | case AML_REF_OF_OP: |
| 359 | |
| 360 | /* Storing an object into a Name "container" */ |
| 361 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 362 | status = acpi_ex_store_object_to_node(source_desc, |
| 363 | ref_desc->reference. |
| 364 | object, walk_state, |
| 365 | ACPI_IMPLICIT_CONVERSION); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | break; |
| 367 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | case AML_INDEX_OP: |
| 369 | |
| 370 | /* Storing to an Index (pointer into a packager or buffer) */ |
| 371 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 372 | status = |
| 373 | acpi_ex_store_object_to_index(source_desc, ref_desc, |
| 374 | walk_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | break; |
| 376 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | case AML_LOCAL_OP: |
| 378 | case AML_ARG_OP: |
| 379 | |
| 380 | /* Store to a method local/arg */ |
| 381 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 382 | status = |
| 383 | acpi_ds_store_object_to_local(ref_desc->reference.opcode, |
| 384 | ref_desc->reference.offset, |
| 385 | source_desc, walk_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | break; |
| 387 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | case AML_DEBUG_OP: |
| 389 | |
| 390 | /* |
| 391 | * Storing to the Debug object causes the value stored to be |
| 392 | * displayed and otherwise has no effect -- see ACPI Specification |
| 393 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 394 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
| 395 | "**** Write to Debug Object: Object %p %s ****:\n\n", |
| 396 | source_desc, |
| 397 | acpi_ut_get_object_type_name(source_desc))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 399 | acpi_ex_do_debug_object(source_desc, 0, 0); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 400 | break; |
| 401 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | default: |
| 403 | |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 404 | ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", |
| 405 | ref_desc->reference.opcode)); |
Bob Moore | 23d3e05 | 2008-09-28 15:00:47 +0800 | [diff] [blame] | 406 | ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_INFO); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | |
| 408 | status = AE_AML_INTERNAL; |
| 409 | break; |
| 410 | } |
| 411 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 412 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | } |
| 414 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 415 | /******************************************************************************* |
| 416 | * |
| 417 | * FUNCTION: acpi_ex_store_object_to_index |
| 418 | * |
| 419 | * PARAMETERS: *source_desc - Value to be stored |
| 420 | * *dest_desc - Named object to receive the value |
| 421 | * walk_state - Current walk state |
| 422 | * |
| 423 | * RETURN: Status |
| 424 | * |
| 425 | * DESCRIPTION: Store the object to indexed Buffer or Package element |
| 426 | * |
| 427 | ******************************************************************************/ |
| 428 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 429 | static acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 430 | acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, |
| 431 | union acpi_operand_object *index_desc, |
| 432 | struct acpi_walk_state *walk_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 433 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 434 | acpi_status status = AE_OK; |
| 435 | union acpi_operand_object *obj_desc; |
| 436 | union acpi_operand_object *new_desc; |
| 437 | u8 value = 0; |
| 438 | u32 i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 440 | ACPI_FUNCTION_TRACE(ex_store_object_to_index); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | |
| 442 | /* |
| 443 | * Destination must be a reference pointer, and |
| 444 | * must point to either a buffer or a package |
| 445 | */ |
| 446 | switch (index_desc->reference.target_type) { |
| 447 | case ACPI_TYPE_PACKAGE: |
| 448 | /* |
| 449 | * Storing to a package element. Copy the object and replace |
| 450 | * any existing object with the new object. No implicit |
| 451 | * conversion is performed. |
| 452 | * |
| 453 | * The object at *(index_desc->Reference.Where) is the |
| 454 | * element within the package that is to be modified. |
| 455 | * The parent package object is at index_desc->Reference.Object |
| 456 | */ |
| 457 | obj_desc = *(index_desc->reference.where); |
| 458 | |
Lin Ming | bc7a36a | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 459 | if (ACPI_GET_OBJECT_TYPE(source_desc) == |
| 460 | ACPI_TYPE_LOCAL_REFERENCE |
| 461 | && source_desc->reference.opcode == AML_LOAD_OP) { |
| 462 | |
| 463 | /* This is a DDBHandle, just add a reference to it */ |
| 464 | |
| 465 | acpi_ut_add_reference(source_desc); |
| 466 | new_desc = source_desc; |
| 467 | } else { |
| 468 | /* Normal object, copy it */ |
| 469 | |
| 470 | status = |
| 471 | acpi_ut_copy_iobject_to_iobject(source_desc, |
| 472 | &new_desc, |
| 473 | walk_state); |
| 474 | if (ACPI_FAILURE(status)) { |
| 475 | return_ACPI_STATUS(status); |
| 476 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | if (obj_desc) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 480 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | /* Decrement reference count by the ref count of the parent package */ |
| 482 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 483 | for (i = 0; i < ((union acpi_operand_object *) |
| 484 | index_desc->reference.object)->common. |
| 485 | reference_count; i++) { |
| 486 | acpi_ut_remove_reference(obj_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 487 | } |
| 488 | } |
| 489 | |
| 490 | *(index_desc->reference.where) = new_desc; |
| 491 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 492 | /* Increment ref count by the ref count of the parent package-1 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 494 | for (i = 1; i < ((union acpi_operand_object *) |
| 495 | index_desc->reference.object)->common. |
| 496 | reference_count; i++) { |
| 497 | acpi_ut_add_reference(new_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | } |
| 499 | |
| 500 | break; |
| 501 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | case ACPI_TYPE_BUFFER_FIELD: |
| 503 | |
| 504 | /* |
| 505 | * Store into a Buffer or String (not actually a real buffer_field) |
| 506 | * at a location defined by an Index. |
| 507 | * |
| 508 | * The first 8-bit element of the source object is written to the |
| 509 | * 8-bit Buffer location defined by the Index destination object, |
| 510 | * according to the ACPI 2.0 specification. |
| 511 | */ |
| 512 | |
| 513 | /* |
| 514 | * Make sure the target is a Buffer or String. An error should |
| 515 | * not happen here, since the reference_object was constructed |
| 516 | * by the INDEX_OP code. |
| 517 | */ |
| 518 | obj_desc = index_desc->reference.object; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 519 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_BUFFER) && |
| 520 | (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_STRING)) { |
| 521 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | /* |
| 525 | * The assignment of the individual elements will be slightly |
| 526 | * different for each source type. |
| 527 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 528 | switch (ACPI_GET_OBJECT_TYPE(source_desc)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 529 | case ACPI_TYPE_INTEGER: |
| 530 | |
| 531 | /* Use the least-significant byte of the integer */ |
| 532 | |
| 533 | value = (u8) (source_desc->integer.value); |
| 534 | break; |
| 535 | |
| 536 | case ACPI_TYPE_BUFFER: |
| 537 | case ACPI_TYPE_STRING: |
| 538 | |
| 539 | /* Note: Takes advantage of common string/buffer fields */ |
| 540 | |
| 541 | value = source_desc->buffer.pointer[0]; |
| 542 | break; |
| 543 | |
| 544 | default: |
| 545 | |
| 546 | /* All other types are invalid */ |
| 547 | |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 548 | ACPI_ERROR((AE_INFO, |
| 549 | "Source must be Integer/Buffer/String type, not %s", |
| 550 | acpi_ut_get_object_type_name(source_desc))); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 551 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | } |
| 553 | |
| 554 | /* Store the source value into the target buffer byte */ |
| 555 | |
| 556 | obj_desc->buffer.pointer[index_desc->reference.offset] = value; |
| 557 | break; |
| 558 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 559 | default: |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 560 | ACPI_ERROR((AE_INFO, "Target is not a Package or BufferField")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | status = AE_AML_OPERAND_TYPE; |
| 562 | break; |
| 563 | } |
| 564 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 565 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 566 | } |
| 567 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 | /******************************************************************************* |
| 569 | * |
| 570 | * FUNCTION: acpi_ex_store_object_to_node |
| 571 | * |
| 572 | * PARAMETERS: source_desc - Value to be stored |
| 573 | * Node - Named object to receive the value |
| 574 | * walk_state - Current walk state |
| 575 | * implicit_conversion - Perform implicit conversion (yes/no) |
| 576 | * |
| 577 | * RETURN: Status |
| 578 | * |
| 579 | * DESCRIPTION: Store the object to the named object. |
| 580 | * |
| 581 | * The Assignment of an object to a named object is handled here |
| 582 | * The value passed in will replace the current value (if any) |
| 583 | * with the input value. |
| 584 | * |
| 585 | * When storing into an object the data is converted to the |
| 586 | * target object type then stored in the object. This means |
| 587 | * that the target object type (for an initialized target) will |
| 588 | * not be changed by a store operation. |
| 589 | * |
| 590 | * Assumes parameters are already validated. |
| 591 | * |
| 592 | ******************************************************************************/ |
| 593 | |
| 594 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 595 | acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, |
| 596 | struct acpi_namespace_node *node, |
| 597 | struct acpi_walk_state *walk_state, |
| 598 | u8 implicit_conversion) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 600 | acpi_status status = AE_OK; |
| 601 | union acpi_operand_object *target_desc; |
| 602 | union acpi_operand_object *new_desc; |
| 603 | acpi_object_type target_type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 604 | |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 605 | ACPI_FUNCTION_TRACE_PTR(ex_store_object_to_node, source_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 606 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 607 | /* Get current type of the node, and object attached to Node */ |
| 608 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 609 | target_type = acpi_ns_get_type(node); |
| 610 | target_desc = acpi_ns_get_attached_object(node); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 612 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n", |
| 613 | source_desc, |
| 614 | acpi_ut_get_object_type_name(source_desc), node, |
| 615 | acpi_ut_get_type_name(target_type))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 616 | |
| 617 | /* |
| 618 | * Resolve the source object to an actual value |
| 619 | * (If it is a reference object) |
| 620 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 621 | status = acpi_ex_resolve_object(&source_desc, target_type, walk_state); |
| 622 | if (ACPI_FAILURE(status)) { |
| 623 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 624 | } |
| 625 | |
| 626 | /* If no implicit conversion, drop into the default case below */ |
| 627 | |
Lin Ming | a3df4da | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 628 | if ((!implicit_conversion) || |
| 629 | ((walk_state->opcode == AML_COPY_OP) && |
| 630 | (target_type != ACPI_TYPE_LOCAL_REGION_FIELD) && |
| 631 | (target_type != ACPI_TYPE_LOCAL_BANK_FIELD) && |
| 632 | (target_type != ACPI_TYPE_LOCAL_INDEX_FIELD))) { |
| 633 | /* |
| 634 | * Force execution of default (no implicit conversion). Note: |
| 635 | * copy_object does not perform an implicit conversion, as per the ACPI |
| 636 | * spec -- except in case of region/bank/index fields -- because these |
| 637 | * objects must retain their original type permanently. |
| 638 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 639 | target_type = ACPI_TYPE_ANY; |
| 640 | } |
| 641 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 642 | /* Do the actual store operation */ |
| 643 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 644 | switch (target_type) { |
| 645 | case ACPI_TYPE_BUFFER_FIELD: |
| 646 | case ACPI_TYPE_LOCAL_REGION_FIELD: |
| 647 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
| 648 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
| 649 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 650 | /* For fields, copy the source data to the target field. */ |
| 651 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 652 | status = acpi_ex_write_data_to_field(source_desc, target_desc, |
| 653 | &walk_state->result_obj); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 | break; |
| 655 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 656 | case ACPI_TYPE_INTEGER: |
| 657 | case ACPI_TYPE_STRING: |
| 658 | case ACPI_TYPE_BUFFER: |
| 659 | |
| 660 | /* |
| 661 | * These target types are all of type Integer/String/Buffer, and |
| 662 | * therefore support implicit conversion before the store. |
| 663 | * |
| 664 | * Copy and/or convert the source object to a new target object |
| 665 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 666 | status = |
| 667 | acpi_ex_store_object_to_object(source_desc, target_desc, |
| 668 | &new_desc, walk_state); |
| 669 | if (ACPI_FAILURE(status)) { |
| 670 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 671 | } |
| 672 | |
| 673 | if (new_desc != target_desc) { |
| 674 | /* |
| 675 | * Store the new new_desc as the new value of the Name, and set |
| 676 | * the Name's type to that of the value being stored in it. |
| 677 | * source_desc reference count is incremented by attach_object. |
| 678 | * |
| 679 | * Note: This may change the type of the node if an explicit store |
| 680 | * has been performed such that the node/object type has been |
| 681 | * changed. |
| 682 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 683 | status = |
| 684 | acpi_ns_attach_object(node, new_desc, |
| 685 | new_desc->common.type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 686 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 687 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
| 688 | "Store %s into %s via Convert/Attach\n", |
| 689 | acpi_ut_get_object_type_name |
| 690 | (source_desc), |
| 691 | acpi_ut_get_object_type_name |
| 692 | (new_desc))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | } |
| 694 | break; |
| 695 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 | default: |
| 697 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 698 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
| 699 | "Storing %s (%p) directly into node (%p) with no implicit conversion\n", |
| 700 | acpi_ut_get_object_type_name(source_desc), |
| 701 | source_desc, node)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | |
| 703 | /* No conversions for all other types. Just attach the source object */ |
| 704 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 705 | status = acpi_ns_attach_object(node, source_desc, |
| 706 | ACPI_GET_OBJECT_TYPE |
| 707 | (source_desc)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 708 | break; |
| 709 | } |
| 710 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 711 | return_ACPI_STATUS(status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 712 | } |