Changes in kernel/generic/include/debug.h [bcc20fa1:63e27ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/debug.h
rbcc20fa1 r63e27ef 36 36 #define KERN_DEBUG_H_ 37 37 38 #include <panic.h>39 38 #include <log.h> 40 39 #include <symtab_lookup.h> 41 40 42 41 #define CALLER ((uintptr_t) __builtin_return_address(0)) 43 44 #ifdef CONFIG_DEBUG45 46 /** Debugging ASSERT macro47 *48 * If CONFIG_DEBUG is set, the ASSERT() macro49 * evaluates expr and if it is false raises50 * kernel panic.51 *52 * @param expr Expression which is expected to be true.53 *54 */55 #define ASSERT(expr) \56 do { \57 if (!(expr)) \58 panic_assert("%s() at %s:%u:\n%s", \59 __func__, __FILE__, __LINE__, #expr); \60 } while (0)61 62 /** Debugging verbose ASSERT macro63 *64 * If CONFIG_DEBUG is set, the ASSERT() macro65 * evaluates expr and if it is false raises66 * kernel panic. The panic message contains also67 * the supplied message.68 *69 * @param expr Expression which is expected to be true.70 * @param msg Additional message to show (string).71 *72 */73 #define ASSERT_VERBOSE(expr, msg) \74 do { \75 if (!(expr)) \76 panic_assert("%s() at %s:%u:\n%s, %s", \77 __func__, __FILE__, __LINE__, #expr, msg); \78 } while (0)79 80 /** Static assert macro81 *82 */83 #define STATIC_ASSERT(expr) \84 _Static_assert(expr, "")85 86 #define STATIC_ASSERT_VERBOSE(expr, msg) \87 _Static_assert(expr, msg)88 89 90 #else /* CONFIG_DEBUG */91 92 #define ASSERT(expr)93 #define ASSERT_VERBOSE(expr, msg)94 #define STATIC_ASSERT(expr)95 #define STATIC_ASSERT_VERBOSE(expr, msg)96 97 #endif /* CONFIG_DEBUG */98 42 99 43 #ifdef CONFIG_LOG
Note:
See TracChangeset
for help on using the changeset viewer.