diff options
Diffstat (limited to 'drivers/acpi/utilities/utdebug.c')
-rw-r--r-- | drivers/acpi/utilities/utdebug.c | 106 |
1 files changed, 51 insertions, 55 deletions
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index 985c5d045b78..794c7df3f2ad 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c | |||
@@ -56,7 +56,7 @@ static char *acpi_gbl_fn_entry_str = "----Entry"; | |||
56 | static char *acpi_gbl_fn_exit_str = "----Exit-"; | 56 | static char *acpi_gbl_fn_exit_str = "----Exit-"; |
57 | 57 | ||
58 | 58 | ||
59 | /***************************************************************************** | 59 | /******************************************************************************* |
60 | * | 60 | * |
61 | * FUNCTION: acpi_ut_init_stack_ptr_trace | 61 | * FUNCTION: acpi_ut_init_stack_ptr_trace |
62 | * | 62 | * |
@@ -64,9 +64,9 @@ static char *acpi_gbl_fn_exit_str = "----Exit-"; | |||
64 | * | 64 | * |
65 | * RETURN: None | 65 | * RETURN: None |
66 | * | 66 | * |
67 | * DESCRIPTION: Save the current stack pointer | 67 | * DESCRIPTION: Save the current CPU stack pointer at subsystem startup |
68 | * | 68 | * |
69 | ****************************************************************************/ | 69 | ******************************************************************************/ |
70 | 70 | ||
71 | void | 71 | void |
72 | acpi_ut_init_stack_ptr_trace ( | 72 | acpi_ut_init_stack_ptr_trace ( |
@@ -79,7 +79,7 @@ acpi_ut_init_stack_ptr_trace ( | |||
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | /***************************************************************************** | 82 | /******************************************************************************* |
83 | * | 83 | * |
84 | * FUNCTION: acpi_ut_track_stack_ptr | 84 | * FUNCTION: acpi_ut_track_stack_ptr |
85 | * | 85 | * |
@@ -87,9 +87,9 @@ acpi_ut_init_stack_ptr_trace ( | |||
87 | * | 87 | * |
88 | * RETURN: None | 88 | * RETURN: None |
89 | * | 89 | * |
90 | * DESCRIPTION: Save the current stack pointer | 90 | * DESCRIPTION: Save the current CPU stack pointer |
91 | * | 91 | * |
92 | ****************************************************************************/ | 92 | ******************************************************************************/ |
93 | 93 | ||
94 | void | 94 | void |
95 | acpi_ut_track_stack_ptr ( | 95 | acpi_ut_track_stack_ptr ( |
@@ -110,16 +110,16 @@ acpi_ut_track_stack_ptr ( | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | /***************************************************************************** | 113 | /******************************************************************************* |
114 | * | 114 | * |
115 | * FUNCTION: acpi_ut_debug_print | 115 | * FUNCTION: acpi_ut_debug_print |
116 | * | 116 | * |
117 | * PARAMETERS: debug_level - Requested debug print level | 117 | * PARAMETERS: requested_debug_level - Requested debug print level |
118 | * proc_name - Caller's procedure name | ||
119 | * module_name - Caller's module name (for error output) | ||
120 | * line_number - Caller's line number (for error output) | 118 | * line_number - Caller's line number (for error output) |
121 | * component_id - Caller's component ID (for error output) | 119 | * dbg_info - Contains: |
122 | * | 120 | * proc_name - Caller's procedure name |
121 | * module_name - Caller's module name | ||
122 | * component_id - Caller's component ID | ||
123 | * Format - Printf format field | 123 | * Format - Printf format field |
124 | * ... - Optional printf arguments | 124 | * ... - Optional printf arguments |
125 | * | 125 | * |
@@ -128,7 +128,7 @@ acpi_ut_track_stack_ptr ( | |||
128 | * DESCRIPTION: Print error message with prefix consisting of the module name, | 128 | * DESCRIPTION: Print error message with prefix consisting of the module name, |
129 | * line number, and component ID. | 129 | * line number, and component ID. |
130 | * | 130 | * |
131 | ****************************************************************************/ | 131 | ******************************************************************************/ |
132 | 132 | ||
133 | void ACPI_INTERNAL_VAR_XFACE | 133 | void ACPI_INTERNAL_VAR_XFACE |
134 | acpi_ut_debug_print ( | 134 | acpi_ut_debug_print ( |
@@ -157,7 +157,8 @@ acpi_ut_debug_print ( | |||
157 | 157 | ||
158 | if (thread_id != acpi_gbl_prev_thread_id) { | 158 | if (thread_id != acpi_gbl_prev_thread_id) { |
159 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 159 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
160 | acpi_os_printf ("\n**** Context Switch from TID %X to TID %X ****\n\n", | 160 | acpi_os_printf ( |
161 | "\n**** Context Switch from TID %X to TID %X ****\n\n", | ||
161 | acpi_gbl_prev_thread_id, thread_id); | 162 | acpi_gbl_prev_thread_id, thread_id); |
162 | } | 163 | } |
163 | 164 | ||
@@ -174,15 +175,16 @@ acpi_ut_debug_print ( | |||
174 | acpi_os_printf ("[%04lX] ", thread_id); | 175 | acpi_os_printf ("[%04lX] ", thread_id); |
175 | } | 176 | } |
176 | 177 | ||
177 | acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name); | 178 | acpi_os_printf ("[%02ld] %-22.22s: ", |
179 | acpi_gbl_nesting_level, dbg_info->proc_name); | ||
178 | 180 | ||
179 | va_start (args, format); | 181 | va_start (args, format); |
180 | acpi_os_vprintf (format, args); | 182 | acpi_os_vprintf (format, args); |
181 | } | 183 | } |
182 | EXPORT_SYMBOL(acpi_ut_debug_print); | ||
183 | 184 | ||
185 | EXPORT_SYMBOL(acpi_ut_debug_print); | ||
184 | 186 | ||
185 | /***************************************************************************** | 187 | /******************************************************************************* |
186 | * | 188 | * |
187 | * FUNCTION: acpi_ut_debug_print_raw | 189 | * FUNCTION: acpi_ut_debug_print_raw |
188 | * | 190 | * |
@@ -200,7 +202,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print); | |||
200 | * DESCRIPTION: Print message with no headers. Has same interface as | 202 | * DESCRIPTION: Print message with no headers. Has same interface as |
201 | * debug_print so that the same macros can be used. | 203 | * debug_print so that the same macros can be used. |
202 | * | 204 | * |
203 | ****************************************************************************/ | 205 | ******************************************************************************/ |
204 | 206 | ||
205 | void ACPI_INTERNAL_VAR_XFACE | 207 | void ACPI_INTERNAL_VAR_XFACE |
206 | acpi_ut_debug_print_raw ( | 208 | acpi_ut_debug_print_raw ( |
@@ -224,7 +226,7 @@ acpi_ut_debug_print_raw ( | |||
224 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); | 226 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); |
225 | 227 | ||
226 | 228 | ||
227 | /***************************************************************************** | 229 | /******************************************************************************* |
228 | * | 230 | * |
229 | * FUNCTION: acpi_ut_trace | 231 | * FUNCTION: acpi_ut_trace |
230 | * | 232 | * |
@@ -239,7 +241,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw); | |||
239 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is | 241 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
240 | * set in debug_level | 242 | * set in debug_level |
241 | * | 243 | * |
242 | ****************************************************************************/ | 244 | ******************************************************************************/ |
243 | 245 | ||
244 | void | 246 | void |
245 | acpi_ut_trace ( | 247 | acpi_ut_trace ( |
@@ -256,7 +258,7 @@ acpi_ut_trace ( | |||
256 | EXPORT_SYMBOL(acpi_ut_trace); | 258 | EXPORT_SYMBOL(acpi_ut_trace); |
257 | 259 | ||
258 | 260 | ||
259 | /***************************************************************************** | 261 | /******************************************************************************* |
260 | * | 262 | * |
261 | * FUNCTION: acpi_ut_trace_ptr | 263 | * FUNCTION: acpi_ut_trace_ptr |
262 | * | 264 | * |
@@ -272,7 +274,7 @@ EXPORT_SYMBOL(acpi_ut_trace); | |||
272 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is | 274 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
273 | * set in debug_level | 275 | * set in debug_level |
274 | * | 276 | * |
275 | ****************************************************************************/ | 277 | ******************************************************************************/ |
276 | 278 | ||
277 | void | 279 | void |
278 | acpi_ut_trace_ptr ( | 280 | acpi_ut_trace_ptr ( |
@@ -288,7 +290,7 @@ acpi_ut_trace_ptr ( | |||
288 | } | 290 | } |
289 | 291 | ||
290 | 292 | ||
291 | /***************************************************************************** | 293 | /******************************************************************************* |
292 | * | 294 | * |
293 | * FUNCTION: acpi_ut_trace_str | 295 | * FUNCTION: acpi_ut_trace_str |
294 | * | 296 | * |
@@ -304,7 +306,7 @@ acpi_ut_trace_ptr ( | |||
304 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is | 306 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
305 | * set in debug_level | 307 | * set in debug_level |
306 | * | 308 | * |
307 | ****************************************************************************/ | 309 | ******************************************************************************/ |
308 | 310 | ||
309 | void | 311 | void |
310 | acpi_ut_trace_str ( | 312 | acpi_ut_trace_str ( |
@@ -321,7 +323,7 @@ acpi_ut_trace_str ( | |||
321 | } | 323 | } |
322 | 324 | ||
323 | 325 | ||
324 | /***************************************************************************** | 326 | /******************************************************************************* |
325 | * | 327 | * |
326 | * FUNCTION: acpi_ut_trace_u32 | 328 | * FUNCTION: acpi_ut_trace_u32 |
327 | * | 329 | * |
@@ -337,7 +339,7 @@ acpi_ut_trace_str ( | |||
337 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is | 339 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
338 | * set in debug_level | 340 | * set in debug_level |
339 | * | 341 | * |
340 | ****************************************************************************/ | 342 | ******************************************************************************/ |
341 | 343 | ||
342 | void | 344 | void |
343 | acpi_ut_trace_u32 ( | 345 | acpi_ut_trace_u32 ( |
@@ -354,7 +356,7 @@ acpi_ut_trace_u32 ( | |||
354 | } | 356 | } |
355 | 357 | ||
356 | 358 | ||
357 | /***************************************************************************** | 359 | /******************************************************************************* |
358 | * | 360 | * |
359 | * FUNCTION: acpi_ut_exit | 361 | * FUNCTION: acpi_ut_exit |
360 | * | 362 | * |
@@ -369,7 +371,7 @@ acpi_ut_trace_u32 ( | |||
369 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is | 371 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
370 | * set in debug_level | 372 | * set in debug_level |
371 | * | 373 | * |
372 | ****************************************************************************/ | 374 | ******************************************************************************/ |
373 | 375 | ||
374 | void | 376 | void |
375 | acpi_ut_exit ( | 377 | acpi_ut_exit ( |
@@ -385,7 +387,7 @@ acpi_ut_exit ( | |||
385 | EXPORT_SYMBOL(acpi_ut_exit); | 387 | EXPORT_SYMBOL(acpi_ut_exit); |
386 | 388 | ||
387 | 389 | ||
388 | /***************************************************************************** | 390 | /******************************************************************************* |
389 | * | 391 | * |
390 | * FUNCTION: acpi_ut_status_exit | 392 | * FUNCTION: acpi_ut_status_exit |
391 | * | 393 | * |
@@ -401,7 +403,7 @@ EXPORT_SYMBOL(acpi_ut_exit); | |||
401 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is | 403 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
402 | * set in debug_level. Prints exit status also. | 404 | * set in debug_level. Prints exit status also. |
403 | * | 405 | * |
404 | ****************************************************************************/ | 406 | ******************************************************************************/ |
405 | 407 | ||
406 | void | 408 | void |
407 | acpi_ut_status_exit ( | 409 | acpi_ut_status_exit ( |
@@ -426,7 +428,7 @@ acpi_ut_status_exit ( | |||
426 | EXPORT_SYMBOL(acpi_ut_status_exit); | 428 | EXPORT_SYMBOL(acpi_ut_status_exit); |
427 | 429 | ||
428 | 430 | ||
429 | /***************************************************************************** | 431 | /******************************************************************************* |
430 | * | 432 | * |
431 | * FUNCTION: acpi_ut_value_exit | 433 | * FUNCTION: acpi_ut_value_exit |
432 | * | 434 | * |
@@ -442,7 +444,7 @@ EXPORT_SYMBOL(acpi_ut_status_exit); | |||
442 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is | 444 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
443 | * set in debug_level. Prints exit value also. | 445 | * set in debug_level. Prints exit value also. |
444 | * | 446 | * |
445 | ****************************************************************************/ | 447 | ******************************************************************************/ |
446 | 448 | ||
447 | void | 449 | void |
448 | acpi_ut_value_exit ( | 450 | acpi_ut_value_exit ( |
@@ -460,7 +462,7 @@ acpi_ut_value_exit ( | |||
460 | EXPORT_SYMBOL(acpi_ut_value_exit); | 462 | EXPORT_SYMBOL(acpi_ut_value_exit); |
461 | 463 | ||
462 | 464 | ||
463 | /***************************************************************************** | 465 | /******************************************************************************* |
464 | * | 466 | * |
465 | * FUNCTION: acpi_ut_ptr_exit | 467 | * FUNCTION: acpi_ut_ptr_exit |
466 | * | 468 | * |
@@ -469,14 +471,14 @@ EXPORT_SYMBOL(acpi_ut_value_exit); | |||
469 | * proc_name - Caller's procedure name | 471 | * proc_name - Caller's procedure name |
470 | * module_name - Caller's module name | 472 | * module_name - Caller's module name |
471 | * component_id - Caller's component ID | 473 | * component_id - Caller's component ID |
472 | * Value - Value to be printed with exit msg | 474 | * Ptr - Pointer to display |
473 | * | 475 | * |
474 | * RETURN: None | 476 | * RETURN: None |
475 | * | 477 | * |
476 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is | 478 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
477 | * set in debug_level. Prints exit value also. | 479 | * set in debug_level. Prints exit value also. |
478 | * | 480 | * |
479 | ****************************************************************************/ | 481 | ******************************************************************************/ |
480 | 482 | ||
481 | void | 483 | void |
482 | acpi_ut_ptr_exit ( | 484 | acpi_ut_ptr_exit ( |
@@ -494,7 +496,7 @@ acpi_ut_ptr_exit ( | |||
494 | #endif | 496 | #endif |
495 | 497 | ||
496 | 498 | ||
497 | /***************************************************************************** | 499 | /******************************************************************************* |
498 | * | 500 | * |
499 | * FUNCTION: acpi_ut_dump_buffer | 501 | * FUNCTION: acpi_ut_dump_buffer |
500 | * | 502 | * |
@@ -507,7 +509,7 @@ acpi_ut_ptr_exit ( | |||
507 | * | 509 | * |
508 | * DESCRIPTION: Generic dump buffer in both hex and ascii. | 510 | * DESCRIPTION: Generic dump buffer in both hex and ascii. |
509 | * | 511 | * |
510 | ****************************************************************************/ | 512 | ******************************************************************************/ |
511 | 513 | ||
512 | void | 514 | void |
513 | acpi_ut_dump_buffer ( | 515 | acpi_ut_dump_buffer ( |
@@ -533,34 +535,28 @@ acpi_ut_dump_buffer ( | |||
533 | display = DB_BYTE_DISPLAY; | 535 | display = DB_BYTE_DISPLAY; |
534 | } | 536 | } |
535 | 537 | ||
536 | acpi_os_printf ("\nOffset Value\n"); | 538 | /* Nasty little dump buffer routine! */ |
537 | 539 | ||
538 | /* | ||
539 | * Nasty little dump buffer routine! | ||
540 | */ | ||
541 | while (i < count) { | 540 | while (i < count) { |
542 | /* Print current offset */ | 541 | /* Print current offset */ |
543 | 542 | ||
544 | acpi_os_printf ("%05X ", (u32) i); | 543 | acpi_os_printf ("%6.4X: ", (u32) i); |
545 | 544 | ||
546 | /* Print 16 hex chars */ | 545 | /* Print 16 hex chars */ |
547 | 546 | ||
548 | for (j = 0; j < 16;) { | 547 | for (j = 0; j < 16;) { |
549 | if (i + j >= count) { | 548 | if (i + j >= count) { |
550 | acpi_os_printf ("\n"); | 549 | /* Dump fill spaces */ |
551 | return; | ||
552 | } | ||
553 | 550 | ||
554 | /* Make sure that the s8 doesn't get sign-extended! */ | 551 | acpi_os_printf ("%*s", ((display * 2) + 1), " "); |
552 | j += display; | ||
553 | continue; | ||
554 | } | ||
555 | 555 | ||
556 | switch (display) { | 556 | switch (display) { |
557 | /* Default is BYTE display */ | 557 | default: /* Default is BYTE display */ |
558 | 558 | ||
559 | default: | 559 | acpi_os_printf ("%02X ", buffer[i + j]); |
560 | |||
561 | acpi_os_printf ("%02X ", | ||
562 | *((u8 *) &buffer[i + j])); | ||
563 | j += 1; | ||
564 | break; | 560 | break; |
565 | 561 | ||
566 | 562 | ||
@@ -568,7 +564,6 @@ acpi_ut_dump_buffer ( | |||
568 | 564 | ||
569 | ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]); | 565 | ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]); |
570 | acpi_os_printf ("%04X ", temp32); | 566 | acpi_os_printf ("%04X ", temp32); |
571 | j += 2; | ||
572 | break; | 567 | break; |
573 | 568 | ||
574 | 569 | ||
@@ -576,7 +571,6 @@ acpi_ut_dump_buffer ( | |||
576 | 571 | ||
577 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); | 572 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); |
578 | acpi_os_printf ("%08X ", temp32); | 573 | acpi_os_printf ("%08X ", temp32); |
579 | j += 4; | ||
580 | break; | 574 | break; |
581 | 575 | ||
582 | 576 | ||
@@ -587,15 +581,17 @@ acpi_ut_dump_buffer ( | |||
587 | 581 | ||
588 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]); | 582 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]); |
589 | acpi_os_printf ("%08X ", temp32); | 583 | acpi_os_printf ("%08X ", temp32); |
590 | j += 8; | ||
591 | break; | 584 | break; |
592 | } | 585 | } |
586 | |||
587 | j += display; | ||
593 | } | 588 | } |
594 | 589 | ||
595 | /* | 590 | /* |
596 | * Print the ASCII equivalent characters | 591 | * Print the ASCII equivalent characters |
597 | * But watch out for the bad unprintable ones... | 592 | * But watch out for the bad unprintable ones... |
598 | */ | 593 | */ |
594 | acpi_os_printf (" "); | ||
599 | for (j = 0; j < 16; j++) { | 595 | for (j = 0; j < 16; j++) { |
600 | if (i + j >= count) { | 596 | if (i + j >= count) { |
601 | acpi_os_printf ("\n"); | 597 | acpi_os_printf ("\n"); |