diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 30 |
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 | ||
186 | extern struct atomic_notifier_head panic_notifier_list; | 186 | extern struct atomic_notifier_head panic_notifier_list; |
187 | extern long (*panic_blink)(int state); | 187 | extern long (*panic_blink)(int state); |
188 | NORET_TYPE void panic(const char * fmt, ...) | 188 | __printf(1, 2) |
189 | __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; | 189 | void panic(const char *fmt, ...) |
190 | __noreturn __cold; | ||
190 | extern void oops_enter(void); | 191 | extern void oops_enter(void); |
191 | extern void oops_exit(void); | 192 | extern void oops_exit(void); |
192 | void print_oops_end_marker(void); | 193 | void print_oops_end_marker(void); |
193 | extern int oops_may_print(void); | 194 | extern int oops_may_print(void); |
194 | NORET_TYPE void do_exit(long error_code) | 195 | void do_exit(long error_code) |
195 | ATTRIB_NORET; | 196 | __noreturn; |
196 | NORET_TYPE void complete_and_exit(struct completion *, long) | 197 | void complete_and_exit(struct completion *, long) |
197 | ATTRIB_NORET; | 198 | __noreturn; |
198 | 199 | ||
199 | /* Internal, do not use. */ | 200 | /* Internal, do not use. */ |
200 | int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); | 201 | int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); |
@@ -341,6 +342,7 @@ extern int panic_timeout; | |||
341 | extern int panic_on_oops; | 342 | extern int panic_on_oops; |
342 | extern int panic_on_unrecovered_nmi; | 343 | extern int panic_on_unrecovered_nmi; |
343 | extern int panic_on_io_nmi; | 344 | extern int panic_on_io_nmi; |
345 | extern int sysctl_panic_on_stackoverflow; | ||
344 | extern const char *print_tainted(void); | 346 | extern const char *print_tainted(void); |
345 | extern void add_taint(unsigned flag); | 347 | extern void add_taint(unsigned flag); |
346 | extern int test_taint(unsigned flag); | 348 | extern 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 */ |