aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exresolv.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/executer/exresolv.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exresolv.c')
-rw-r--r--drivers/acpi/executer/exresolv.c284
1 files changed, 136 insertions, 148 deletions
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 3de45672379a..97eecbd3242d 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -42,7 +42,6 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45
46#include <acpi/acpi.h> 45#include <acpi/acpi.h>
47#include <acpi/amlcode.h> 46#include <acpi/amlcode.h>
48#include <acpi/acdispat.h> 47#include <acpi/acdispat.h>
@@ -50,17 +49,13 @@
50#include <acpi/acnamesp.h> 49#include <acpi/acnamesp.h>
51#include <acpi/acparser.h> 50#include <acpi/acparser.h>
52 51
53
54#define _COMPONENT ACPI_EXECUTER 52#define _COMPONENT ACPI_EXECUTER
55 ACPI_MODULE_NAME ("exresolv") 53ACPI_MODULE_NAME("exresolv")
56 54
57/* Local prototypes */ 55/* Local prototypes */
58
59static acpi_status 56static acpi_status
60acpi_ex_resolve_object_to_value ( 57acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
61 union acpi_operand_object **stack_ptr, 58 struct acpi_walk_state *walk_state);
62 struct acpi_walk_state *walk_state);
63
64 59
65/******************************************************************************* 60/*******************************************************************************
66 * 61 *
@@ -78,19 +73,16 @@ acpi_ex_resolve_object_to_value (
78 ******************************************************************************/ 73 ******************************************************************************/
79 74
80acpi_status 75acpi_status
81acpi_ex_resolve_to_value ( 76acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
82 union acpi_operand_object **stack_ptr, 77 struct acpi_walk_state *walk_state)
83 struct acpi_walk_state *walk_state)
84{ 78{
85 acpi_status status; 79 acpi_status status;
86
87
88 ACPI_FUNCTION_TRACE_PTR ("ex_resolve_to_value", stack_ptr);
89 80
81 ACPI_FUNCTION_TRACE_PTR("ex_resolve_to_value", stack_ptr);
90 82
91 if (!stack_ptr || !*stack_ptr) { 83 if (!stack_ptr || !*stack_ptr) {
92 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n")); 84 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Internal - null pointer\n"));
93 return_ACPI_STATUS (AE_AML_NO_OPERAND); 85 return_ACPI_STATUS(AE_AML_NO_OPERAND);
94 } 86 }
95 87
96 /* 88 /*
@@ -98,15 +90,16 @@ acpi_ex_resolve_to_value (
98 * 1) A valid union acpi_operand_object, or 90 * 1) A valid union acpi_operand_object, or
99 * 2) A struct acpi_namespace_node (named_obj) 91 * 2) A struct acpi_namespace_node (named_obj)
100 */ 92 */
101 if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_OPERAND) { 93 if (ACPI_GET_DESCRIPTOR_TYPE(*stack_ptr) == ACPI_DESC_TYPE_OPERAND) {
102 status = acpi_ex_resolve_object_to_value (stack_ptr, walk_state); 94 status = acpi_ex_resolve_object_to_value(stack_ptr, walk_state);
103 if (ACPI_FAILURE (status)) { 95 if (ACPI_FAILURE(status)) {
104 return_ACPI_STATUS (status); 96 return_ACPI_STATUS(status);
105 } 97 }
106 98
107 if (!*stack_ptr) { 99 if (!*stack_ptr) {
108 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n")); 100 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
109 return_ACPI_STATUS (AE_AML_NO_OPERAND); 101 "Internal - null pointer\n"));
102 return_ACPI_STATUS(AE_AML_NO_OPERAND);
110 } 103 }
111 } 104 }
112 105
@@ -114,20 +107,20 @@ acpi_ex_resolve_to_value (
114 * Object on the stack may have changed if acpi_ex_resolve_object_to_value() 107 * Object on the stack may have changed if acpi_ex_resolve_object_to_value()
115 * was called (i.e., we can't use an _else_ here.) 108 * was called (i.e., we can't use an _else_ here.)
116 */ 109 */
117 if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_NAMED) { 110 if (ACPI_GET_DESCRIPTOR_TYPE(*stack_ptr) == ACPI_DESC_TYPE_NAMED) {
118 status = acpi_ex_resolve_node_to_value ( 111 status =
119 ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, stack_ptr), 112 acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR
120 walk_state); 113 (struct acpi_namespace_node,
121 if (ACPI_FAILURE (status)) { 114 stack_ptr), walk_state);
122 return_ACPI_STATUS (status); 115 if (ACPI_FAILURE(status)) {
116 return_ACPI_STATUS(status);
123 } 117 }
124 } 118 }
125 119
126 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr)); 120 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr));
127 return_ACPI_STATUS (AE_OK); 121 return_ACPI_STATUS(AE_OK);
128} 122}
129 123
130
131/******************************************************************************* 124/*******************************************************************************
132 * 125 *
133 * FUNCTION: acpi_ex_resolve_object_to_value 126 * FUNCTION: acpi_ex_resolve_object_to_value
@@ -143,25 +136,22 @@ acpi_ex_resolve_to_value (
143 ******************************************************************************/ 136 ******************************************************************************/
144 137
145static acpi_status 138static acpi_status
146acpi_ex_resolve_object_to_value ( 139acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
147 union acpi_operand_object **stack_ptr, 140 struct acpi_walk_state *walk_state)
148 struct acpi_walk_state *walk_state)
149{ 141{
150 acpi_status status = AE_OK; 142 acpi_status status = AE_OK;
151 union acpi_operand_object *stack_desc; 143 union acpi_operand_object *stack_desc;
152 void *temp_node; 144 void *temp_node;
153 union acpi_operand_object *obj_desc; 145 union acpi_operand_object *obj_desc;
154 u16 opcode; 146 u16 opcode;
155
156
157 ACPI_FUNCTION_TRACE ("ex_resolve_object_to_value");
158 147
148 ACPI_FUNCTION_TRACE("ex_resolve_object_to_value");
159 149
160 stack_desc = *stack_ptr; 150 stack_desc = *stack_ptr;
161 151
162 /* This is an union acpi_operand_object */ 152 /* This is an union acpi_operand_object */
163 153
164 switch (ACPI_GET_OBJECT_TYPE (stack_desc)) { 154 switch (ACPI_GET_OBJECT_TYPE(stack_desc)) {
165 case ACPI_TYPE_LOCAL_REFERENCE: 155 case ACPI_TYPE_LOCAL_REFERENCE:
166 156
167 opcode = stack_desc->reference.opcode; 157 opcode = stack_desc->reference.opcode;
@@ -177,14 +167,13 @@ acpi_ex_resolve_object_to_value (
177 167
178 /* Delete the Reference Object */ 168 /* Delete the Reference Object */
179 169
180 acpi_ut_remove_reference (stack_desc); 170 acpi_ut_remove_reference(stack_desc);
181 171
182 /* Return the namespace node */ 172 /* Return the namespace node */
183 173
184 (*stack_ptr) = temp_node; 174 (*stack_ptr) = temp_node;
185 break; 175 break;
186 176
187
188 case AML_LOCAL_OP: 177 case AML_LOCAL_OP:
189 case AML_ARG_OP: 178 case AML_ARG_OP:
190 179
@@ -192,24 +181,28 @@ acpi_ex_resolve_object_to_value (
192 * Get the local from the method's state info 181 * Get the local from the method's state info
193 * Note: this increments the local's object reference count 182 * Note: this increments the local's object reference count
194 */ 183 */
195 status = acpi_ds_method_data_get_value (opcode, 184 status = acpi_ds_method_data_get_value(opcode,
196 stack_desc->reference.offset, walk_state, &obj_desc); 185 stack_desc->
197 if (ACPI_FAILURE (status)) { 186 reference.offset,
198 return_ACPI_STATUS (status); 187 walk_state,
188 &obj_desc);
189 if (ACPI_FAILURE(status)) {
190 return_ACPI_STATUS(status);
199 } 191 }
200 192
201 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %X] value_obj is %p\n", 193 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
202 stack_desc->reference.offset, obj_desc)); 194 "[Arg/Local %X] value_obj is %p\n",
195 stack_desc->reference.offset,
196 obj_desc));
203 197
204 /* 198 /*
205 * Now we can delete the original Reference Object and 199 * Now we can delete the original Reference Object and
206 * replace it with the resolved value 200 * replace it with the resolved value
207 */ 201 */
208 acpi_ut_remove_reference (stack_desc); 202 acpi_ut_remove_reference(stack_desc);
209 *stack_ptr = obj_desc; 203 *stack_ptr = obj_desc;
210 break; 204 break;
211 205
212
213 case AML_INDEX_OP: 206 case AML_INDEX_OP:
214 207
215 switch (stack_desc->reference.target_type) { 208 switch (stack_desc->reference.target_type) {
@@ -218,7 +211,6 @@ acpi_ex_resolve_object_to_value (
218 /* Just return - leave the Reference on the stack */ 211 /* Just return - leave the Reference on the stack */
219 break; 212 break;
220 213
221
222 case ACPI_TYPE_PACKAGE: 214 case ACPI_TYPE_PACKAGE:
223 215
224 obj_desc = *stack_desc->reference.where; 216 obj_desc = *stack_desc->reference.where;
@@ -228,36 +220,31 @@ acpi_ex_resolve_object_to_value (
228 * (i.e., dereference the package index) 220 * (i.e., dereference the package index)
229 * Delete the ref object, increment the returned object 221 * Delete the ref object, increment the returned object
230 */ 222 */
231 acpi_ut_remove_reference (stack_desc); 223 acpi_ut_remove_reference(stack_desc);
232 acpi_ut_add_reference (obj_desc); 224 acpi_ut_add_reference(obj_desc);
233 *stack_ptr = obj_desc; 225 *stack_ptr = obj_desc;
234 } 226 } else {
235 else {
236 /* 227 /*
237 * A NULL object descriptor means an unitialized element of 228 * A NULL object descriptor means an unitialized element of
238 * the package, can't dereference it 229 * the package, can't dereference it
239 */ 230 */
240 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 231 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
241 "Attempt to deref an Index to NULL pkg element Idx=%p\n", 232 "Attempt to deref an Index to NULL pkg element Idx=%p\n",
242 stack_desc)); 233 stack_desc));
243 status = AE_AML_UNINITIALIZED_ELEMENT; 234 status = AE_AML_UNINITIALIZED_ELEMENT;
244 } 235 }
245 break; 236 break;
246 237
247
248 default: 238 default:
249 239
250 /* Invalid reference object */ 240 /* Invalid reference object */
251 241
252 ACPI_REPORT_ERROR (( 242 ACPI_REPORT_ERROR(("During resolve, Unknown target_type %X in Index/Reference obj %p\n", stack_desc->reference.target_type, stack_desc));
253 "During resolve, Unknown target_type %X in Index/Reference obj %p\n",
254 stack_desc->reference.target_type, stack_desc));
255 status = AE_AML_INTERNAL; 243 status = AE_AML_INTERNAL;
256 break; 244 break;
257 } 245 }
258 break; 246 break;
259 247
260
261 case AML_REF_OF_OP: 248 case AML_REF_OF_OP:
262 case AML_DEBUG_OP: 249 case AML_DEBUG_OP:
263 case AML_LOAD_OP: 250 case AML_LOAD_OP:
@@ -266,60 +253,58 @@ acpi_ex_resolve_object_to_value (
266 253
267 break; 254 break;
268 255
269 case AML_INT_NAMEPATH_OP: /* Reference to a named object */ 256 case AML_INT_NAMEPATH_OP: /* Reference to a named object */
270 257
271 /* Get the object pointed to by the namespace node */ 258 /* Get the object pointed to by the namespace node */
272 259
273 *stack_ptr = (stack_desc->reference.node)->object; 260 *stack_ptr = (stack_desc->reference.node)->object;
274 acpi_ut_add_reference (*stack_ptr); 261 acpi_ut_add_reference(*stack_ptr);
275 acpi_ut_remove_reference (stack_desc); 262 acpi_ut_remove_reference(stack_desc);
276 break; 263 break;
277 264
278 default: 265 default:
279 266
280 ACPI_REPORT_ERROR (( 267 ACPI_REPORT_ERROR(("During resolve, Unknown Reference opcode %X (%s) in %p\n", opcode, acpi_ps_get_opcode_name(opcode), stack_desc));
281 "During resolve, Unknown Reference opcode %X (%s) in %p\n",
282 opcode, acpi_ps_get_opcode_name (opcode), stack_desc));
283 status = AE_AML_INTERNAL; 268 status = AE_AML_INTERNAL;
284 break; 269 break;
285 } 270 }
286 break; 271 break;
287 272
288
289 case ACPI_TYPE_BUFFER: 273 case ACPI_TYPE_BUFFER:
290 274
291 status = acpi_ds_get_buffer_arguments (stack_desc); 275 status = acpi_ds_get_buffer_arguments(stack_desc);
292 break; 276 break;
293 277
294
295 case ACPI_TYPE_PACKAGE: 278 case ACPI_TYPE_PACKAGE:
296 279
297 status = acpi_ds_get_package_arguments (stack_desc); 280 status = acpi_ds_get_package_arguments(stack_desc);
298 break; 281 break;
299 282
300 283 /* These cases may never happen here, but just in case.. */
301 /* These cases may never happen here, but just in case.. */
302 284
303 case ACPI_TYPE_BUFFER_FIELD: 285 case ACPI_TYPE_BUFFER_FIELD:
304 case ACPI_TYPE_LOCAL_REGION_FIELD: 286 case ACPI_TYPE_LOCAL_REGION_FIELD:
305 case ACPI_TYPE_LOCAL_BANK_FIELD: 287 case ACPI_TYPE_LOCAL_BANK_FIELD:
306 case ACPI_TYPE_LOCAL_INDEX_FIELD: 288 case ACPI_TYPE_LOCAL_INDEX_FIELD:
307 289
308 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "field_read source_desc=%p Type=%X\n", 290 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
309 stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc))); 291 "field_read source_desc=%p Type=%X\n",
292 stack_desc,
293 ACPI_GET_OBJECT_TYPE(stack_desc)));
310 294
311 status = acpi_ex_read_data_from_field (walk_state, stack_desc, &obj_desc); 295 status =
312 *stack_ptr = (void *) obj_desc; 296 acpi_ex_read_data_from_field(walk_state, stack_desc,
297 &obj_desc);
298 *stack_ptr = (void *)obj_desc;
313 break; 299 break;
314 300
315 default: 301 default:
316 break; 302 break;
317 } 303 }
318 304
319 return_ACPI_STATUS (status); 305 return_ACPI_STATUS(status);
320} 306}
321 307
322
323/******************************************************************************* 308/*******************************************************************************
324 * 309 *
325 * FUNCTION: acpi_ex_resolve_multiple 310 * FUNCTION: acpi_ex_resolve_multiple
@@ -337,42 +322,44 @@ acpi_ex_resolve_object_to_value (
337 ******************************************************************************/ 322 ******************************************************************************/
338 323
339acpi_status 324acpi_status
340acpi_ex_resolve_multiple ( 325acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
341 struct acpi_walk_state *walk_state, 326 union acpi_operand_object *operand,
342 union acpi_operand_object *operand, 327 acpi_object_type * return_type,
343 acpi_object_type *return_type, 328 union acpi_operand_object **return_desc)
344 union acpi_operand_object **return_desc)
345{ 329{
346 union acpi_operand_object *obj_desc = (void *) operand; 330 union acpi_operand_object *obj_desc = (void *)operand;
347 struct acpi_namespace_node *node; 331 struct acpi_namespace_node *node;
348 acpi_object_type type; 332 acpi_object_type type;
349 acpi_status status; 333 acpi_status status;
350
351
352 ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple");
353 334
335 ACPI_FUNCTION_TRACE("acpi_ex_resolve_multiple");
354 336
355 /* Operand can be either a namespace node or an operand descriptor */ 337 /* Operand can be either a namespace node or an operand descriptor */
356 338
357 switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { 339 switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
358 case ACPI_DESC_TYPE_OPERAND: 340 case ACPI_DESC_TYPE_OPERAND:
359 type = obj_desc->common.type; 341 type = obj_desc->common.type;
360 break; 342 break;
361 343
362 case ACPI_DESC_TYPE_NAMED: 344 case ACPI_DESC_TYPE_NAMED:
363 type = ((struct acpi_namespace_node *) obj_desc)->type; 345 type = ((struct acpi_namespace_node *)obj_desc)->type;
364 obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc); 346 obj_desc =
347 acpi_ns_get_attached_object((struct acpi_namespace_node *)
348 obj_desc);
365 349
366 /* If we had an Alias node, use the attached object for type info */ 350 /* If we had an Alias node, use the attached object for type info */
367 351
368 if (type == ACPI_TYPE_LOCAL_ALIAS) { 352 if (type == ACPI_TYPE_LOCAL_ALIAS) {
369 type = ((struct acpi_namespace_node *) obj_desc)->type; 353 type = ((struct acpi_namespace_node *)obj_desc)->type;
370 obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc); 354 obj_desc =
355 acpi_ns_get_attached_object((struct
356 acpi_namespace_node *)
357 obj_desc);
371 } 358 }
372 break; 359 break;
373 360
374 default: 361 default:
375 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); 362 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
376 } 363 }
377 364
378 /* If type is anything other than a reference, we are done */ 365 /* If type is anything other than a reference, we are done */
@@ -387,7 +374,7 @@ acpi_ex_resolve_multiple (
387 * of the object_type and size_of operators). This means traversing 374 * of the object_type and size_of operators). This means traversing
388 * the list of possibly many nested references. 375 * the list of possibly many nested references.
389 */ 376 */
390 while (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { 377 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
391 switch (obj_desc->reference.opcode) { 378 switch (obj_desc->reference.opcode) {
392 case AML_REF_OF_OP: 379 case AML_REF_OF_OP:
393 380
@@ -397,31 +384,29 @@ acpi_ex_resolve_multiple (
397 384
398 /* All "References" point to a NS node */ 385 /* All "References" point to a NS node */
399 386
400 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { 387 if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
401 ACPI_REPORT_ERROR (( 388 ACPI_DESC_TYPE_NAMED) {
402 "acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", 389 ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", node, acpi_ut_get_descriptor_name(node)));
403 node, acpi_ut_get_descriptor_name (node))); 390 return_ACPI_STATUS(AE_AML_INTERNAL);
404 return_ACPI_STATUS (AE_AML_INTERNAL);
405 } 391 }
406 392
407 /* Get the attached object */ 393 /* Get the attached object */
408 394
409 obj_desc = acpi_ns_get_attached_object (node); 395 obj_desc = acpi_ns_get_attached_object(node);
410 if (!obj_desc) { 396 if (!obj_desc) {
411 /* No object, use the NS node type */ 397 /* No object, use the NS node type */
412 398
413 type = acpi_ns_get_type (node); 399 type = acpi_ns_get_type(node);
414 goto exit; 400 goto exit;
415 } 401 }
416 402
417 /* Check for circular references */ 403 /* Check for circular references */
418 404
419 if (obj_desc == operand) { 405 if (obj_desc == operand) {
420 return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); 406 return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
421 } 407 }
422 break; 408 break;
423 409
424
425 case AML_INDEX_OP: 410 case AML_INDEX_OP:
426 411
427 /* Get the type of this reference (index into another object) */ 412 /* Get the type of this reference (index into another object) */
@@ -442,12 +427,11 @@ acpi_ex_resolve_multiple (
442 if (!obj_desc) { 427 if (!obj_desc) {
443 /* NULL package elements are allowed */ 428 /* NULL package elements are allowed */
444 429
445 type = 0; /* Uninitialized */ 430 type = 0; /* Uninitialized */
446 goto exit; 431 goto exit;
447 } 432 }
448 break; 433 break;
449 434
450
451 case AML_INT_NAMEPATH_OP: 435 case AML_INT_NAMEPATH_OP:
452 436
453 /* Dereference the reference pointer */ 437 /* Dereference the reference pointer */
@@ -456,50 +440,61 @@ acpi_ex_resolve_multiple (
456 440
457 /* All "References" point to a NS node */ 441 /* All "References" point to a NS node */
458 442
459 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { 443 if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
460 ACPI_REPORT_ERROR (( 444 ACPI_DESC_TYPE_NAMED) {
461 "acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", 445 ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", node, acpi_ut_get_descriptor_name(node)));
462 node, acpi_ut_get_descriptor_name (node))); 446 return_ACPI_STATUS(AE_AML_INTERNAL);
463 return_ACPI_STATUS (AE_AML_INTERNAL);
464 } 447 }
465 448
466 /* Get the attached object */ 449 /* Get the attached object */
467 450
468 obj_desc = acpi_ns_get_attached_object (node); 451 obj_desc = acpi_ns_get_attached_object(node);
469 if (!obj_desc) { 452 if (!obj_desc) {
470 /* No object, use the NS node type */ 453 /* No object, use the NS node type */
471 454
472 type = acpi_ns_get_type (node); 455 type = acpi_ns_get_type(node);
473 goto exit; 456 goto exit;
474 } 457 }
475 458
476 /* Check for circular references */ 459 /* Check for circular references */
477 460
478 if (obj_desc == operand) { 461 if (obj_desc == operand) {
479 return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); 462 return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
480 } 463 }
481 break; 464 break;
482 465
483
484 case AML_LOCAL_OP: 466 case AML_LOCAL_OP:
485 case AML_ARG_OP: 467 case AML_ARG_OP:
486 468
487 if (return_desc) { 469 if (return_desc) {
488 status = acpi_ds_method_data_get_value (obj_desc->reference.opcode, 470 status =
489 obj_desc->reference.offset, walk_state, &obj_desc); 471 acpi_ds_method_data_get_value(obj_desc->
490 if (ACPI_FAILURE (status)) { 472 reference.
491 return_ACPI_STATUS (status); 473 opcode,
474 obj_desc->
475 reference.
476 offset,
477 walk_state,
478 &obj_desc);
479 if (ACPI_FAILURE(status)) {
480 return_ACPI_STATUS(status);
492 } 481 }
493 acpi_ut_remove_reference (obj_desc); 482 acpi_ut_remove_reference(obj_desc);
494 } 483 } else {
495 else { 484 status =
496 status = acpi_ds_method_data_get_node (obj_desc->reference.opcode, 485 acpi_ds_method_data_get_node(obj_desc->
497 obj_desc->reference.offset, walk_state, &node); 486 reference.
498 if (ACPI_FAILURE (status)) { 487 opcode,
499 return_ACPI_STATUS (status); 488 obj_desc->
489 reference.
490 offset,
491 walk_state,
492 &node);
493 if (ACPI_FAILURE(status)) {
494 return_ACPI_STATUS(status);
500 } 495 }
501 496
502 obj_desc = acpi_ns_get_attached_object (node); 497 obj_desc = acpi_ns_get_attached_object(node);
503 if (!obj_desc) { 498 if (!obj_desc) {
504 type = ACPI_TYPE_ANY; 499 type = ACPI_TYPE_ANY;
505 goto exit; 500 goto exit;
@@ -507,7 +502,6 @@ acpi_ex_resolve_multiple (
507 } 502 }
508 break; 503 break;
509 504
510
511 case AML_DEBUG_OP: 505 case AML_DEBUG_OP:
512 506
513 /* The Debug Object is of type "debug_object" */ 507 /* The Debug Object is of type "debug_object" */
@@ -515,13 +509,10 @@ acpi_ex_resolve_multiple (
515 type = ACPI_TYPE_DEBUG_OBJECT; 509 type = ACPI_TYPE_DEBUG_OBJECT;
516 goto exit; 510 goto exit;
517 511
518
519 default: 512 default:
520 513
521 ACPI_REPORT_ERROR (( 514 ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Unknown Reference subtype %X\n", obj_desc->reference.opcode));
522 "acpi_ex_resolve_multiple: Unknown Reference subtype %X\n", 515 return_ACPI_STATUS(AE_AML_INTERNAL);
523 obj_desc->reference.opcode));
524 return_ACPI_STATUS (AE_AML_INTERNAL);
525 } 516 }
526 } 517 }
527 518
@@ -529,10 +520,9 @@ acpi_ex_resolve_multiple (
529 * Now we are guaranteed to have an object that has not been created 520 * Now we are guaranteed to have an object that has not been created
530 * via the ref_of or Index operators. 521 * via the ref_of or Index operators.
531 */ 522 */
532 type = ACPI_GET_OBJECT_TYPE (obj_desc); 523 type = ACPI_GET_OBJECT_TYPE(obj_desc);
533 524
534 525 exit:
535exit:
536 /* Convert internal types to external types */ 526 /* Convert internal types to external types */
537 527
538 switch (type) { 528 switch (type) {
@@ -559,7 +549,5 @@ exit:
559 if (return_desc) { 549 if (return_desc) {
560 *return_desc = obj_desc; 550 *return_desc = obj_desc;
561 } 551 }
562 return_ACPI_STATUS (AE_OK); 552 return_ACPI_STATUS(AE_OK);
563} 553}
564
565