20 #ifndef _XENO_NUCLEUS_ASSERT_H
21 #define _XENO_NUCLEUS_ASSERT_H
23 #include <nucleus/types.h>
25 #define XENO_DEBUG(subsystem) \
26 (CONFIG_XENO_OPT_DEBUG_##subsystem > 0)
28 #define XENO_ASSERT(subsystem,cond,action) do { \
29 if (unlikely(XENO_DEBUG(subsystem) && !(cond))) { \
30 xnarch_trace_panic_freeze(); \
31 xnlogerr("assertion failed at %s:%d (%s)\n", \
32 __FILE__, __LINE__, (#cond)); \
33 xnarch_trace_panic_dump(); \
38 #define XENO_BUGON(subsystem,cond) \
40 if (unlikely(XENO_DEBUG(subsystem) && (cond))) \
41 xnpod_fatal("bug at %s:%d (%s)", \
42 __FILE__, __LINE__, (#cond)); \
45 #ifndef CONFIG_XENO_OPT_DEBUG_QUEUES
46 #define CONFIG_XENO_OPT_DEBUG_QUEUES 0
48 #ifndef CONFIG_XENO_OPT_DEBUG_NUCLEUS
49 #define CONFIG_XENO_OPT_DEBUG_NUCLEUS 0