]> err.no Git - linux-2.6/blobdiff - drivers/acpi/executer/exoparg1.c
[ACPI] ACPICA 20060210
[linux-2.6] / drivers / acpi / executer / exoparg1.c
index bc8837ecb716d6958479e292942159923b977374..4f3627ee2b2bdc00c7793e69fadd12081490da15 100644 (file)
@@ -111,8 +111,8 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
 
        default:                /*  Unknown opcode  */
 
-               ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
-                                  walk_state->opcode));
+               ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+                           walk_state->opcode));
                status = AE_AML_BAD_OPCODE;
                break;
        }
@@ -189,8 +189,8 @@ acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state)
 
        default:                /*  Unknown opcode  */
 
-               ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
-                                  walk_state->opcode));
+               ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+                           walk_state->opcode));
                status = AE_AML_BAD_OPCODE;
                break;
        }
@@ -229,8 +229,8 @@ acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state)
 
        default:                /* Unknown opcode */
 
-               ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
-                                  walk_state->opcode));
+               ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+                           walk_state->opcode));
                status = AE_AML_BAD_OPCODE;
                goto cleanup;
        }
@@ -342,6 +342,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                        for (i = 0;
                             (i < acpi_gbl_integer_nybble_width) && (digit > 0);
                             i++) {
+
                                /* Get the least significant 4-bit BCD digit */
 
                                temp32 = ((u32) digit) & 0xF;
@@ -349,7 +350,9 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                                /* Check the range of the digit */
 
                                if (temp32 > 9) {
-                                       ACPI_REPORT_ERROR(("BCD digit too large (not decimal): 0x%X\n", temp32));
+                                       ACPI_ERROR((AE_INFO,
+                                                   "BCD digit too large (not decimal): 0x%X",
+                                                   temp32));
 
                                        status = AE_AML_NUMERIC_OVERFLOW;
                                        goto cleanup;
@@ -394,7 +397,10 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                        /* Overflow if there is any data left in Digit */
 
                        if (digit > 0) {
-                               ACPI_REPORT_ERROR(("Integer too large to convert to BCD: %8.8X%8.8X\n", ACPI_FORMAT_UINT64(operand[0]->integer.value)));
+                               ACPI_ERROR((AE_INFO,
+                                           "Integer too large to convert to BCD: %8.8X%8.8X",
+                                           ACPI_FORMAT_UINT64(operand[0]->
+                                                              integer.value)));
                                status = AE_AML_NUMERIC_OVERFLOW;
                                goto cleanup;
                        }
@@ -482,6 +488,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_string(operand[0], &return_desc,
                                                   ACPI_EXPLICIT_CONVERT_DECIMAL);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -492,6 +499,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_string(operand[0], &return_desc,
                                                   ACPI_EXPLICIT_CONVERT_HEX);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -501,6 +509,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
 
                status = acpi_ex_convert_to_buffer(operand[0], &return_desc);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -511,6 +520,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_integer(operand[0], &return_desc,
                                                    ACPI_ANY_BASE);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -521,21 +531,22 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
 
                /* These are two obsolete opcodes */
 
-               ACPI_REPORT_ERROR(("%s is obsolete and not implemented\n",
-                                  acpi_ps_get_opcode_name(walk_state->
-                                                          opcode)));
+               ACPI_ERROR((AE_INFO,
+                           "%s is obsolete and not implemented",
+                           acpi_ps_get_opcode_name(walk_state->opcode)));
                status = AE_SUPPORT;
                goto cleanup;
 
        default:                /* Unknown opcode */
 
-               ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
-                                  walk_state->opcode));
+               ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+                           walk_state->opcode));
                status = AE_AML_BAD_OPCODE;
                goto cleanup;
        }
 
        if (ACPI_SUCCESS(status)) {
+
                /* Store the return value computed above into the target object */
 
                status = acpi_ex_store(return_desc, operand[1], walk_state);
@@ -620,6 +631,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                temp_desc = operand[0];
                if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) ==
                    ACPI_DESC_TYPE_OPERAND) {
+
                        /* Internal reference object - prevent deletion */
 
                        acpi_ut_add_reference(temp_desc);
@@ -636,10 +648,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                    acpi_ex_resolve_operands(AML_LNOT_OP, &temp_desc,
                                             walk_state);
                if (ACPI_FAILURE(status)) {
-                       ACPI_REPORT_ERROR(("%s: bad operand(s) %s\n",
-                                          acpi_ps_get_opcode_name(walk_state->
-                                                                  opcode),
-                                          acpi_format_exception(status)));
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "While resolving operands for [%s]",
+                                       acpi_ps_get_opcode_name(walk_state->
+                                                               opcode)));
 
                        goto cleanup;
                }
