linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / executer / exresolv.c
index 6499de8..1deed49 100644 (file)
@@ -78,7 +78,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE_PTR(ex_resolve_to_value, stack_ptr);
+       ACPI_FUNCTION_TRACE_PTR("ex_resolve_to_value", stack_ptr);
 
        if (!stack_ptr || !*stack_ptr) {
                ACPI_ERROR((AE_INFO, "Internal - null pointer"));
@@ -144,7 +144,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
        union acpi_operand_object *obj_desc;
        u16 opcode;
 
-       ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
+       ACPI_FUNCTION_TRACE("ex_resolve_object_to_value");
 
        stack_desc = *stack_ptr;
 
@@ -190,7 +190,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
                        }
 
                        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                                         "[Arg/Local %X] ValueObj is %p\n",
+                                         "[Arg/Local %X] value_obj is %p\n",
                                          stack_desc->reference.offset,
                                          obj_desc));
 
@@ -239,7 +239,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
                                /* Invalid reference object */
 
                                ACPI_ERROR((AE_INFO,
-                                           "Unknown TargetType %X in Index/Reference obj %p",
+                                           "Unknown target_type %X in Index/Reference obj %p",
                                            stack_desc->reference.target_type,
                                            stack_desc));
                                status = AE_AML_INTERNAL;
@@ -257,24 +257,10 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 
                case AML_INT_NAMEPATH_OP:       /* Reference to a named object */
 
-                       /* Dereference the name */
-
-                       if ((stack_desc->reference.node->type ==
-                            ACPI_TYPE_DEVICE)
-                           || (stack_desc->reference.node->type ==
-                               ACPI_TYPE_THERMAL)) {
-
-                               /* These node types do not have 'real' subobjects */
-
-                               *stack_ptr = (void *)stack_desc->reference.node;
-                       } else {
-                               /* Get the object pointed to by the namespace node */
-
-                               *stack_ptr =
-                                   (stack_desc->reference.node)->object;
-                               acpi_ut_add_reference(*stack_ptr);
-                       }
+                       /* Get the object pointed to by the namespace node */
 
+                       *stack_ptr = (stack_desc->reference.node)->object;
+                       acpi_ut_add_reference(*stack_ptr);
                        acpi_ut_remove_reference(stack_desc);
                        break;
 
@@ -307,7 +293,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
        case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
                ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                                 "FieldRead SourceDesc=%p Type=%X\n",
+                                 "field_read source_desc=%p Type=%X\n",
                                  stack_desc,
                                  ACPI_GET_OBJECT_TYPE(stack_desc)));
 
@@ -351,7 +337,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
        acpi_object_type type;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE(acpi_ex_resolve_multiple);
+       ACPI_FUNCTION_TRACE("acpi_ex_resolve_multiple");
 
        /* Operand can be either a namespace node or an operand descriptor */
 
@@ -396,16 +382,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
        while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
                switch (obj_desc->reference.opcode) {
                case AML_REF_OF_OP:
-               case AML_INT_NAMEPATH_OP:
 
                        /* Dereference the reference pointer */
 
-                       if (obj_desc->reference.opcode == AML_REF_OF_OP) {
-                               node = obj_desc->reference.object;
-                       } else {        /* AML_INT_NAMEPATH_OP */
-
-                               node = obj_desc->reference.node;
-                       }
+                       node = obj_desc->reference.object;
 
                        /* All "References" point to a NS node */
 
@@ -421,7 +401,6 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 
                        obj_desc = acpi_ns_get_attached_object(node);
                        if (!obj_desc) {
-
                                /* No object, use the NS node type */
 
                                type = acpi_ns_get_type(node);
@@ -453,7 +432,6 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                         */
                        obj_desc = *(obj_desc->reference.where);
                        if (!obj_desc) {
-
                                /* NULL package elements are allowed */
 
                                type = 0;       /* Uninitialized */
@@ -461,6 +439,39 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                        }
                        break;
 
+               case AML_INT_NAMEPATH_OP:
+
+                       /* Dereference the reference pointer */
+
+                       node = obj_desc->reference.node;
+
+                       /* All "References" point to a NS node */
+
+                       if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
+                           ACPI_DESC_TYPE_NAMED) {
+                               ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
+                                           node,
+                                           acpi_ut_get_descriptor_name(node)));
+                               return_ACPI_STATUS(AE_AML_INTERNAL);
+                       }
+
+                       /* Get the attached object */
+
+                       obj_desc = acpi_ns_get_attached_object(node);
+                       if (!obj_desc) {
+                               /* No object, use the NS node type */
+
+                               type = acpi_ns_get_type(node);
+                               goto exit;
+                       }
+
+                       /* Check for circular references */
+
+                       if (obj_desc == operand) {
+                               return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
+                       }
+                       break;
+
                case AML_LOCAL_OP:
                case AML_ARG_OP:
 
@@ -502,7 +513,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 
                case AML_DEBUG_OP:
 
-                       /* The Debug Object is of type "DebugObject" */
+                       /* The Debug Object is of type "debug_object" */
 
                        type = ACPI_TYPE_DEBUG_OBJECT;
                        goto exit;