diff options
Diffstat (limited to 'drivers/acpi/utilities/utdebug.c')
-rw-r--r-- | drivers/acpi/utilities/utdebug.c | 330 |
1 files changed, 135 insertions, 195 deletions
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index c27cbb7f5c54..081a778aba88 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c | |||
@@ -46,21 +46,16 @@ | |||
46 | #include <acpi/acpi.h> | 46 | #include <acpi/acpi.h> |
47 | 47 | ||
48 | #define _COMPONENT ACPI_UTILITIES | 48 | #define _COMPONENT ACPI_UTILITIES |
49 | ACPI_MODULE_NAME ("utdebug") | 49 | ACPI_MODULE_NAME("utdebug") |
50 | |||
51 | 50 | ||
52 | #ifdef ACPI_DEBUG_OUTPUT | 51 | #ifdef ACPI_DEBUG_OUTPUT |
53 | 52 | static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; | |
54 | static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; | 53 | static char *acpi_gbl_fn_entry_str = "----Entry"; |
55 | static char *acpi_gbl_fn_entry_str = "----Entry"; | 54 | static char *acpi_gbl_fn_exit_str = "----Exit-"; |
56 | static char *acpi_gbl_fn_exit_str = "----Exit-"; | ||
57 | 55 | ||
58 | /* Local prototypes */ | 56 | /* Local prototypes */ |
59 | 57 | ||
60 | static const char * | 58 | static const char *acpi_ut_trim_function_name(const char *function_name); |
61 | acpi_ut_trim_function_name ( | ||
62 | const char *function_name); | ||
63 | |||
64 | 59 | ||
65 | /******************************************************************************* | 60 | /******************************************************************************* |
66 | * | 61 | * |
@@ -74,17 +69,13 @@ acpi_ut_trim_function_name ( | |||
74 | * | 69 | * |
75 | ******************************************************************************/ | 70 | ******************************************************************************/ |
76 | 71 | ||
77 | void | 72 | void acpi_ut_init_stack_ptr_trace(void) |
78 | acpi_ut_init_stack_ptr_trace ( | ||
79 | void) | ||
80 | { | 73 | { |
81 | u32 current_sp; | 74 | u32 current_sp; |
82 | |||
83 | 75 | ||
84 | acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF (¤t_sp, NULL); | 76 | acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF(¤t_sp, NULL); |
85 | } | 77 | } |
86 | 78 | ||
87 | |||
88 | /******************************************************************************* | 79 | /******************************************************************************* |
89 | * | 80 | * |
90 | * FUNCTION: acpi_ut_track_stack_ptr | 81 | * FUNCTION: acpi_ut_track_stack_ptr |
@@ -97,14 +88,11 @@ acpi_ut_init_stack_ptr_trace ( | |||
97 | * | 88 | * |
98 | ******************************************************************************/ | 89 | ******************************************************************************/ |
99 | 90 | ||
100 | void | 91 | void acpi_ut_track_stack_ptr(void) |
101 | acpi_ut_track_stack_ptr ( | ||
102 | void) | ||
103 | { | 92 | { |
104 | acpi_size current_sp; | 93 | acpi_size current_sp; |
105 | 94 | ||
106 | 95 | current_sp = ACPI_PTR_DIFF(¤t_sp, NULL); | |
107 | current_sp = ACPI_PTR_DIFF (¤t_sp, NULL); | ||
108 | 96 | ||
109 | if (current_sp < acpi_gbl_lowest_stack_pointer) { | 97 | if (current_sp < acpi_gbl_lowest_stack_pointer) { |
110 | acpi_gbl_lowest_stack_pointer = current_sp; | 98 | acpi_gbl_lowest_stack_pointer = current_sp; |
@@ -115,7 +103,6 @@ acpi_ut_track_stack_ptr ( | |||
115 | } | 103 | } |
116 | } | 104 | } |
117 | 105 | ||
118 | |||
119 | /******************************************************************************* | 106 | /******************************************************************************* |
120 | * | 107 | * |
121 | * FUNCTION: acpi_ut_trim_function_name | 108 | * FUNCTION: acpi_ut_trim_function_name |
@@ -130,20 +117,18 @@ acpi_ut_track_stack_ptr ( | |||
130 | * | 117 | * |
131 | ******************************************************************************/ | 118 | ******************************************************************************/ |
132 | 119 | ||
133 | static const char * | 120 | static const char *acpi_ut_trim_function_name(const char *function_name) |
134 | acpi_ut_trim_function_name ( | ||
135 | const char *function_name) | ||
136 | { | 121 | { |
137 | 122 | ||
138 | /* All Function names are longer than 4 chars, check is safe */ | 123 | /* All Function names are longer than 4 chars, check is safe */ |
139 | 124 | ||
140 | if (*(ACPI_CAST_PTR (u32, function_name)) == ACPI_FUNCTION_PREFIX1) { | 125 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_FUNCTION_PREFIX1) { |
141 | /* This is the case where the original source has not been modified */ | 126 | /* This is the case where the original source has not been modified */ |
142 | 127 | ||
143 | return (function_name + 4); | 128 | return (function_name + 4); |
144 | } | 129 | } |
145 | 130 | ||
146 | if (*(ACPI_CAST_PTR (u32, function_name)) == ACPI_FUNCTION_PREFIX2) { | 131 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_FUNCTION_PREFIX2) { |
147 | /* This is the case where the source has been 'linuxized' */ | 132 | /* This is the case where the source has been 'linuxized' */ |
148 | 133 | ||
149 | return (function_name + 5); | 134 | return (function_name + 5); |
@@ -152,7 +137,6 @@ acpi_ut_trim_function_name ( | |||
152 | return (function_name); | 137 | return (function_name); |
153 | } | 138 | } |
154 | 139 | ||
155 | |||
156 | /******************************************************************************* | 140 | /******************************************************************************* |
157 | * | 141 | * |
158 | * FUNCTION: acpi_ut_debug_print | 142 | * FUNCTION: acpi_ut_debug_print |
@@ -172,38 +156,33 @@ acpi_ut_trim_function_name ( | |||
172 | * | 156 | * |
173 | ******************************************************************************/ | 157 | ******************************************************************************/ |
174 | 158 | ||
175 | void ACPI_INTERNAL_VAR_XFACE | 159 | void ACPI_INTERNAL_VAR_XFACE |
176 | acpi_ut_debug_print ( | 160 | acpi_ut_debug_print(u32 requested_debug_level, |
177 | u32 requested_debug_level, | 161 | u32 line_number, |
178 | u32 line_number, | 162 | const char *function_name, |
179 | const char *function_name, | 163 | char *module_name, u32 component_id, char *format, ...) |
180 | char *module_name, | ||
181 | u32 component_id, | ||
182 | char *format, | ||
183 | ...) | ||
184 | { | 164 | { |
185 | u32 thread_id; | 165 | u32 thread_id; |
186 | va_list args; | 166 | va_list args; |
187 | |||
188 | 167 | ||
189 | /* | 168 | /* |
190 | * Stay silent if the debug level or component ID is disabled | 169 | * Stay silent if the debug level or component ID is disabled |
191 | */ | 170 | */ |
192 | if (!(requested_debug_level & acpi_dbg_level) || | 171 | if (!(requested_debug_level & acpi_dbg_level) || |
193 | !(component_id & acpi_dbg_layer)) { | 172 | !(component_id & acpi_dbg_layer)) { |
194 | return; | 173 | return; |
195 | } | 174 | } |
196 | 175 | ||
197 | /* | 176 | /* |
198 | * Thread tracking and context switch notification | 177 | * Thread tracking and context switch notification |
199 | */ | 178 | */ |
200 | thread_id = acpi_os_get_thread_id (); | 179 | thread_id = acpi_os_get_thread_id(); |
201 | 180 | ||
202 | if (thread_id != acpi_gbl_prev_thread_id) { | 181 | if (thread_id != acpi_gbl_prev_thread_id) { |
203 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 182 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
204 | acpi_os_printf ( | 183 | acpi_os_printf |
205 | "\n**** Context Switch from TID %X to TID %X ****\n\n", | 184 | ("\n**** Context Switch from TID %X to TID %X ****\n\n", |
206 | acpi_gbl_prev_thread_id, thread_id); | 185 | acpi_gbl_prev_thread_id, thread_id); |
207 | } | 186 | } |
208 | 187 | ||
209 | acpi_gbl_prev_thread_id = thread_id; | 188 | acpi_gbl_prev_thread_id = thread_id; |
@@ -213,17 +192,18 @@ acpi_ut_debug_print ( | |||
213 | * Display the module name, current line number, thread ID (if requested), | 192 | * Display the module name, current line number, thread ID (if requested), |
214 | * current procedure nesting level, and the current procedure name | 193 | * current procedure nesting level, and the current procedure name |
215 | */ | 194 | */ |
216 | acpi_os_printf ("%8s-%04ld ", module_name, line_number); | 195 | acpi_os_printf("%8s-%04ld ", module_name, line_number); |
217 | 196 | ||
218 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 197 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
219 | acpi_os_printf ("[%04lX] ", thread_id); | 198 | acpi_os_printf("[%04lX] ", thread_id); |
220 | } | 199 | } |
221 | 200 | ||
222 | acpi_os_printf ("[%02ld] %-22.22s: ", | 201 | acpi_os_printf("[%02ld] %-22.22s: ", |
223 | acpi_gbl_nesting_level, acpi_ut_trim_function_name (function_name)); | 202 | acpi_gbl_nesting_level, |
203 | acpi_ut_trim_function_name(function_name)); | ||
224 | 204 | ||
225 | va_start (args, format); | 205 | va_start(args, format); |
226 | acpi_os_vprintf (format, args); | 206 | acpi_os_vprintf(format, args); |
227 | } | 207 | } |
228 | 208 | ||
229 | EXPORT_SYMBOL(acpi_ut_debug_print); | 209 | EXPORT_SYMBOL(acpi_ut_debug_print); |
@@ -247,29 +227,24 @@ EXPORT_SYMBOL(acpi_ut_debug_print); | |||
247 | * | 227 | * |
248 | ******************************************************************************/ | 228 | ******************************************************************************/ |
249 | 229 | ||
250 | void ACPI_INTERNAL_VAR_XFACE | 230 | void ACPI_INTERNAL_VAR_XFACE |
251 | acpi_ut_debug_print_raw ( | 231 | acpi_ut_debug_print_raw(u32 requested_debug_level, |
252 | u32 requested_debug_level, | 232 | u32 line_number, |
253 | u32 line_number, | 233 | const char *function_name, |
254 | const char *function_name, | 234 | char *module_name, u32 component_id, char *format, ...) |
255 | char *module_name, | ||
256 | u32 component_id, | ||
257 | char *format, | ||
258 | ...) | ||
259 | { | 235 | { |
260 | va_list args; | 236 | va_list args; |
261 | |||
262 | 237 | ||
263 | if (!(requested_debug_level & acpi_dbg_level) || | 238 | if (!(requested_debug_level & acpi_dbg_level) || |
264 | !(component_id & acpi_dbg_layer)) { | 239 | !(component_id & acpi_dbg_layer)) { |
265 | return; | 240 | return; |
266 | } | 241 | } |
267 | 242 | ||
268 | va_start (args, format); | 243 | va_start(args, format); |
269 | acpi_os_vprintf (format, args); | 244 | acpi_os_vprintf(format, args); |
270 | } | 245 | } |
271 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); | ||
272 | 246 | ||
247 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); | ||
273 | 248 | ||
274 | /******************************************************************************* | 249 | /******************************************************************************* |
275 | * | 250 | * |
@@ -288,22 +263,19 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw); | |||
288 | ******************************************************************************/ | 263 | ******************************************************************************/ |
289 | 264 | ||
290 | void | 265 | void |
291 | acpi_ut_trace ( | 266 | acpi_ut_trace(u32 line_number, |
292 | u32 line_number, | 267 | const char *function_name, char *module_name, u32 component_id) |
293 | const char *function_name, | ||
294 | char *module_name, | ||
295 | u32 component_id) | ||
296 | { | 268 | { |
297 | 269 | ||
298 | acpi_gbl_nesting_level++; | 270 | acpi_gbl_nesting_level++; |
299 | acpi_ut_track_stack_ptr (); | 271 | acpi_ut_track_stack_ptr(); |
300 | 272 | ||
301 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 273 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
302 | line_number, function_name, module_name, component_id, | 274 | line_number, function_name, module_name, |
303 | "%s\n", acpi_gbl_fn_entry_str); | 275 | component_id, "%s\n", acpi_gbl_fn_entry_str); |
304 | } | 276 | } |
305 | EXPORT_SYMBOL(acpi_ut_trace); | ||
306 | 277 | ||
278 | EXPORT_SYMBOL(acpi_ut_trace); | ||
307 | 279 | ||
308 | /******************************************************************************* | 280 | /******************************************************************************* |
309 | * | 281 | * |
@@ -323,22 +295,19 @@ EXPORT_SYMBOL(acpi_ut_trace); | |||
323 | ******************************************************************************/ | 295 | ******************************************************************************/ |
324 | 296 | ||
325 | void | 297 | void |
326 | acpi_ut_trace_ptr ( | 298 | acpi_ut_trace_ptr(u32 line_number, |
327 | u32 line_number, | 299 | const char *function_name, |
328 | const char *function_name, | 300 | char *module_name, u32 component_id, void *pointer) |
329 | char *module_name, | ||
330 | u32 component_id, | ||
331 | void *pointer) | ||
332 | { | 301 | { |
333 | acpi_gbl_nesting_level++; | 302 | acpi_gbl_nesting_level++; |
334 | acpi_ut_track_stack_ptr (); | 303 | acpi_ut_track_stack_ptr(); |
335 | 304 | ||
336 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 305 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
337 | line_number, function_name, module_name, component_id, | 306 | line_number, function_name, module_name, |
338 | "%s %p\n", acpi_gbl_fn_entry_str, pointer); | 307 | component_id, "%s %p\n", acpi_gbl_fn_entry_str, |
308 | pointer); | ||
339 | } | 309 | } |
340 | 310 | ||
341 | |||
342 | /******************************************************************************* | 311 | /******************************************************************************* |
343 | * | 312 | * |
344 | * FUNCTION: acpi_ut_trace_str | 313 | * FUNCTION: acpi_ut_trace_str |
@@ -357,23 +326,20 @@ acpi_ut_trace_ptr ( | |||
357 | ******************************************************************************/ | 326 | ******************************************************************************/ |
358 | 327 | ||
359 | void | 328 | void |
360 | acpi_ut_trace_str ( | 329 | acpi_ut_trace_str(u32 line_number, |
361 | u32 line_number, | 330 | const char *function_name, |
362 | const char *function_name, | 331 | char *module_name, u32 component_id, char *string) |
363 | char *module_name, | ||
364 | u32 component_id, | ||
365 | char *string) | ||
366 | { | 332 | { |
367 | 333 | ||
368 | acpi_gbl_nesting_level++; | 334 | acpi_gbl_nesting_level++; |
369 | acpi_ut_track_stack_ptr (); | 335 | acpi_ut_track_stack_ptr(); |
370 | 336 | ||
371 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 337 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
372 | line_number, function_name, module_name, component_id, | 338 | line_number, function_name, module_name, |
373 | "%s %s\n", acpi_gbl_fn_entry_str, string); | 339 | component_id, "%s %s\n", acpi_gbl_fn_entry_str, |
340 | string); | ||
374 | } | 341 | } |
375 | 342 | ||
376 | |||
377 | /******************************************************************************* | 343 | /******************************************************************************* |
378 | * | 344 | * |
379 | * FUNCTION: acpi_ut_trace_u32 | 345 | * FUNCTION: acpi_ut_trace_u32 |
@@ -392,23 +358,20 @@ acpi_ut_trace_str ( | |||
392 | ******************************************************************************/ | 358 | ******************************************************************************/ |
393 | 359 | ||
394 | void | 360 | void |
395 | acpi_ut_trace_u32 ( | 361 | acpi_ut_trace_u32(u32 line_number, |
396 | u32 line_number, | 362 | const char *function_name, |
397 | const char *function_name, | 363 | char *module_name, u32 component_id, u32 integer) |
398 | char *module_name, | ||
399 | u32 component_id, | ||
400 | u32 integer) | ||
401 | { | 364 | { |
402 | 365 | ||
403 | acpi_gbl_nesting_level++; | 366 | acpi_gbl_nesting_level++; |
404 | acpi_ut_track_stack_ptr (); | 367 | acpi_ut_track_stack_ptr(); |
405 | 368 | ||
406 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 369 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
407 | line_number, function_name, module_name, component_id, | 370 | line_number, function_name, module_name, |
408 | "%s %08X\n", acpi_gbl_fn_entry_str, integer); | 371 | component_id, "%s %08X\n", acpi_gbl_fn_entry_str, |
372 | integer); | ||
409 | } | 373 | } |
410 | 374 | ||
411 | |||
412 | /******************************************************************************* | 375 | /******************************************************************************* |
413 | * | 376 | * |
414 | * FUNCTION: acpi_ut_exit | 377 | * FUNCTION: acpi_ut_exit |
@@ -426,21 +389,18 @@ acpi_ut_trace_u32 ( | |||
426 | ******************************************************************************/ | 389 | ******************************************************************************/ |
427 | 390 | ||
428 | void | 391 | void |
429 | acpi_ut_exit ( | 392 | acpi_ut_exit(u32 line_number, |
430 | u32 line_number, | 393 | const char *function_name, char *module_name, u32 component_id) |
431 | const char *function_name, | ||
432 | char *module_name, | ||
433 | u32 component_id) | ||
434 | { | 394 | { |
435 | 395 | ||
436 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 396 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
437 | line_number, function_name, module_name, component_id, | 397 | line_number, function_name, module_name, |
438 | "%s\n", acpi_gbl_fn_exit_str); | 398 | component_id, "%s\n", acpi_gbl_fn_exit_str); |
439 | 399 | ||
440 | acpi_gbl_nesting_level--; | 400 | acpi_gbl_nesting_level--; |
441 | } | 401 | } |
442 | EXPORT_SYMBOL(acpi_ut_exit); | ||
443 | 402 | ||
403 | EXPORT_SYMBOL(acpi_ut_exit); | ||
444 | 404 | ||
445 | /******************************************************************************* | 405 | /******************************************************************************* |
446 | * | 406 | * |
@@ -460,31 +420,29 @@ EXPORT_SYMBOL(acpi_ut_exit); | |||
460 | ******************************************************************************/ | 420 | ******************************************************************************/ |
461 | 421 | ||
462 | void | 422 | void |
463 | acpi_ut_status_exit ( | 423 | acpi_ut_status_exit(u32 line_number, |
464 | u32 line_number, | 424 | const char *function_name, |
465 | const char *function_name, | 425 | char *module_name, u32 component_id, acpi_status status) |
466 | char *module_name, | ||
467 | u32 component_id, | ||
468 | acpi_status status) | ||
469 | { | 426 | { |
470 | 427 | ||
471 | if (ACPI_SUCCESS (status)) { | 428 | if (ACPI_SUCCESS(status)) { |
472 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 429 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
473 | line_number, function_name, module_name, component_id, | 430 | line_number, function_name, module_name, |
474 | "%s %s\n", acpi_gbl_fn_exit_str, | 431 | component_id, "%s %s\n", |
475 | acpi_format_exception (status)); | 432 | acpi_gbl_fn_exit_str, |
476 | } | 433 | acpi_format_exception(status)); |
477 | else { | 434 | } else { |
478 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 435 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
479 | line_number, function_name, module_name, component_id, | 436 | line_number, function_name, module_name, |
480 | "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str, | 437 | component_id, "%s ****Exception****: %s\n", |
481 | acpi_format_exception (status)); | 438 | acpi_gbl_fn_exit_str, |
439 | acpi_format_exception(status)); | ||
482 | } | 440 | } |
483 | 441 | ||
484 | acpi_gbl_nesting_level--; | 442 | acpi_gbl_nesting_level--; |
485 | } | 443 | } |
486 | EXPORT_SYMBOL(acpi_ut_status_exit); | ||
487 | 444 | ||
445 | EXPORT_SYMBOL(acpi_ut_status_exit); | ||
488 | 446 | ||
489 | /******************************************************************************* | 447 | /******************************************************************************* |
490 | * | 448 | * |
@@ -504,23 +462,20 @@ EXPORT_SYMBOL(acpi_ut_status_exit); | |||
504 | ******************************************************************************/ | 462 | ******************************************************************************/ |
505 | 463 | ||
506 | void | 464 | void |
507 | acpi_ut_value_exit ( | 465 | acpi_ut_value_exit(u32 line_number, |
508 | u32 line_number, | 466 | const char *function_name, |
509 | const char *function_name, | 467 | char *module_name, u32 component_id, acpi_integer value) |
510 | char *module_name, | ||
511 | u32 component_id, | ||
512 | acpi_integer value) | ||
513 | { | 468 | { |
514 | 469 | ||
515 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 470 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
516 | line_number, function_name, module_name, component_id, | 471 | line_number, function_name, module_name, |
517 | "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, | 472 | component_id, "%s %8.8X%8.8X\n", |
518 | ACPI_FORMAT_UINT64 (value)); | 473 | acpi_gbl_fn_exit_str, ACPI_FORMAT_UINT64(value)); |
519 | 474 | ||
520 | acpi_gbl_nesting_level--; | 475 | acpi_gbl_nesting_level--; |
521 | } | 476 | } |
522 | EXPORT_SYMBOL(acpi_ut_value_exit); | ||
523 | 477 | ||
478 | EXPORT_SYMBOL(acpi_ut_value_exit); | ||
524 | 479 | ||
525 | /******************************************************************************* | 480 | /******************************************************************************* |
526 | * | 481 | * |
@@ -540,24 +495,20 @@ EXPORT_SYMBOL(acpi_ut_value_exit); | |||
540 | ******************************************************************************/ | 495 | ******************************************************************************/ |
541 | 496 | ||
542 | void | 497 | void |
543 | acpi_ut_ptr_exit ( | 498 | acpi_ut_ptr_exit(u32 line_number, |
544 | u32 line_number, | 499 | const char *function_name, |
545 | const char *function_name, | 500 | char *module_name, u32 component_id, u8 * ptr) |
546 | char *module_name, | ||
547 | u32 component_id, | ||
548 | u8 *ptr) | ||
549 | { | 501 | { |
550 | 502 | ||
551 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, | 503 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
552 | line_number, function_name, module_name, component_id, | 504 | line_number, function_name, module_name, |
553 | "%s %p\n", acpi_gbl_fn_exit_str, ptr); | 505 | component_id, "%s %p\n", acpi_gbl_fn_exit_str, ptr); |
554 | 506 | ||
555 | acpi_gbl_nesting_level--; | 507 | acpi_gbl_nesting_level--; |
556 | } | 508 | } |
557 | 509 | ||
558 | #endif | 510 | #endif |
559 | 511 | ||
560 | |||
561 | /******************************************************************************* | 512 | /******************************************************************************* |
562 | * | 513 | * |
563 | * FUNCTION: acpi_ut_dump_buffer | 514 | * FUNCTION: acpi_ut_dump_buffer |
@@ -573,23 +524,17 @@ acpi_ut_ptr_exit ( | |||
573 | * | 524 | * |
574 | ******************************************************************************/ | 525 | ******************************************************************************/ |
575 | 526 | ||
576 | void | 527 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id) |
577 | acpi_ut_dump_buffer ( | ||
578 | u8 *buffer, | ||
579 | u32 count, | ||
580 | u32 display, | ||
581 | u32 component_id) | ||
582 | { | 528 | { |
583 | acpi_native_uint i = 0; | 529 | acpi_native_uint i = 0; |
584 | acpi_native_uint j; | 530 | acpi_native_uint j; |
585 | u32 temp32; | 531 | u32 temp32; |
586 | u8 buf_char; | 532 | u8 buf_char; |
587 | |||
588 | 533 | ||
589 | /* Only dump the buffer if tracing is enabled */ | 534 | /* Only dump the buffer if tracing is enabled */ |
590 | 535 | ||
591 | if (!((ACPI_LV_TABLES & acpi_dbg_level) && | 536 | if (!((ACPI_LV_TABLES & acpi_dbg_level) && |
592 | (component_id & acpi_dbg_layer))) { | 537 | (component_id & acpi_dbg_layer))) { |
593 | return; | 538 | return; |
594 | } | 539 | } |
595 | 540 | ||
@@ -602,7 +547,7 @@ acpi_ut_dump_buffer ( | |||
602 | while (i < count) { | 547 | while (i < count) { |
603 | /* Print current offset */ | 548 | /* Print current offset */ |
604 | 549 | ||
605 | acpi_os_printf ("%6.4X: ", (u32) i); | 550 | acpi_os_printf("%6.4X: ", (u32) i); |
606 | 551 | ||
607 | /* Print 16 hex chars */ | 552 | /* Print 16 hex chars */ |
608 | 553 | ||
@@ -610,39 +555,36 @@ acpi_ut_dump_buffer ( | |||
610 | if (i + j >= count) { | 555 | if (i + j >= count) { |
611 | /* Dump fill spaces */ | 556 | /* Dump fill spaces */ |
612 | 557 | ||
613 | acpi_os_printf ("%*s", ((display * 2) + 1), " "); | 558 | acpi_os_printf("%*s", ((display * 2) + 1), " "); |
614 | j += (acpi_native_uint) display; | 559 | j += (acpi_native_uint) display; |
615 | continue; | 560 | continue; |
616 | } | 561 | } |
617 | 562 | ||
618 | switch (display) { | 563 | switch (display) { |
619 | default: /* Default is BYTE display */ | 564 | default: /* Default is BYTE display */ |
620 | 565 | ||
621 | acpi_os_printf ("%02X ", buffer[i + j]); | 566 | acpi_os_printf("%02X ", buffer[i + j]); |
622 | break; | 567 | break; |
623 | 568 | ||
624 | |||
625 | case DB_WORD_DISPLAY: | 569 | case DB_WORD_DISPLAY: |
626 | 570 | ||
627 | ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]); | 571 | ACPI_MOVE_16_TO_32(&temp32, &buffer[i + j]); |
628 | acpi_os_printf ("%04X ", temp32); | 572 | acpi_os_printf("%04X ", temp32); |
629 | break; | 573 | break; |
630 | 574 | ||
631 | |||
632 | case DB_DWORD_DISPLAY: | 575 | case DB_DWORD_DISPLAY: |
633 | 576 | ||
634 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); | 577 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); |
635 | acpi_os_printf ("%08X ", temp32); | 578 | acpi_os_printf("%08X ", temp32); |
636 | break; | 579 | break; |
637 | 580 | ||
638 | |||
639 | case DB_QWORD_DISPLAY: | 581 | case DB_QWORD_DISPLAY: |
640 | 582 | ||
641 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); | 583 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); |
642 | acpi_os_printf ("%08X", temp32); | 584 | acpi_os_printf("%08X", temp32); |
643 | 585 | ||
644 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]); | 586 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j + 4]); |
645 | acpi_os_printf ("%08X ", temp32); | 587 | acpi_os_printf("%08X ", temp32); |
646 | break; | 588 | break; |
647 | } | 589 | } |
648 | 590 | ||
@@ -653,28 +595,26 @@ acpi_ut_dump_buffer ( | |||
653 | * Print the ASCII equivalent characters but watch out for the bad | 595 | * Print the ASCII equivalent characters but watch out for the bad |
654 | * unprintable ones (printable chars are 0x20 through 0x7E) | 596 | * unprintable ones (printable chars are 0x20 through 0x7E) |
655 | */ | 597 | */ |
656 | acpi_os_printf (" "); | 598 | acpi_os_printf(" "); |
657 | for (j = 0; j < 16; j++) { | 599 | for (j = 0; j < 16; j++) { |
658 | if (i + j >= count) { | 600 | if (i + j >= count) { |
659 | acpi_os_printf ("\n"); | 601 | acpi_os_printf("\n"); |
660 | return; | 602 | return; |
661 | } | 603 | } |
662 | 604 | ||
663 | buf_char = buffer[i + j]; | 605 | buf_char = buffer[i + j]; |
664 | if (ACPI_IS_PRINT (buf_char)) { | 606 | if (ACPI_IS_PRINT(buf_char)) { |
665 | acpi_os_printf ("%c", buf_char); | 607 | acpi_os_printf("%c", buf_char); |
666 | } | 608 | } else { |
667 | else { | 609 | acpi_os_printf("."); |
668 | acpi_os_printf ("."); | ||
669 | } | 610 | } |
670 | } | 611 | } |
671 | 612 | ||
672 | /* Done with that line. */ | 613 | /* Done with that line. */ |
673 | 614 | ||
674 | acpi_os_printf ("\n"); | 615 | acpi_os_printf("\n"); |
675 | i += 16; | 616 | i += 16; |
676 | } | 617 | } |
677 | 618 | ||
678 | return; | 619 | return; |
679 | } | 620 | } |
680 | |||