XenevaOS
Loading...
Searching...
No Matches
Macros | Enumerations
bug.h File Reference
#include <asm/bug.h>
#include <linux/compiler.h>
#include <linux/build_bug.h>
Include dependency graph for bug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAYBE_BUILD_BUG_ON(cond)
 
#define WARN_ONCE(cond, fmt, ...)
 
#define CHECK_DATA_CORRUPTION(condition, addr, fmt, ...)
 

Enumerations

enum  bug_trap_type { BUG_TRAP_TYPE_NONE = 0 , BUG_TRAP_TYPE_WARN = 1 , BUG_TRAP_TYPE_BUG = 2 }
 

Macro Definition Documentation

◆ CHECK_DATA_CORRUPTION

#define CHECK_DATA_CORRUPTION (   condition,
  addr,
  fmt,
  ... 
)
Value:
check_data_corruption(({ \
bool corruption = unlikely(condition); \
if (corruption) { \
if (addr) \
mem_dump_obj(addr); \
if (IS_ENABLED(CONFIG_BUG_ON_DATA_CORRUPTION)) { \
pr_err(fmt, ##__VA_ARGS__); \
BUG(); \
} else \
WARN(1, fmt, ##__VA_ARGS__); \
} \
corruption; \
}))
#define unlikely(x)
Definition compiler.h:30
const char * fmt
Definition drm_file.h:466
#define IS_ENABLED(option)
Definition kconfig.h:80

◆ MAYBE_BUILD_BUG_ON

#define MAYBE_BUILD_BUG_ON (   cond)
Value:
do { \
if (__builtin_constant_p((cond))) \
BUILD_BUG_ON(cond); \
else \
BUG_ON(cond); \
} while (0)

◆ WARN_ONCE

#define WARN_ONCE (   cond,
  fmt,
  ... 
)
Value:
({ \
static int __warned_once; \
int __wret = !!(cond); \
if (__wret && !__warned_once) { \
__warned_once = 1; \
UARTDebugOut("[WARN] " fmt " (%s:%d)\r\n", \
##__VA_ARGS__, __FILE__, __LINE__); \
} \
__wret; \
})

Enumeration Type Documentation

◆ bug_trap_type

Enumerator
BUG_TRAP_TYPE_NONE 
BUG_TRAP_TYPE_WARN 
BUG_TRAP_TYPE_BUG