Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
printk.h
Go to the documentation of this file.
1 #ifndef __NOUVEAU_PRINTK_H__
2 #define __NOUVEAU_PRINTK_H__
3 
4 #include <core/os.h>
5 #include <core/debug.h>
6 
7 struct nouveau_object;
8 
9 #define NV_PRINTK_FATAL KERN_CRIT
10 #define NV_PRINTK_ERROR KERN_ERR
11 #define NV_PRINTK_WARN KERN_WARNING
12 #define NV_PRINTK_INFO KERN_INFO
13 #define NV_PRINTK_DEBUG KERN_DEBUG
14 #define NV_PRINTK_PARANOIA KERN_DEBUG
15 #define NV_PRINTK_TRACE KERN_DEBUG
16 #define NV_PRINTK_SPAM KERN_DEBUG
17 
18 void nv_printk_(struct nouveau_object *, const char *, int, const char *, ...);
19 
20 #define nv_printk(o,l,f,a...) do { \
21  if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \
22  nv_printk_(nv_object(o), NV_PRINTK_##l, NV_DBG_##l, f, ##a); \
23 } while(0)
24 
25 #define nv_fatal(o,f,a...) nv_printk((o), FATAL, f, ##a)
26 #define nv_error(o,f,a...) nv_printk((o), ERROR, f, ##a)
27 #define nv_warn(o,f,a...) nv_printk((o), WARN, f, ##a)
28 #define nv_info(o,f,a...) nv_printk((o), INFO, f, ##a)
29 #define nv_debug(o,f,a...) nv_printk((o), DEBUG, f, ##a)
30 #define nv_trace(o,f,a...) nv_printk((o), TRACE, f, ##a)
31 #define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a)
32 
33 #define nv_assert(f,a...) do { \
34  if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG) \
35  nv_printk_(NULL, NV_PRINTK_FATAL, NV_DBG_FATAL, f "\n", ##a); \
36  BUG_ON(1); \
37 } while(0)
38 
39 #endif