aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utdebug.c')
-rw-r--r--drivers/acpi/utilities/utdebug.c65
1 files changed, 41 insertions, 24 deletions
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 35f3d581e034..5ec1cfcc611d 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -41,8 +41,6 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/module.h>
45
46#include <acpi/acpi.h> 44#include <acpi/acpi.h>
47 45
48#define _COMPONENT ACPI_UTILITIES 46#define _COMPONENT ACPI_UTILITIES
@@ -123,12 +121,14 @@ static const char *acpi_ut_trim_function_name(const char *function_name)
123 /* All Function names are longer than 4 chars, check is safe */ 121 /* All Function names are longer than 4 chars, check is safe */
124 122
125 if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { 123 if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) {
124
126 /* This is the case where the original source has not been modified */ 125 /* This is the case where the original source has not been modified */
127 126
128 return (function_name + 4); 127 return (function_name + 4);
129 } 128 }
130 129
131 if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { 130 if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) {
131
132 /* This is the case where the source has been 'linuxized' */ 132 /* This is the case where the source has been 'linuxized' */
133 133
134 return (function_name + 5); 134 return (function_name + 5);
@@ -162,7 +162,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
162 const char *function_name, 162 const char *function_name,
163 char *module_name, u32 component_id, char *format, ...) 163 char *module_name, u32 component_id, char *format, ...)
164{ 164{
165 u32 thread_id; 165 acpi_thread_id thread_id;
166 va_list args; 166 va_list args;
167 167
168 /* 168 /*
@@ -177,7 +177,6 @@ acpi_ut_debug_print(u32 requested_debug_level,
177 * Thread tracking and context switch notification 177 * Thread tracking and context switch notification
178 */ 178 */
179 thread_id = acpi_os_get_thread_id(); 179 thread_id = acpi_os_get_thread_id();
180
181 if (thread_id != acpi_gbl_prev_thread_id) { 180 if (thread_id != acpi_gbl_prev_thread_id) {
182 if (ACPI_LV_THREADS & acpi_dbg_level) { 181 if (ACPI_LV_THREADS & acpi_dbg_level) {
183 acpi_os_printf 182 acpi_os_printf
@@ -206,7 +205,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
206 acpi_os_vprintf(format, args); 205 acpi_os_vprintf(format, args);
207} 206}
208 207
209EXPORT_SYMBOL(acpi_ut_debug_print); 208ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
210 209
211/******************************************************************************* 210/*******************************************************************************
212 * 211 *
@@ -226,7 +225,6 @@ EXPORT_SYMBOL(acpi_ut_debug_print);
226 * debug_print so that the same macros can be used. 225 * debug_print so that the same macros can be used.
227 * 226 *
228 ******************************************************************************/ 227 ******************************************************************************/
229
230void ACPI_INTERNAL_VAR_XFACE 228void ACPI_INTERNAL_VAR_XFACE
231acpi_ut_debug_print_raw(u32 requested_debug_level, 229acpi_ut_debug_print_raw(u32 requested_debug_level,
232 u32 line_number, 230 u32 line_number,
@@ -244,7 +242,7 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
244 acpi_os_vprintf(format, args); 242 acpi_os_vprintf(format, args);
245} 243}
246 244
247EXPORT_SYMBOL(acpi_ut_debug_print_raw); 245ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
248 246
249/******************************************************************************* 247/*******************************************************************************
250 * 248 *
@@ -261,7 +259,6 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw);
261 * set in debug_level 259 * set in debug_level
262 * 260 *
263 ******************************************************************************/ 261 ******************************************************************************/
264
265void 262void
266acpi_ut_trace(u32 line_number, 263acpi_ut_trace(u32 line_number,
267 const char *function_name, char *module_name, u32 component_id) 264 const char *function_name, char *module_name, u32 component_id)
@@ -275,7 +272,7 @@ acpi_ut_trace(u32 line_number,
275 component_id, "%s\n", acpi_gbl_fn_entry_str); 272 component_id, "%s\n", acpi_gbl_fn_entry_str);
276} 273}
277 274
278EXPORT_SYMBOL(acpi_ut_trace); 275ACPI_EXPORT_SYMBOL(acpi_ut_trace)
279 276
280/******************************************************************************* 277/*******************************************************************************
281 * 278 *
@@ -293,7 +290,6 @@ EXPORT_SYMBOL(acpi_ut_trace);
293 * set in debug_level 290 * set in debug_level
294 * 291 *
295 ******************************************************************************/ 292 ******************************************************************************/
296
297void 293void
298acpi_ut_trace_ptr(u32 line_number, 294acpi_ut_trace_ptr(u32 line_number,
299 const char *function_name, 295 const char *function_name,
@@ -400,7 +396,7 @@ acpi_ut_exit(u32 line_number,
400 acpi_gbl_nesting_level--; 396 acpi_gbl_nesting_level--;
401} 397}
402 398
403EXPORT_SYMBOL(acpi_ut_exit); 399ACPI_EXPORT_SYMBOL(acpi_ut_exit)
404 400
405/******************************************************************************* 401/*******************************************************************************
406 * 402 *
@@ -418,7 +414,6 @@ EXPORT_SYMBOL(acpi_ut_exit);
418 * set in debug_level. Prints exit status also. 414 * set in debug_level. Prints exit status also.
419 * 415 *
420 ******************************************************************************/ 416 ******************************************************************************/
421
422void 417void
423acpi_ut_status_exit(u32 line_number, 418acpi_ut_status_exit(u32 line_number,
424 const char *function_name, 419 const char *function_name,
@@ -442,7 +437,7 @@ acpi_ut_status_exit(u32 line_number,
442 acpi_gbl_nesting_level--; 437 acpi_gbl_nesting_level--;
443} 438}
444 439
445EXPORT_SYMBOL(acpi_ut_status_exit); 440ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
446 441
447/******************************************************************************* 442/*******************************************************************************
448 * 443 *
@@ -460,7 +455,6 @@ EXPORT_SYMBOL(acpi_ut_status_exit);
460 * set in debug_level. Prints exit value also. 455 * set in debug_level. Prints exit value also.
461 * 456 *
462 ******************************************************************************/ 457 ******************************************************************************/
463
464void 458void
465acpi_ut_value_exit(u32 line_number, 459acpi_ut_value_exit(u32 line_number,
466 const char *function_name, 460 const char *function_name,
@@ -475,7 +469,7 @@ acpi_ut_value_exit(u32 line_number,
475 acpi_gbl_nesting_level--; 469 acpi_gbl_nesting_level--;
476} 470}
477 471
478EXPORT_SYMBOL(acpi_ut_value_exit); 472ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
479 473
480/******************************************************************************* 474/*******************************************************************************
481 * 475 *
@@ -493,7 +487,6 @@ EXPORT_SYMBOL(acpi_ut_value_exit);
493 * set in debug_level. Prints exit value also. 487 * set in debug_level. Prints exit value also.
494 * 488 *
495 ******************************************************************************/ 489 ******************************************************************************/
496
497void 490void
498acpi_ut_ptr_exit(u32 line_number, 491acpi_ut_ptr_exit(u32 line_number,
499 const char *function_name, 492 const char *function_name,
@@ -524,20 +517,13 @@ acpi_ut_ptr_exit(u32 line_number,
524 * 517 *
525 ******************************************************************************/ 518 ******************************************************************************/
526 519
527void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id) 520void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
528{ 521{
529 acpi_native_uint i = 0; 522 acpi_native_uint i = 0;
530 acpi_native_uint j; 523 acpi_native_uint j;
531 u32 temp32; 524 u32 temp32;
532 u8 buf_char; 525 u8 buf_char;
533 526
534 /* Only dump the buffer if tracing is enabled */
535
536 if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
537 (component_id & acpi_dbg_layer))) {
538 return;
539 }
540
541 if ((count < 4) || (count & 0x01)) { 527 if ((count < 4) || (count & 0x01)) {
542 display = DB_BYTE_DISPLAY; 528 display = DB_BYTE_DISPLAY;
543 } 529 }
@@ -545,6 +531,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
545 /* Nasty little dump buffer routine! */ 531 /* Nasty little dump buffer routine! */
546 532
547 while (i < count) { 533 while (i < count) {
534
548 /* Print current offset */ 535 /* Print current offset */
549 536
550 acpi_os_printf("%6.4X: ", (u32) i); 537 acpi_os_printf("%6.4X: ", (u32) i);
@@ -553,6 +540,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
553 540
554 for (j = 0; j < 16;) { 541 for (j = 0; j < 16;) {
555 if (i + j >= count) { 542 if (i + j >= count) {
543
556 /* Dump fill spaces */ 544 /* Dump fill spaces */
557 545
558 acpi_os_printf("%*s", ((display * 2) + 1), " "); 546 acpi_os_printf("%*s", ((display * 2) + 1), " ");
@@ -561,6 +549,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
561 } 549 }
562 550
563 switch (display) { 551 switch (display) {
552 case DB_BYTE_DISPLAY:
564 default: /* Default is BYTE display */ 553 default: /* Default is BYTE display */
565 554
566 acpi_os_printf("%02X ", buffer[i + j]); 555 acpi_os_printf("%02X ", buffer[i + j]);
@@ -618,3 +607,31 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
618 607
619 return; 608 return;
620} 609}
610
611/*******************************************************************************
612 *
613 * FUNCTION: acpi_ut_dump_buffer
614 *
615 * PARAMETERS: Buffer - Buffer to dump
616 * Count - Amount to dump, in bytes
617 * Display - BYTE, WORD, DWORD, or QWORD display
618 * component_iD - Caller's component ID
619 *
620 * RETURN: None
621 *
622 * DESCRIPTION: Generic dump buffer in both hex and ascii.
623 *
624 ******************************************************************************/
625
626void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
627{
628
629 /* Only dump the buffer if tracing is enabled */
630
631 if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
632 (component_id & acpi_dbg_layer))) {
633 return;
634 }
635
636 acpi_ut_dump_buffer2(buffer, count, display);
637}