@@ -738,7 +750,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                        break;
 
                default:
-                       ACPI_REPORT_ERROR(("Operand is not Buf/Int/Str/Pkg - found type %s\n", acpi_ut_get_type_name(type)));
+                       ACPI_ERROR((AE_INFO,
+                                   "Operand is not Buf/Int/Str/Pkg - found type %s",
+                                   acpi_ut_get_type_name(type)));
                        status = AE_AML_OPERAND_TYPE;
                        goto cleanup;
                }
@@ -770,8 +784,25 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
                /* Check for a method local or argument, or standalone String */
 
-               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
+               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
                    ACPI_DESC_TYPE_NAMED) {
+                       temp_desc =
+                           acpi_ns_get_attached_object((struct
+                                                        acpi_namespace_node *)
+                                                       operand[0]);
+                       if (temp_desc
+                           &&
+                           ((ACPI_GET_OBJECT_TYPE(temp_desc) ==
+                             ACPI_TYPE_STRING)
+                            || (ACPI_GET_OBJECT_TYPE(temp_desc) ==
+                                ACPI_TYPE_LOCAL_REFERENCE))) {
+                               operand[0] = temp_desc;
+                               acpi_ut_add_reference(temp_desc);
+                       } else {
+                               status = AE_AML_OPERAND_TYPE;
+                               goto cleanup;
+                       }
+               } else {
                        switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
                        case ACPI_TYPE_LOCAL_REFERENCE:
                                /*
@@ -820,13 +851,24 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                                break;
 
                        case ACPI_TYPE_STRING:
+                               break;
 
+                       default:
+                               status = AE_AML_OPERAND_TYPE;
+                               goto cleanup;
+                       }
+               }
+
+               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
+                   ACPI_DESC_TYPE_NAMED) {
+                       if (ACPI_GET_OBJECT_TYPE(operand[0]) ==
+                           ACPI_TYPE_STRING) {
                                /*
                                 * This is a deref_of (String). The string is a reference
                                 * to a named ACPI object.
                                 *
                                 * 1) Find the owning Node
-                                * 2) Dereference the node to an actual object.  Could be a
+                                * 2) Dereference the node to an actual object. Could be a
                                 *    Field, so we need to resolve the node to a value.
                                 */
                                status =
@@ -850,11 +892,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                                     (struct acpi_namespace_node, &return_desc),
                                     walk_state);
                                goto cleanup;
-
-                       default:
-
-                               status = AE_AML_OPERAND_TYPE;
-                               goto cleanup;
                        }
                }
 
@@ -935,7 +972,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
                                default:
 
-                                       ACPI_REPORT_ERROR(("Unknown Index target_type %X in obj %p\n", operand[0]->reference.target_type, operand[0]));
+                                       ACPI_ERROR((AE_INFO,
+                                                   "Unknown Index target_type %X in obj %p",
+                                                   operand[0]->reference.
+                                                   target_type, operand[0]));
                                        status = AE_AML_OPERAND_TYPE;
                                        goto cleanup;
                                }
@@ -961,7 +1001,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                                break;
 
                        default:
-                               ACPI_REPORT_ERROR(("Unknown opcode in ref(%p) - %X\n", operand[0], operand[0]->reference.opcode));
+                               ACPI_ERROR((AE_INFO,
+                                           "Unknown opcode in ref(%p) - %X",
+                                           operand[0],
+                                           operand[0]->reference.opcode));
 
                                status = AE_TYPE;
                                goto cleanup;
@@ -971,8 +1014,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
        default:
 
-               ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
-                                  walk_state->opcode));
+               ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+                           walk_state->opcode));
                status = AE_AML_BAD_OPCODE;
                goto cleanup;
        }