aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-12-30 19:06:33 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:21 -0500
commit0377b5acba2f258640822efe56fb29bada68bbe2 (patch)
tree082b2974757dfcfb422ca05da4a588846b5e3323
parent10e9e75926ebec672d8a5031efbb21c938ca1820 (diff)
ACPICA: Merge all debug output macros into a single file, acoutput.
Moved the debug trace macros from acmacros.h into acoutput.h where they belong. 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>
-rw-r--r--drivers/acpi/acpica/acmacros.h126
-rw-r--r--include/acpi/acoutput.h115
2 files changed, 115 insertions, 126 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 81f3cf7a4a59..2db0f103403b 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -388,132 +388,6 @@
388 388
389#endif /* ACPI_NO_ERROR_MESSAGES */ 389#endif /* ACPI_NO_ERROR_MESSAGES */
390 390
391/*
392 * Debug macros that are conditionally compiled
393 */
394#ifdef ACPI_DEBUG_OUTPUT
395
396/*
397 * Function entry tracing
398 *
399 * The name of the function is emitted as a local variable that is
400 * intended to be used by both the entry trace and the exit trace.
401 */
402
403/* Helper macro */
404
405#define ACPI_TRACE_ENTRY(name, function, cast, param) \
406 ACPI_FUNCTION_NAME (name) \
407 function (ACPI_DEBUG_PARAMETERS, cast (param))
408
409/* The actual entry trace macros */
410
411#define ACPI_FUNCTION_TRACE(name) \
412 ACPI_FUNCTION_NAME(name) \
413 acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
414
415#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
416 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
417
418#define ACPI_FUNCTION_TRACE_U32(name, value) \
419 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
420
421#define ACPI_FUNCTION_TRACE_STR(name, string) \
422 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
423
424#define ACPI_FUNCTION_ENTRY() \
425 acpi_ut_track_stack_ptr()
426
427/*
428 * Function exit tracing
429 *
430 * These macros include a return statement. This is usually considered
431 * bad form, but having a separate exit macro before the actual return
432 * is very ugly and difficult to maintain.
433 *
434 * One of the FUNCTION_TRACE macros above must be used in conjunction
435 * with these macros so that "_AcpiFunctionName" is defined.
436 *
437 * Note: the DO_WHILE0 macro is used to prevent some compilers from
438 * complaining about these constructs. On other compilers the do...while
439 * adds some extra code, so this feature is optional.
440 */
441#ifdef ACPI_USE_DO_WHILE_0
442#define ACPI_DO_WHILE0(a) do a while(0)
443#else
444#define ACPI_DO_WHILE0(a) a
445#endif
446
447/* Exit trace helper macro */
448
449#define ACPI_TRACE_EXIT(function, cast, param) \
450 ACPI_DO_WHILE0 ({ \
451 function (ACPI_DEBUG_PARAMETERS, cast (param)); \
452 return ((param)); \
453 })
454
455/* The actual exit macros */
456
457#define return_VOID \
458 ACPI_DO_WHILE0 ({ \
459 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
460 return; \
461 })
462
463#define return_ACPI_STATUS(status) \
464 ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
465
466#define return_PTR(pointer) \
467 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
468
469#define return_VALUE(value) \
470 ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
471
472/* Conditional execution */
473
474#define ACPI_DEBUG_EXEC(a) a
475#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
476#define _VERBOSE_STRUCTURES
477
478/* Various object display routines for debug */
479
480#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
481#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
482#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
483#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
484#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
485
486#else
487/*
488 * This is the non-debug case -- make everything go away,
489 * leaving no executable debug code!
490 */
491#define ACPI_DEBUG_EXEC(a)
492#define ACPI_DEBUG_ONLY_MEMBERS(a)
493#define ACPI_FUNCTION_TRACE(a)
494#define ACPI_FUNCTION_TRACE_PTR(a, b)
495#define ACPI_FUNCTION_TRACE_U32(a, b)
496#define ACPI_FUNCTION_TRACE_STR(a, b)
497#define ACPI_FUNCTION_EXIT
498#define ACPI_FUNCTION_STATUS_EXIT(s)
499#define ACPI_FUNCTION_VALUE_EXIT(s)
500#define ACPI_FUNCTION_ENTRY()
501#define ACPI_DUMP_STACK_ENTRY(a)
502#define ACPI_DUMP_OPERANDS(a, b, c)
503#define ACPI_DUMP_ENTRY(a, b)
504#define ACPI_DUMP_TABLES(a, b)
505#define ACPI_DUMP_PATHNAME(a, b, c, d)
506#define ACPI_DUMP_BUFFER(a, b)
507#define ACPI_DEBUG_PRINT(pl)
508#define ACPI_DEBUG_PRINT_RAW(pl)
509
510#define return_VOID return
511#define return_ACPI_STATUS(s) return(s)
512#define return_VALUE(s) return(s)
513#define return_PTR(s) return(s)
514
515#endif /* ACPI_DEBUG_OUTPUT */
516
517#if (!ACPI_REDUCED_HARDWARE) 391#if (!ACPI_REDUCED_HARDWARE)
518#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr 392#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
519#else 393#else
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 5ef4e57adc9e..c13b351a254d 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -300,7 +300,97 @@
300#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ 300#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
301 ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__) 301 ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__)
302 302
303/*
304 * Function entry tracing
305 *
306 * The name of the function is emitted as a local variable that is
307 * intended to be used by both the entry trace and the exit trace.
308 */
309
310/* Helper macro */
311
312#define ACPI_TRACE_ENTRY(name, function, cast, param) \
313 ACPI_FUNCTION_NAME (name) \
314 function (ACPI_DEBUG_PARAMETERS, cast (param))
315
316/* The actual entry trace macros */
317
318#define ACPI_FUNCTION_TRACE(name) \
319 ACPI_FUNCTION_NAME(name) \
320 acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
321
322#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
323 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
324
325#define ACPI_FUNCTION_TRACE_U32(name, value) \
326 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
327
328#define ACPI_FUNCTION_TRACE_STR(name, string) \
329 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
330
331#define ACPI_FUNCTION_ENTRY() \
332 acpi_ut_track_stack_ptr()
333
334/*
335 * Function exit tracing
336 *
337 * These macros include a return statement. This is usually considered
338 * bad form, but having a separate exit macro before the actual return
339 * is very ugly and difficult to maintain.
340 *
341 * One of the FUNCTION_TRACE macros above must be used in conjunction
342 * with these macros so that "_AcpiFunctionName" is defined.
343 *
344 * Note: the DO_WHILE0 macro is used to prevent some compilers from
345 * complaining about these constructs. On other compilers the do...while
346 * adds some extra code, so this feature is optional.
347 */
348#ifdef ACPI_USE_DO_WHILE_0
349#define ACPI_DO_WHILE0(a) do a while(0)
303#else 350#else
351#define ACPI_DO_WHILE0(a) a
352#endif
353
354/* Exit trace helper macro */
355
356#define ACPI_TRACE_EXIT(function, cast, param) \
357 ACPI_DO_WHILE0 ({ \
358 function (ACPI_DEBUG_PARAMETERS, cast (param)); \
359 return ((param)); \
360 })
361
362/* The actual exit macros */
363
364#define return_VOID \
365 ACPI_DO_WHILE0 ({ \
366 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
367 return; \
368 })
369
370#define return_ACPI_STATUS(status) \
371 ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
372
373#define return_PTR(pointer) \
374 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
375
376#define return_VALUE(value) \
377 ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
378
379/* Conditional execution */
380
381#define ACPI_DEBUG_EXEC(a) a
382#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
383#define _VERBOSE_STRUCTURES
384
385/* Various object display routines for debug */
386
387#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
388#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
389#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
390#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
391#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
392
393#else /* ACPI_DEBUG_OUTPUT */
304/* 394/*
305 * This is the non-debug case -- make everything go away, 395 * This is the non-debug case -- make everything go away,
306 * leaving no executable debug code! 396 * leaving no executable debug code!
@@ -308,6 +398,31 @@
308#define ACPI_FUNCTION_NAME(a) 398#define ACPI_FUNCTION_NAME(a)
309#define ACPI_DEBUG_PRINT(pl) 399#define ACPI_DEBUG_PRINT(pl)
310#define ACPI_DEBUG_PRINT_RAW(pl) 400#define ACPI_DEBUG_PRINT_RAW(pl)
401#define ACPI_DEBUG_EXEC(a)
402#define ACPI_DEBUG_ONLY_MEMBERS(a)
403#define ACPI_FUNCTION_TRACE(a)
404#define ACPI_FUNCTION_TRACE_PTR(a, b)
405#define ACPI_FUNCTION_TRACE_U32(a, b)
406#define ACPI_FUNCTION_TRACE_STR(a, b)
407#define ACPI_FUNCTION_EXIT
408#define ACPI_FUNCTION_STATUS_EXIT(s)
409#define ACPI_FUNCTION_VALUE_EXIT(s)
410#define ACPI_FUNCTION_ENTRY()
411#define ACPI_DUMP_STACK_ENTRY(a)
412#define ACPI_DUMP_OPERANDS(a, b, c)
413#define ACPI_DUMP_ENTRY(a, b)
414#define ACPI_DUMP_TABLES(a, b)
415#define ACPI_DUMP_PATHNAME(a, b, c, d)
416#define ACPI_DUMP_BUFFER(a, b)
417#define ACPI_DEBUG_PRINT(pl)
418#define ACPI_DEBUG_PRINT_RAW(pl)
419
420/* Return macros must have a return statement at the minimum */
421
422#define return_VOID return
423#define return_ACPI_STATUS(s) return(s)
424#define return_VALUE(s) return(s)
425#define return_PTR(s) return(s)
311 426
312#endif /* ACPI_DEBUG_OUTPUT */ 427#endif /* ACPI_DEBUG_OUTPUT */
313 428