aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e8b1597b5cf2..e8343422240a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -185,16 +185,17 @@ static inline void might_fault(void)
185 185
186extern struct atomic_notifier_head panic_notifier_list; 186extern struct atomic_notifier_head panic_notifier_list;
187extern long (*panic_blink)(int state); 187extern long (*panic_blink)(int state);
188NORET_TYPE void panic(const char * fmt, ...) 188__printf(1, 2)
189 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; 189void panic(const char *fmt, ...)
190 __noreturn __cold;
190extern void oops_enter(void); 191extern void oops_enter(void);
191extern void oops_exit(void); 192extern void oops_exit(void);
192void print_oops_end_marker(void); 193void print_oops_end_marker(void);
193extern int oops_may_print(void); 194extern int oops_may_print(void);
194NORET_TYPE void do_exit(long error_code) 195void do_exit(long error_code)
195 ATTRIB_NORET; 196 __noreturn;
196NORET_TYPE void complete_and_exit(struct completion *, long) 197void complete_and_exit(struct completion *, long)
197 ATTRIB_NORET; 198 __noreturn;
198 199
199/* Internal, do not use. */ 200/* Internal, do not use. */
200int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); 201int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
@@ -341,6 +342,7 @@ extern int panic_timeout;
341extern int panic_on_oops; 342extern int panic_on_oops;
342extern int panic_on_unrecovered_nmi; 343extern int panic_on_unrecovered_nmi;
343extern int panic_on_io_nmi; 344extern int panic_on_io_nmi;
345extern int sysctl_panic_on_stackoverflow;
344extern const char *print_tainted(void); 346extern const char *print_tainted(void);
345extern void add_taint(unsigned flag); 347extern void add_taint(unsigned flag);
346extern int test_taint(unsigned flag); 348extern int test_taint(unsigned flag);
@@ -665,6 +667,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
665#define BUILD_BUG_ON_ZERO(e) (0) 667#define BUILD_BUG_ON_ZERO(e) (0)
666#define BUILD_BUG_ON_NULL(e) ((void*)0) 668#define BUILD_BUG_ON_NULL(e) ((void*)0)
667#define BUILD_BUG_ON(condition) 669#define BUILD_BUG_ON(condition)
670#define BUILD_BUG() (0)
668#else /* __CHECKER__ */ 671#else /* __CHECKER__ */
669 672
670/* Force a compilation error if a constant expression is not a power of 2 */ 673/* Force a compilation error if a constant expression is not a power of 2 */
@@ -703,6 +706,21 @@ extern int __build_bug_on_failed;
703 if (condition) __build_bug_on_failed = 1; \ 706 if (condition) __build_bug_on_failed = 1; \
704 } while(0) 707 } while(0)
705#endif 708#endif
709
710/**
711 * BUILD_BUG - break compile if used.
712 *
713 * If you have some code that you expect the compiler to eliminate at
714 * build time, you should use BUILD_BUG to detect if it is
715 * unexpectedly used.
716 */
717#define BUILD_BUG() \
718 do { \
719 extern void __build_bug_failed(void) \
720 __linktime_error("BUILD_BUG failed"); \
721 __build_bug_failed(); \
722 } while (0)
723
706#endif /* __CHECKER__ */ 724#endif /* __CHECKER__ */
707 725
708/* Trap pasters of __FUNCTION__ at compile-time */ 726/* Trap pasters of __FUNCTION__ at compile-time */