]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/executer/exdump.c
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / drivers / acpi / executer / exdump.c
index 74f1b22601b39b4b5106966d211c12fdd62946ee..d087a7d28aa53f34173cb7d64d688db119017086 100644 (file)
@@ -45,7 +45,6 @@
 #include <acpi/acinterp.h>
 #include <acpi/amlcode.h>
 #include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exdump")
@@ -214,10 +213,11 @@ static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
 };
 
-static struct acpi_exdump_info acpi_ex_dump_reference[7] = {
+static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
-       {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.offset), "Offset"},
+       {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
@@ -413,10 +413,10 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
 
                case ACPI_EXD_REFERENCE:
 
-                       acpi_ex_out_string("Opcode",
-                                          (acpi_ps_get_opcode_info
-                                           (obj_desc->reference.opcode))->
-                                          name);
+                       acpi_ex_out_string("Class Name",
+                                          (char *)
+                                          acpi_ut_get_reference_name
+                                          (obj_desc));
                        acpi_ex_dump_reference_obj(obj_desc);
                        break;
 
@@ -494,40 +494,41 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
        switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
        case ACPI_TYPE_LOCAL_REFERENCE:
 
-               switch (obj_desc->reference.opcode) {
-               case AML_DEBUG_OP:
+               acpi_os_printf("Reference: [%s] ",
+                              acpi_ut_get_reference_name(obj_desc));
+
+               switch (obj_desc->reference.class) {
+               case ACPI_REFCLASS_DEBUG:
 
-                       acpi_os_printf("Reference: Debug\n");
+                       acpi_os_printf("\n");
                        break;
 
-               case AML_INDEX_OP:
+               case ACPI_REFCLASS_INDEX:
 
-                       acpi_os_printf("Reference: Index %p\n",
-                                      obj_desc->reference.object);
+                       acpi_os_printf("%p\n", obj_desc->reference.object);
                        break;
 
-               case AML_LOAD_OP:
+               case ACPI_REFCLASS_TABLE:
 
-                       acpi_os_printf("Reference: [DdbHandle] TableIndex %p\n",
-                                      obj_desc->reference.object);
+                       acpi_os_printf("Table Index %X\n",
+                                      obj_desc->reference.value);
                        break;
 
-               case AML_REF_OF_OP:
+               case ACPI_REFCLASS_REFOF:
 
-                       acpi_os_printf("Reference: (RefOf) %p [%s]\n",
-                                      obj_desc->reference.object,
+                       acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
                                       acpi_ut_get_type_name(((union
                                                               acpi_operand_object
-                                                              *)obj_desc->
+                                                              *)
+                                                             obj_desc->
                                                              reference.
                                                              object)->common.
                                                             type));
                        break;
 
-               case AML_ARG_OP:
+               case ACPI_REFCLASS_ARG:
 
-                       acpi_os_printf("Reference: Arg%d",
-                                      obj_desc->reference.offset);
+                       acpi_os_printf("%X", obj_desc->reference.value);
 
                        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
 
@@ -542,10 +543,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                        acpi_os_printf("\n");
                        break;
 
-               case AML_LOCAL_OP:
+               case ACPI_REFCLASS_LOCAL:
 
-                       acpi_os_printf("Reference: Local%d",
-                                      obj_desc->reference.offset);
+                       acpi_os_printf("%X", obj_desc->reference.value);
 
                        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
 
@@ -560,45 +560,37 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                        acpi_os_printf("\n");
                        break;
 
-               case AML_INT_NAMEPATH_OP:
+               case ACPI_REFCLASS_NAME:
 
-                       acpi_os_printf("Reference: Namepath %X [%4.4s]\n",
-                                      obj_desc->reference.node->name.integer,
+                       acpi_os_printf("- [%4.4s]\n",
                                       obj_desc->reference.node->name.ascii);
                        break;
 
-               default:
-
-                       /* Unknown opcode */
+               default:        /* Unknown reference class */
 
-                       acpi_os_printf("Unknown Reference opcode=%X\n",
-                                      obj_desc->reference.opcode);
+                       acpi_os_printf("%2.2X\n", obj_desc->reference.class);
                        break;
-
                }
                break;
 
        case ACPI_TYPE_BUFFER:
 
-               acpi_os_printf("Buffer len %X @ %p\n",
+               acpi_os_printf("Buffer length %.2X @ %p\n",
                               obj_desc->buffer.length,
                               obj_desc->buffer.pointer);
 
-               length = obj_desc->buffer.length;
-               if (length > 64) {
-                       length = 64;
-               }
-
                /* Debug only -- dump the buffer contents */
 
                if (obj_desc->buffer.pointer) {
-                       acpi_os_printf("Buffer Contents: ");
-
-                       for (index = 0; index < length; index++) {
-                               acpi_os_printf(" %02x",
-                                              obj_desc->buffer.pointer[index]);
+                       length = obj_desc->buffer.length;
+                       if (length > 128) {
+                               length = 128;
                        }
-                       acpi_os_printf("\n");
+
+                       acpi_os_printf
+                           ("Buffer Contents: (displaying length 0x%.2X)\n",
+                            length);
+                       ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, length);
                }
                break;
 
@@ -756,54 +748,42 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
  *
  * FUNCTION:    acpi_ex_dump_operands
  *
- * PARAMETERS:  Operands            - Operand list
- *              interpreter_mode    - Load or Exec
- *              Ident               - Identification
- *              num_levels          - # of stack entries to dump above line
- *              Note                - Output notation
- *              module_name         - Caller's module name
- *              line_number         - Caller's invocation line number
+ * PARAMETERS: Operands            - A list of Operand objects
+ *             opcode_name         - AML opcode name
+ *             num_operands        - Operand count for this opcode
  *
- * DESCRIPTION: Dump the object stack
+ * DESCRIPTION: Dump the operands associated with the opcode
  *
  ******************************************************************************/
 
 void
 acpi_ex_dump_operands(union acpi_operand_object **operands,
-                     acpi_interpreter_mode interpreter_mode,
-                     char *ident,
-                     u32 num_levels,
-                     char *note, char *module_name, u32 line_number)
+                     const char *opcode_name, u32 num_operands)
 {
-       acpi_native_uint i;
-
        ACPI_FUNCTION_NAME(ex_dump_operands);
 
-       if (!ident) {
-               ident = "?";
-       }
-
-       if (!note) {
-               note = "?";
+       if (!opcode_name) {
+               opcode_name = "UNKNOWN";
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                         "************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
-                         ident, num_levels));
+                         "**** Start operand dump for opcode [%s], %d operands\n",
+                         opcode_name, num_operands));
 
-       if (num_levels == 0) {
-               num_levels = 1;
+       if (num_operands == 0) {
+               num_operands = 1;
        }
 
-       /* Dump the operand stack starting at the top */
+       /* Dump the individual operands */
 
-       for (i = 0; num_levels > 0; i--, num_levels--) {
-               acpi_ex_dump_operand(operands[i], 0);
+       while (num_operands) {
+               acpi_ex_dump_operand(*operands, 0);
+               operands++;
+               num_operands--;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                         "************* Operand Stack dump from %s(%d), %s\n",
-                         module_name, line_number, note));
+                         "**** End operand dump for [%s]\n", opcode_name));
        return;
 }
 
@@ -880,8 +860,8 @@ 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);
+       if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
+               acpi_os_printf(" %p ", obj_desc->reference.node);
 
                status =
                    acpi_ns_handle_to_pathname(obj_desc->reference.node,
@@ -897,14 +877,12 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *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");
+                       if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
+                               acpi_os_printf(" Table Index: %X\n",
+                                              obj_desc->reference.value);
                        } else {
-                               acpi_os_printf(" [%s]\n",
+                               acpi_os_printf(" Target: %p [%s]\n",
+                                              obj_desc->reference.object,
                                               acpi_ut_get_type_name(((union
                                                                       acpi_operand_object
                                                                       *)
@@ -1003,9 +981,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
 
        case ACPI_TYPE_LOCAL_REFERENCE:
 
-               acpi_os_printf("[Object Reference] %s",
-                              (acpi_ps_get_opcode_info
-                               (obj_desc->reference.opcode))->name);
+               acpi_os_printf("[Object Reference] Type [%s] %2.2X",
+                              acpi_ut_get_reference_name(obj_desc),
+                              obj_desc->reference.class);
                acpi_ex_dump_reference_obj(obj_desc);
                break;