aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acoutput.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-19 04:47:30 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-19 04:47:30 -0400
commit0d4a42f6bd298e826620585e766a154ab460617a (patch)
tree406d8f7778691d858dbe3e48e4bbb10e99c0a58a /include/acpi/acoutput.h
parentd62b4892f3d9f7dd2002e5309be10719d6805b0f (diff)
parenta937536b868b8369b98967929045f1df54234323 (diff)
Merge tag 'v3.9-rc3' into drm-intel-next-queued
Backmerge so that I can merge Imre Deak's coalesced sg entries fixes, which depend upon the new for_each_sg_page introduce in commit a321e91b6d73ed011ffceed384c40d2785cf723b Author: Imre Deak <imre.deak@intel.com> Date: Wed Feb 27 17:02:56 2013 -0800 lib/scatterlist: add simple page iterator The merge itself is just two trivial conflicts: Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/acpi/acoutput.h')
-rw-r--r--include/acpi/acoutput.h159
1 files changed, 154 insertions, 5 deletions
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 2457ac849655..9885276178e0 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2012, Intel Corp. 8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@
72#define ACPI_EXAMPLE 0x00004000 72#define ACPI_EXAMPLE 0x00004000
73#define ACPI_DRIVER 0x00008000 73#define ACPI_DRIVER 0x00008000
74#define DT_COMPILER 0x00010000 74#define DT_COMPILER 0x00010000
75#define ASL_PREPROCESSOR 0x00020000
75 76
76#define ACPI_ALL_COMPONENTS 0x0001FFFF 77#define ACPI_ALL_COMPONENTS 0x0001FFFF
77#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) 78#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
@@ -262,18 +263,140 @@
262 * Common parameters used for debug output functions: 263 * Common parameters used for debug output functions:
263 * line number, function name, module(file) name, component ID 264 * line number, function name, module(file) name, component ID
264 */ 265 */
265#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT 266#define ACPI_DEBUG_PARAMETERS \
267 __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
268
269/* Check if debug output is currently dynamically enabled */
270
271#define ACPI_IS_DEBUG_ENABLED(level, component) \
272 ((level & acpi_dbg_level) && (component & acpi_dbg_layer))
266 273
267/* 274/*
268 * Master debug print macros 275 * Master debug print macros
269 * Print message if and only if: 276 * Print message if and only if:
270 * 1) Debug print for the current component is enabled 277 * 1) Debug print for the current component is enabled
271 * 2) Debug error level or trace level for the print statement is enabled 278 * 2) Debug error level or trace level for the print statement is enabled
279 *
280 * November 2012: Moved the runtime check for whether to actually emit the
281 * debug message outside of the print function itself. This improves overall
282 * performance at a relatively small code cost. Implementation involves the
283 * use of variadic macros supported by C99.
284 *
285 * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from
286 * complaining about these constructs. On other compilers the do...while
287 * adds some extra code, so this feature is optional.
272 */ 288 */
273#define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist 289#ifdef ACPI_USE_DO_WHILE_0
274#define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist 290#define ACPI_DO_WHILE0(a) do a while(0)
275
276#else 291#else
292#define ACPI_DO_WHILE0(a) a
293#endif
294
295/* DEBUG_PRINT functions */
296
297#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
298#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
299
300/* Helper macros for DEBUG_PRINT */
301
302#define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \
303 ACPI_DO_WHILE0 ({ \
304 if (ACPI_IS_DEBUG_ENABLED (level, component)) \
305 { \
306 function (level, line, filename, modulename, component, __VA_ARGS__); \
307 } \
308 })
309
310#define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \
311 ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
312 filename, modulename, component, __VA_ARGS__)
313
314#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
315 ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \
316 filename, modulename, component, __VA_ARGS__)
317
318/*
319 * Function entry tracing
320 *
321 * The name of the function is emitted as a local variable that is
322 * intended to be used by both the entry trace and the exit trace.
323 */
324
325/* Helper macro */
326
327#define ACPI_TRACE_ENTRY(name, function, cast, param) \
328 ACPI_FUNCTION_NAME (name) \
329 function (ACPI_DEBUG_PARAMETERS, cast (param))
330
331/* The actual entry trace macros */
332
333#define ACPI_FUNCTION_TRACE(name) \
334 ACPI_FUNCTION_NAME(name) \
335 acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
336
337#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
338 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
339
340#define ACPI_FUNCTION_TRACE_U32(name, value) \
341 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
342
343#define ACPI_FUNCTION_TRACE_STR(name, string) \
344 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
345
346#define ACPI_FUNCTION_ENTRY() \
347 acpi_ut_track_stack_ptr()
348
349/*
350 * Function exit tracing
351 *
352 * These macros include a return statement. This is usually considered
353 * bad form, but having a separate exit macro before the actual return
354 * is very ugly and difficult to maintain.
355 *
356 * One of the FUNCTION_TRACE macros above must be used in conjunction
357 * with these macros so that "_AcpiFunctionName" is defined.
358 */
359
360/* Exit trace helper macro */
361
362#define ACPI_TRACE_EXIT(function, cast, param) \
363 ACPI_DO_WHILE0 ({ \
364 function (ACPI_DEBUG_PARAMETERS, cast (param)); \
365 return ((param)); \
366 })
367
368/* The actual exit macros */
369
370#define return_VOID \
371 ACPI_DO_WHILE0 ({ \
372 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
373 return; \
374 })
375
376#define return_ACPI_STATUS(status) \
377 ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
378
379#define return_PTR(pointer) \
380 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
381
382#define return_VALUE(value) \
383 ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
384
385/* Conditional execution */
386
387#define ACPI_DEBUG_EXEC(a) a
388#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
389#define _VERBOSE_STRUCTURES
390
391/* Various object display routines for debug */
392
393#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
394#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
395#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
396#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
397#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
398
399#else /* ACPI_DEBUG_OUTPUT */
277/* 400/*
278 * This is the non-debug case -- make everything go away, 401 * This is the non-debug case -- make everything go away,
279 * leaving no executable debug code! 402 * leaving no executable debug code!
@@ -281,6 +404,32 @@
281#define ACPI_FUNCTION_NAME(a) 404#define ACPI_FUNCTION_NAME(a)
282#define ACPI_DEBUG_PRINT(pl) 405#define ACPI_DEBUG_PRINT(pl)
283#define ACPI_DEBUG_PRINT_RAW(pl) 406#define ACPI_DEBUG_PRINT_RAW(pl)
407#define ACPI_DEBUG_EXEC(a)
408#define ACPI_DEBUG_ONLY_MEMBERS(a)
409#define ACPI_FUNCTION_TRACE(a)
410#define ACPI_FUNCTION_TRACE_PTR(a, b)
411#define ACPI_FUNCTION_TRACE_U32(a, b)
412#define ACPI_FUNCTION_TRACE_STR(a, b)
413#define ACPI_FUNCTION_EXIT
414#define ACPI_FUNCTION_STATUS_EXIT(s)
415#define ACPI_FUNCTION_VALUE_EXIT(s)
416#define ACPI_FUNCTION_ENTRY()
417#define ACPI_DUMP_STACK_ENTRY(a)
418#define ACPI_DUMP_OPERANDS(a, b, c)
419#define ACPI_DUMP_ENTRY(a, b)
420#define ACPI_DUMP_TABLES(a, b)
421#define ACPI_DUMP_PATHNAME(a, b, c, d)
422#define ACPI_DUMP_BUFFER(a, b)
423#define ACPI_DEBUG_PRINT(pl)
424#define ACPI_DEBUG_PRINT_RAW(pl)
425#define ACPI_IS_DEBUG_ENABLED(level, component) 0
426
427/* Return macros must have a return statement at the minimum */
428
429#define return_VOID return
430#define return_ACPI_STATUS(s) return(s)
431#define return_VALUE(s) return(s)
432#define return_PTR(s) return(s)
284 433
285#endif /* ACPI_DEBUG_OUTPUT */ 434#endif /* ACPI_DEBUG_OUTPUT */
286 435