5 #include <linux/compiler.h>
6 #include <linux/build_bug.h>
9 BUG_TRAP_TYPE_NONE = 0,
10 BUG_TRAP_TYPE_WARN = 1,
11 BUG_TRAP_TYPE_BUG = 2,
17 #define MAYBE_BUILD_BUG_ON(cond) (0)
18 #else /* __CHECKER__ */
20 #define MAYBE_BUILD_BUG_ON(cond) \
22 if (__builtin_constant_p((cond))) \
28 #endif /* __CHECKER__ */
30 #ifdef CONFIG_GENERIC_BUG
31 #include <asm-generic/bug.h>
33 static inline int is_warning_bug(const struct bug_entry *bug)
35 return bug->flags & BUGFLAG_WARNING;
38 const struct bug_entry *find_bug(unsigned long bugaddr);
40 enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
42 /* These are defined by the architecture */
43 int is_valid_bugaddr(unsigned long addr);
45 #else /* !CONFIG_GENERIC_BUG */
47 static inline void *find_bug(unsigned long bugaddr)
52 static inline enum bug_trap_type report_bug(unsigned long bug_addr,
55 return BUG_TRAP_TYPE_BUG;
58 #endif /* CONFIG_GENERIC_BUG */
59 #endif /* _LINUX_BUG_H */