ACPICA: Cleanup output for the ASL Debug object
authorBob Moore <robert.moore@intel.com>
Wed, 1 Jul 2015 06:44:44 +0000 (14:44 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 1 Jul 2015 21:17:55 +0000 (23:17 +0200)
ACPICA commit d4a53a396fe5d384425251b0257f8d125bbed617

Especially for use of the Index operator. For buffers and strings,
only output the actual byte pointed to by the index. For packages,
only print the package element decoded by the index.

Link: https://github.com/acpica/acpica/commit/d4a53a39
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acobject.h
drivers/acpi/acpica/exdebug.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/exoparg2.c

index 3e9720e1f34f79464abbeb0fe7cb6ca7977a7fe0..c81d98d09cace4e747531511f3d95971372713a9 100644 (file)
@@ -335,6 +335,7 @@ struct acpi_object_reference {
        void *object;           /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
        struct acpi_namespace_node *node;       /* ref_of or Namepath */
        union acpi_operand_object **where;      /* Target of Index */
+       u8 *index_pointer;      /* Used for Buffers and Strings */
        u32 value;              /* Used for Local/Arg/Index/ddb_handle */
 };
 
index e67d0aca3fe68b23a9f84284c1a017736a708b8a..815442bbd0518e6d2ee154971966eff3a760c6d5 100644 (file)
@@ -76,6 +76,8 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 {
        u32 i;
        u32 timer;
+       union acpi_operand_object *object_desc;
+       u32 value;
 
        ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
 
@@ -254,8 +256,44 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
                                                         object)->object,
                                                        level + 4, 0);
                        } else {
-                               acpi_ex_do_debug_object(source_desc->reference.
-                                                       object, level + 4, 0);
+                               object_desc = source_desc->reference.object;
+                               value = source_desc->reference.value;
+
+                               switch (object_desc->common.type) {
+                               case ACPI_TYPE_BUFFER:
+
+                                       acpi_os_printf("Buffer[%u] = 0x%2.2X\n",
+                                                      value,
+                                                      *source_desc->reference.
+                                                      index_pointer);
+                                       break;
+
+                               case ACPI_TYPE_STRING:
+
+                                       acpi_os_printf
+                                           ("String[%u] = \"%c\" (0x%2.2X)\n",
+                                            value,
+                                            *source_desc->reference.
+                                            index_pointer,
+                                            *source_desc->reference.
+                                            index_pointer);
+                                       break;
+
+                               case ACPI_TYPE_PACKAGE:
+
+                                       acpi_os_printf("Package[%u] = ", value);
+                                       acpi_ex_do_debug_object(*source_desc->
+                                                               reference.where,
+                                                               level + 4, 0);
+                                       break;
+
+                               default:
+
+                                       acpi_os_printf
+                                           ("Unknown Reference object type %X\n",
+                                            object_desc->common.type);
+                                       break;
+                               }
                        }
                }
                break;
index 1da52bef632e1a6b28f343f78ae6277c083f7792..401e7edcd419371a1d661a7f57cc21adce5eb134 100644 (file)
@@ -224,7 +224,7 @@ 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[8] = {
+static struct acpi_exdump_info acpi_ex_dump_reference[9] = {
        {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"},
@@ -232,6 +232,8 @@ static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
        {ACPI_EXD_NODE, ACPI_EXD_OFFSET(reference.node), "Node"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.index_pointer),
+        "Index Pointer"},
        {ACPI_EXD_REFERENCE, 0, NULL}
 };
 
@@ -1005,14 +1007,13 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
        } else if (obj_desc->reference.object) {
                if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
                    ACPI_DESC_TYPE_OPERAND) {
-                       acpi_os_printf(" Target: %p",
+                       acpi_os_printf("%22s %p", "Target :",
                                       obj_desc->reference.object);
                        if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
                                acpi_os_printf(" Table Index: %X\n",
                                               obj_desc->reference.value);
                        } else {
-                               acpi_os_printf(" Target: %p [%s]\n",
-                                              obj_desc->reference.object,
+                               acpi_os_printf(" [%s]\n",
                                               acpi_ut_get_type_name(((union
                                                                       acpi_operand_object
                                                                       *)
index fcc618aa2061496e089c73fb0c8e760e165bd64b..6fac5e0a698abf8ac18d48cc8dbda22fcd5ff505 100644 (file)
@@ -380,6 +380,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
                        return_desc->reference.target_type =
                            ACPI_TYPE_BUFFER_FIELD;
+                       return_desc->reference.index_pointer =
+                           &(operand[0]->buffer.pointer[index]);
                        break;
 
                case ACPI_TYPE_BUFFER:
@@ -391,6 +393,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
                        return_desc->reference.target_type =
                            ACPI_TYPE_BUFFER_FIELD;
+                       return_desc->reference.index_pointer =
+                           &(operand[0]->buffer.pointer[index]);
                        break;
 
                case ACPI_TYPE_PACKAGE: