1#ifndef __NVKM_PRINTK_H__
2#define __NVKM_PRINTK_H__
3#include <core/os.h>
4#include <core/debug.h>
5struct nvkm_object;
6
7void __printf(3, 4)
8nv_printk_(struct nvkm_object *, int, const char *, ...);
9
10#define nv_printk(o,l,f,a...) do {                                             \
11	if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG)                                \
12		nv_printk_(nv_object(o), NV_DBG_##l, f, ##a);                  \
13} while(0)
14
15#define nv_fatal(o,f,a...) nv_printk((o), FATAL, f, ##a)
16#define nv_error(o,f,a...) nv_printk((o), ERROR, f, ##a)
17#define nv_warn(o,f,a...) nv_printk((o), WARN, f, ##a)
18#define nv_info(o,f,a...) nv_printk((o), INFO, f, ##a)
19#define nv_debug(o,f,a...) nv_printk((o), DEBUG, f, ##a)
20#define nv_trace(o,f,a...) nv_printk((o), TRACE, f, ##a)
21#define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a)
22#define nv_ioctl(o,f,a...) nv_trace(nvkm_client(o), "ioctl: "f, ##a)
23
24#define nv_assert(f,a...) do {                                                 \
25	if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG)                              \
26		nv_printk_(NULL, NV_DBG_FATAL, f "\n", ##a);                   \
27	BUG_ON(1);                                                             \
28} while(0)
29#endif
30