aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exresolv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exresolv.c')
-rw-r--r--drivers/acpi/executer/exresolv.c77
1 files changed, 33 insertions, 44 deletions
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 1deed492fe88..6499de878017 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -78,7 +78,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
78{ 78{
79 acpi_status status; 79 acpi_status status;
80 80
81 ACPI_FUNCTION_TRACE_PTR("ex_resolve_to_value", stack_ptr); 81 ACPI_FUNCTION_TRACE_PTR(ex_resolve_to_value, stack_ptr);
82 82
83 if (!stack_ptr || !*stack_ptr) { 83 if (!stack_ptr || !*stack_ptr) {
84 ACPI_ERROR((AE_INFO, "Internal - null pointer")); 84 ACPI_ERROR((AE_INFO, "Internal - null pointer"));
@@ -144,7 +144,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
144 union acpi_operand_object *obj_desc; 144 union acpi_operand_object *obj_desc;
145 u16 opcode; 145 u16 opcode;
146 146
147 ACPI_FUNCTION_TRACE("ex_resolve_object_to_value"); 147 ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
148 148
149 stack_desc = *stack_ptr; 149 stack_desc = *stack_ptr;
150 150
@@ -190,7 +190,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
190 } 190 }
191 191
192 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 192 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
193 "[Arg/Local %X] value_obj is %p\n", 193 "[Arg/Local %X] ValueObj is %p\n",
194 stack_desc->reference.offset, 194 stack_desc->reference.offset,
195 obj_desc)); 195 obj_desc));
196 196
@@ -239,7 +239,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
239 /* Invalid reference object */ 239 /* Invalid reference object */
240 240
241 ACPI_ERROR((AE_INFO, 241 ACPI_ERROR((AE_INFO,
242 "Unknown target_type %X in Index/Reference obj %p", 242 "Unknown TargetType %X in Index/Reference obj %p",
243 stack_desc->reference.target_type, 243 stack_desc->reference.target_type,
244 stack_desc)); 244 stack_desc));
245 status = AE_AML_INTERNAL; 245 status = AE_AML_INTERNAL;
@@ -257,10 +257,24 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
257 257
258 case AML_INT_NAMEPATH_OP: /* Reference to a named object */ 258 case AML_INT_NAMEPATH_OP: /* Reference to a named object */
259 259
260 /* Get the object pointed to by the namespace node */ 260 /* Dereference the name */
261
262 if ((stack_desc->reference.node->type ==
263 ACPI_TYPE_DEVICE)
264 || (stack_desc->reference.node->type ==
265 ACPI_TYPE_THERMAL)) {
266
267 /* These node types do not have 'real' subobjects */
268
269 *stack_ptr = (void *)stack_desc->reference.node;
270 } else {
271 /* Get the object pointed to by the namespace node */
272
273 *stack_ptr =
274 (stack_desc->reference.node)->object;
275 acpi_ut_add_reference(*stack_ptr);
276 }
261 277
262 *stack_ptr = (stack_desc->reference.node)->object;
263 acpi_ut_add_reference(*stack_ptr);
264 acpi_ut_remove_reference(stack_desc); 278 acpi_ut_remove_reference(stack_desc);
265 break; 279 break;
266 280
@@ -293,7 +307,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
293 case ACPI_TYPE_LOCAL_INDEX_FIELD: 307 case ACPI_TYPE_LOCAL_INDEX_FIELD:
294 308
295 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 309 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
296 "field_read source_desc=%p Type=%X\n", 310 "FieldRead SourceDesc=%p Type=%X\n",
297 stack_desc, 311 stack_desc,
298 ACPI_GET_OBJECT_TYPE(stack_desc))); 312 ACPI_GET_OBJECT_TYPE(stack_desc)));
299 313
@@ -337,7 +351,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
337 acpi_object_type type; 351 acpi_object_type type;
338 acpi_status status; 352 acpi_status status;
339 353
340 ACPI_FUNCTION_TRACE("acpi_ex_resolve_multiple"); 354 ACPI_FUNCTION_TRACE(acpi_ex_resolve_multiple);
341 355
342 /* Operand can be either a namespace node or an operand descriptor */ 356 /* Operand can be either a namespace node or an operand descriptor */
343 357
@@ -382,10 +396,16 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
382 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { 396 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
383 switch (obj_desc->reference.opcode) { 397 switch (obj_desc->reference.opcode) {
384 case AML_REF_OF_OP: 398 case AML_REF_OF_OP:
399 case AML_INT_NAMEPATH_OP:
385 400
386 /* Dereference the reference pointer */ 401 /* Dereference the reference pointer */
387 402
388 node = obj_desc->reference.object; 403 if (obj_desc->reference.opcode == AML_REF_OF_OP) {
404 node = obj_desc->reference.object;
405 } else { /* AML_INT_NAMEPATH_OP */
406
407 node = obj_desc->reference.node;
408 }
389 409
390 /* All "References" point to a NS node */ 410 /* All "References" point to a NS node */
391 411
@@ -401,6 +421,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
401 421
402 obj_desc = acpi_ns_get_attached_object(node); 422 obj_desc = acpi_ns_get_attached_object(node);
403 if (!obj_desc) { 423 if (!obj_desc) {
424
404 /* No object, use the NS node type */ 425 /* No object, use the NS node type */
405 426
406 type = acpi_ns_get_type(node); 427 type = acpi_ns_get_type(node);
@@ -432,6 +453,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
432 */ 453 */
433 obj_desc = *(obj_desc->reference.where); 454 obj_desc = *(obj_desc->reference.where);
434 if (!obj_desc) { 455 if (!obj_desc) {
456
435 /* NULL package elements are allowed */ 457 /* NULL package elements are allowed */
436 458
437 type = 0; /* Uninitialized */ 459 type = 0; /* Uninitialized */
@@ -439,39 +461,6 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
439 } 461 }
440 break; 462 break;
441 463
442 case AML_INT_NAMEPATH_OP:
443
444 /* Dereference the reference pointer */
445
446 node = obj_desc->reference.node;
447
448 /* All "References" point to a NS node */
449
450 if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
451 ACPI_DESC_TYPE_NAMED) {
452 ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
453 node,
454 acpi_ut_get_descriptor_name(node)));
455 return_ACPI_STATUS(AE_AML_INTERNAL);
456 }
457
458 /* Get the attached object */
459
460 obj_desc = acpi_ns_get_attached_object(node);
461 if (!obj_desc) {
462 /* No object, use the NS node type */
463
464 type = acpi_ns_get_type(node);
465 goto exit;
466 }
467
468 /* Check for circular references */
469
470 if (obj_desc == operand) {
471 return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
472 }
473 break;
474
475 case AML_LOCAL_OP: 464 case AML_LOCAL_OP:
476 case AML_ARG_OP: 465 case AML_ARG_OP:
477 466
@@ -513,7 +502,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
513 502
514 case AML_DEBUG_OP: 503 case AML_DEBUG_OP:
515 504
516 /* The Debug Object is of type "debug_object" */ 505 /* The Debug Object is of type "DebugObject" */
517 506
518 type = ACPI_TYPE_DEBUG_OBJECT; 507 type = ACPI_TYPE_DEBUG_OBJECT;
519 goto exit; 508 goto exit;