]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/executer/exdump.c
ACPICA: Fix for invalid large array index on 64-bit systems
[linux-2.6-omap-h63xx.git] / drivers / acpi / executer / exdump.c
index 68d283fd60e7d254d936b0850a63950a948dbad3..f337c3f73e0c1afc15fb513780f4a3af95fa2813 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -451,9 +451,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
        ACPI_FUNCTION_NAME(ex_dump_operand)
 
-           if (!
-               ((ACPI_LV_EXEC & acpi_dbg_level)
-                && (_COMPONENT & acpi_dbg_layer))) {
+           if (!((ACPI_LV_EXEC & acpi_dbg_level)
+                 && (_COMPONENT & acpi_dbg_layer))) {
                return;
        }
 
@@ -501,25 +500,28 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                        acpi_os_printf("Reference: Debug\n");
                        break;
 
-               case AML_NAME_OP:
+               case AML_INDEX_OP:
 
-                       ACPI_DUMP_PATHNAME(obj_desc->reference.object,
-                                          "Reference: Name: ", ACPI_LV_INFO,
-                                          _COMPONENT);
-                       ACPI_DUMP_ENTRY(obj_desc->reference.object,
-                                       ACPI_LV_INFO);
+                       acpi_os_printf("Reference: Index %p\n",
+                                      obj_desc->reference.object);
                        break;
 
-               case AML_INDEX_OP:
+               case AML_LOAD_OP:
 
-                       acpi_os_printf("Reference: Index %p\n",
+                       acpi_os_printf("Reference: [DdbHandle] TableIndex %p\n",
                                       obj_desc->reference.object);
                        break;
 
                case AML_REF_OF_OP:
 
-                       acpi_os_printf("Reference: (RefOf) %p\n",
-                                      obj_desc->reference.object);
+                       acpi_os_printf("Reference: (RefOf) %p [%s]\n",
+                                      obj_desc->reference.object,
+                                      acpi_ut_get_type_name(((union
+                                                              acpi_operand_object
+                                                              *)obj_desc->
+                                                             reference.
+                                                             object)->common.
+                                                            type));
                        break;
 
                case AML_ARG_OP:
@@ -560,8 +562,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
                case AML_INT_NAMEPATH_OP:
 
-                       acpi_os_printf("Reference.Node->Name %X\n",
-                                      obj_desc->reference.node->name.integer);
+                       acpi_os_printf("Reference: Namepath %X [%4.4s]\n",
+                                      obj_desc->reference.node->name.integer,
+                                      obj_desc->reference.node->name.ascii);
                        break;
 
                default:
@@ -641,8 +644,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                        acpi_os_printf("\n");
                } else {
                        acpi_os_printf(" base %8.8X%8.8X Length %X\n",
-                                      ACPI_FORMAT_UINT64(obj_desc->region.
-                                                         address),
+                                      ACPI_FORMAT_NATIVE_UINT(obj_desc->region.
+                                                              address),
                                       obj_desc->region.length);
                }
                break;
@@ -768,11 +771,12 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 void
 acpi_ex_dump_operands(union acpi_operand_object **operands,
                      acpi_interpreter_mode interpreter_mode,
-                     char *ident,
+                     const char *ident,
                      u32 num_levels,
-                     char *note, char *module_name, u32 line_number)
+                     const char *note,
+                     const char *module_name, u32 line_number)
 {
-       acpi_native_uint i;
+       s32 i;
 
        ACPI_FUNCTION_NAME(ex_dump_operands);
 
@@ -844,9 +848,8 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
        ACPI_FUNCTION_ENTRY();
 
        if (!flags) {
-               if (!
-                   ((ACPI_LV_OBJECTS & acpi_dbg_level)
-                    && (_COMPONENT & acpi_dbg_layer))) {
+               if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
+                     && (_COMPONENT & acpi_dbg_layer))) {
                        return;
                }
        }
@@ -879,20 +882,43 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
        ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
 
        if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) {
-               acpi_os_printf("Named Object %p ", obj_desc->reference.node);
+               acpi_os_printf(" Named Object %p ", obj_desc->reference.node);
 
                status =
                    acpi_ns_handle_to_pathname(obj_desc->reference.node,
                                               &ret_buf);
                if (ACPI_FAILURE(status)) {
-                       acpi_os_printf("Could not convert name to pathname\n");
+                       acpi_os_printf(" Could not convert name to pathname\n");
                } else {
                        acpi_os_printf("%s\n", (char *)ret_buf.pointer);
                        ACPI_FREE(ret_buf.pointer);
                }
        } else if (obj_desc->reference.object) {
-               acpi_os_printf("\nReferenced Object: %p\n",
-                              obj_desc->reference.object);
+               if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
+                   ACPI_DESC_TYPE_OPERAND) {
+                       acpi_os_printf(" Target: %p",
+                                      obj_desc->reference.object);
+                       if (obj_desc->reference.opcode == AML_LOAD_OP) {
+                               /*
+                                * For DDBHandle reference,
+                                * obj_desc->Reference.Object is the table index
+                                */
+                               acpi_os_printf(" [DDBHandle]\n");
+                       } else {
+                               acpi_os_printf(" [%s]\n",
+                                              acpi_ut_get_type_name(((union
+                                                                      acpi_operand_object
+                                                                      *)
+                                                                     obj_desc->
+                                                                     reference.
+                                                                     object)->
+                                                                    common.
+                                                                    type));
+                       }
+               } else {
+                       acpi_os_printf(" Target: %p\n",
+                                      obj_desc->reference.object);
+               }
        }
 }
 
@@ -978,7 +1004,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
 
        case ACPI_TYPE_LOCAL_REFERENCE:
 
-               acpi_os_printf("[Object Reference] ");
+               acpi_os_printf("[Object Reference] %s",
+                              (acpi_ps_get_opcode_info
+                               (obj_desc->reference.opcode))->name);
                acpi_ex_dump_reference_obj(obj_desc);
                break;
 
@@ -1011,9 +1039,8 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
        }
 
        if (!flags) {
-               if (!
-                   ((ACPI_LV_OBJECTS & acpi_dbg_level)
-                    && (_COMPONENT & acpi_dbg_layer))) {
+               if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
+                     && (_COMPONENT & acpi_dbg_layer))) {
                        return_VOID;
                }
        }