diff options
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/exdebug.c | 67 |
1 files changed, 47 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c index 815442bbd051..a2033353d030 100644 --- a/drivers/acpi/acpica/exdebug.c +++ b/drivers/acpi/acpica/exdebug.c | |||
@@ -88,20 +88,39 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
88 | return_VOID; | 88 | return_VOID; |
89 | } | 89 | } |
90 | 90 | ||
91 | /* | 91 | /* Null string or newline -- don't emit the line header */ |
92 | * We will emit the current timer value (in microseconds) with each | 92 | |
93 | * debug output. Only need the lower 26 bits. This allows for 67 | 93 | if ((ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) && |
94 | * million microseconds or 67 seconds before rollover. | 94 | (source_desc->common.type == ACPI_TYPE_STRING)) { |
95 | */ | 95 | if ((source_desc->string.length == 0) || |
96 | timer = ((u32)acpi_os_get_timer() / 10); /* (100 nanoseconds to microseconds) */ | 96 | ((source_desc->string.length == 1) && |
97 | timer &= 0x03FFFFFF; | 97 | (*source_desc->string.pointer == '\n'))) { |
98 | acpi_os_printf("\n"); | ||
99 | return_VOID; | ||
100 | } | ||
101 | } | ||
98 | 102 | ||
99 | /* | 103 | /* |
100 | * Print line header as long as we are not in the middle of an | 104 | * Print line header as long as we are not in the middle of an |
101 | * object display | 105 | * object display |
102 | */ | 106 | */ |
103 | if (!((level > 0) && index == 0)) { | 107 | if (!((level > 0) && index == 0)) { |
104 | acpi_os_printf("[ACPI Debug %.8u] %*s", timer, level, " "); | 108 | if (acpi_gbl_display_debug_timer) { |
109 | /* | ||
110 | * We will emit the current timer value (in microseconds) with each | ||
111 | * debug output. Only need the lower 26 bits. This allows for 67 | ||
112 | * million microseconds or 67 seconds before rollover. | ||
113 | * | ||
114 | * Convert 100 nanosecond units to microseconds | ||
115 | */ | ||
116 | timer = ((u32)acpi_os_get_timer() / 10); | ||
117 | timer &= 0x03FFFFFF; | ||
118 | |||
119 | acpi_os_printf("[ACPI Debug T=0x%8.8X] %*s", timer, | ||
120 | level, " "); | ||
121 | } else { | ||
122 | acpi_os_printf("[ACPI Debug] %*s", level, " "); | ||
123 | } | ||
105 | } | 124 | } |
106 | 125 | ||
107 | /* Display the index for package output only */ | 126 | /* Display the index for package output only */ |
@@ -116,8 +135,15 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
116 | } | 135 | } |
117 | 136 | ||
118 | if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { | 137 | if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { |
119 | acpi_os_printf("%s ", | 138 | |
120 | acpi_ut_get_object_type_name(source_desc)); | 139 | /* No object type prefix needed for integers and strings */ |
140 | |||
141 | if ((source_desc->common.type != ACPI_TYPE_INTEGER) && | ||
142 | (source_desc->common.type != ACPI_TYPE_STRING)) { | ||
143 | acpi_os_printf("%s ", | ||
144 | acpi_ut_get_object_type_name | ||
145 | (source_desc)); | ||
146 | } | ||
121 | 147 | ||
122 | if (!acpi_ut_valid_internal_object(source_desc)) { | 148 | if (!acpi_ut_valid_internal_object(source_desc)) { |
123 | acpi_os_printf("%p, Invalid Internal Object!\n", | 149 | acpi_os_printf("%p, Invalid Internal Object!\n", |
@@ -126,7 +152,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
126 | } | 152 | } |
127 | } else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == | 153 | } else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == |
128 | ACPI_DESC_TYPE_NAMED) { | 154 | ACPI_DESC_TYPE_NAMED) { |
129 | acpi_os_printf("%s: %p\n", | 155 | acpi_os_printf("%s (Node %p)\n", |
130 | acpi_ut_get_type_name(((struct | 156 | acpi_ut_get_type_name(((struct |
131 | acpi_namespace_node *) | 157 | acpi_namespace_node *) |
132 | source_desc)->type), | 158 | source_desc)->type), |
@@ -164,14 +190,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
164 | 190 | ||
165 | case ACPI_TYPE_STRING: | 191 | case ACPI_TYPE_STRING: |
166 | 192 | ||
167 | acpi_os_printf("[0x%.2X] \"%s\"\n", | 193 | acpi_os_printf("\"%s\"\n", source_desc->string.pointer); |
168 | source_desc->string.length, | ||
169 | source_desc->string.pointer); | ||
170 | break; | 194 | break; |
171 | 195 | ||
172 | case ACPI_TYPE_PACKAGE: | 196 | case ACPI_TYPE_PACKAGE: |
173 | 197 | ||
174 | acpi_os_printf("[Contains 0x%.2X Elements]\n", | 198 | acpi_os_printf("(Contains 0x%.2X Elements):\n", |
175 | source_desc->package.count); | 199 | source_desc->package.count); |
176 | 200 | ||
177 | /* Output the entire contents of the package */ | 201 | /* Output the entire contents of the package */ |
@@ -250,11 +274,14 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
250 | if (ACPI_GET_DESCRIPTOR_TYPE | 274 | if (ACPI_GET_DESCRIPTOR_TYPE |
251 | (source_desc->reference.object) == | 275 | (source_desc->reference.object) == |
252 | ACPI_DESC_TYPE_NAMED) { | 276 | ACPI_DESC_TYPE_NAMED) { |
253 | acpi_ex_do_debug_object(((struct | 277 | |
254 | acpi_namespace_node *) | 278 | /* Reference object is a namespace node */ |
279 | |||
280 | acpi_ex_do_debug_object(ACPI_CAST_PTR | ||
281 | (union | ||
282 | acpi_operand_object, | ||
255 | source_desc->reference. | 283 | source_desc->reference. |
256 | object)->object, | 284 | object), level + 4, 0); |
257 | level + 4, 0); | ||
258 | } else { | 285 | } else { |
259 | object_desc = source_desc->reference.object; | 286 | object_desc = source_desc->reference.object; |
260 | value = source_desc->reference.value; | 287 | value = source_desc->reference.value; |
@@ -300,7 +327,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
300 | 327 | ||
301 | default: | 328 | default: |
302 | 329 | ||
303 | acpi_os_printf("%p\n", source_desc); | 330 | acpi_os_printf("(Descriptor %p)\n", source_desc); |
304 | break; | 331 | break; |
305 | } | 332 | } |
306 | 333 | ||