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 __printf(4, 5) 19 nv_printk_(struct nouveau_object *, const char *, int, const char *, ...); 20 21 #define nv_printk(o,l,f,a...) do { \ 22 if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \ 23 nv_printk_(nv_object(o), NV_PRINTK_##l, NV_DBG_##l, f, ##a); \ 24 } while(0) 25 26 #define nv_fatal(o,f,a...) nv_printk((o), FATAL, f, ##a) 27 #define nv_error(o,f,a...) nv_printk((o), ERROR, f, ##a) 28 #define nv_warn(o,f,a...) nv_printk((o), WARN, f, ##a) 29 #define nv_info(o,f,a...) nv_printk((o), INFO, f, ##a) 30 #define nv_debug(o,f,a...) nv_printk((o), DEBUG, f, ##a) 31 #define nv_trace(o,f,a...) nv_printk((o), TRACE, f, ##a) 32 #define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a) 33 34 #define nv_assert(f,a...) do { \ 35 if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG) \ 36 nv_printk_(NULL, NV_PRINTK_FATAL, NV_DBG_FATAL, f "\n", ##a); \ 37 BUG_ON(1); \ 38 } while(0) 39 40 #endif 41