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