]> err.no Git - linux-2.6/blobdiff - drivers/acpi/executer/exdump.c
Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6] / drivers / acpi / executer / exdump.c
index a7cca8d4f85525f950724527e8df053bb3be5013..74f1b22601b39b4b5106966d211c12fdd62946ee 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,9 @@ static void acpi_ex_out_string(char *title, char *value);
 
 static void acpi_ex_out_pointer(char *title, void *value);
 
-static void acpi_ex_out_address(char *title, acpi_physical_address value);
+static void
+acpi_ex_dump_object(union acpi_operand_object *obj_desc,
+                   struct acpi_exdump_info *info);
 
 static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc);
 
@@ -88,10 +90,11 @@ static struct acpi_exdump_info acpi_ex_dump_string[4] = {
        {ACPI_EXD_STRING, 0, NULL}
 };
 
-static struct acpi_exdump_info acpi_ex_dump_buffer[4] = {
+static struct acpi_exdump_info acpi_ex_dump_buffer[5] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer), NULL},
        {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(buffer.length), "Length"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.pointer), "Pointer"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.node), "Parent Node"},
        {ACPI_EXD_BUFFER, 0, NULL}
 };
 
@@ -114,14 +117,14 @@ static struct acpi_exdump_info acpi_ex_dump_device[4] = {
 
 static struct acpi_exdump_info acpi_ex_dump_event[2] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"}
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
 };
 
 static struct acpi_exdump_info acpi_ex_dump_method[8] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
-       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "param_count"},
-       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
        {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
@@ -134,7 +137,7 @@ static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
        {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
         "Acquire Depth"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"}
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
 };
 
 static struct acpi_exdump_info acpi_ex_dump_region[7] = {
@@ -161,8 +164,8 @@ static struct acpi_exdump_info acpi_ex_dump_power[5] = {
 
 static struct acpi_exdump_info acpi_ex_dump_processor[7] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_processor), NULL},
-       {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
-       {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.length), "Length"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"},
        {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify),
         "System Notify"},
@@ -263,12 +266,10 @@ static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(common_field.node), "Parent Node"}
 };
 
-static struct acpi_exdump_info acpi_ex_dump_node[6] = {
+static struct acpi_exdump_info acpi_ex_dump_node[5] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
        {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
        {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
-       {ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET(reference_count),
-        "Reference Count"},
        {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(child), "Child List"},
        {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"}
 };
@@ -330,7 +331,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
 
        if (!info) {
                acpi_os_printf
-                   ("ex_dump_object: Display not implemented for object type %s\n",
+                   ("ExDumpObject: Display not implemented for object type %s\n",
                     acpi_ut_get_object_type_name(obj_desc));
                return;
        }
@@ -377,18 +378,12 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
                        break;
 
                case ACPI_EXD_POINTER:
+               case ACPI_EXD_ADDRESS:
 
                        acpi_ex_out_pointer(name,
                                            *ACPI_CAST_PTR(void *, target));
                        break;
 
-               case ACPI_EXD_ADDRESS:
-
-                       acpi_ex_out_address(name,
-                                           *ACPI_CAST_PTR
-                                           (acpi_physical_address, target));
-                       break;
-
                case ACPI_EXD_STRING:
 
                        acpi_ut_print_string(obj_desc->string.pointer,
@@ -454,15 +449,15 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
        u32 length;
        u32 index;
 
-       ACPI_FUNCTION_NAME("ex_dump_operand")
+       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;
        }
 
        if (!obj_desc) {
+
                /* This could be a null element of a package */
 
                ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
@@ -505,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: (ref_of) %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:
@@ -532,6 +530,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                                       obj_desc->reference.offset);
 
                        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+
                                /* Value is an Integer */
 
                                acpi_os_printf(" value is [%8.8X%8.8x]",
@@ -563,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:
@@ -610,7 +610,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
        case ACPI_TYPE_PACKAGE:
 
-               acpi_os_printf("Package [Len %X] element_array %p\n",
+               acpi_os_printf("Package [Len %X] ElementArray %p\n",
                               obj_desc->package.count,
                               obj_desc->package.elements);
 
@@ -644,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;
@@ -662,13 +662,13 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
        case ACPI_TYPE_LOCAL_BANK_FIELD:
 
-               acpi_os_printf("bank_field\n");
+               acpi_os_printf("BankField\n");
                break;
 
        case ACPI_TYPE_LOCAL_REGION_FIELD:
 
                acpi_os_printf
-                   ("region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
+                   ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
                     obj_desc->field.bit_length,
                     obj_desc->field.access_byte_width,
                     obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
@@ -681,12 +681,12 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
        case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-               acpi_os_printf("index_field\n");
+               acpi_os_printf("IndexField\n");
                break;
 
        case ACPI_TYPE_BUFFER_FIELD:
 
-               acpi_os_printf("buffer_field: %X bits at byte %X bit %X of\n",
+               acpi_os_printf("BufferField: %X bits at byte %X bit %X of\n",
                               obj_desc->buffer_field.bit_length,
                               obj_desc->buffer_field.base_byte_offset,
                               obj_desc->buffer_field.start_field_bit_offset);
@@ -777,7 +777,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
 {
        acpi_native_uint i;
 
-       ACPI_FUNCTION_NAME("ex_dump_operands");
+       ACPI_FUNCTION_NAME(ex_dump_operands);
 
        if (!ident) {
                ident = "?";
@@ -830,16 +830,6 @@ static void acpi_ex_out_pointer(char *title, void *value)
        acpi_os_printf("%20s : %p\n", title, value);
 }
 
-static void acpi_ex_out_address(char *title, acpi_physical_address value)
-{
-
-#if ACPI_MACHINE_WIDTH == 16
-       acpi_os_printf("%20s : %p\n", title, value);
-#else
-       acpi_os_printf("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
-#endif
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ex_dump_namespace_node
@@ -857,9 +847,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;
                }
        }
@@ -892,20 +881,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_MEM_FREE(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);
+               }
        }
 }
 
@@ -991,7 +1003,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;
 
@@ -1017,16 +1031,15 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
 void
 acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
 {
-       ACPI_FUNCTION_TRACE("ex_dump_object_descriptor");
+       ACPI_FUNCTION_TRACE(ex_dump_object_descriptor);
 
        if (!obj_desc) {
                return_VOID;
        }
 
        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;
                }
        }
@@ -1046,7 +1059,7 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
 
        if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
                acpi_os_printf
-                   ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
+                   ("ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
                     obj_desc, acpi_ut_get_descriptor_name(obj_desc));
                return_VOID;
        }