kernel.h panic cleanup
PATCH 2/7 kernel.h panic cleanup
Cleanup kernel.h panic related stuff, move to linux/panic.h
Due to lots of files need it, include them in kernel.h just for convinience It can be thought as the first step of further cleanup.
Signed-off-by Dave Young <[email protected]>
--- include/linux/kernel.h | 29 +---------------------------- include/linux/panic.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 28 deletions(-)
include/linux/kernel.h +1 -28
@@ -14,6 +14,7 @@#include <linux/log2.h> #include <linux/typecheck.h> #include <linux/printk.h> +#include <linux/panic.h> #include <asm/byteorder.h> #include <asm/bug.h>
@@ -131,13 +132,6 @@ static inline void might_fault(void) }#endif -extern struct atomic_notifier_head panic_notifier_list; -extern long (*panic_blink)(long time); -NORET_TYPE void panic(const char * fmt, ...) - __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; -extern void oops_enter (void ); -extern void oops_exit (void ); -extern int oops_may_print (void ); NORET_TYPE void do_exit(long error_code)ATTRIB_NORET ; NORET_TYPE void complete_and_exit(struct completion *, long)
@@ -186,15 +180,6 @@ extern struct pid *session_of_pgrp(strucunsigned long int_sqrt (unsigned long );extern void bust_spinlocks (int yes); -extern int oops_in_progress;/* If set, an oops, panic(), BUG() or die() is in progress */ -extern int panic_timeout; -extern int panic_on_oops; -extern int panic_on_unrecovered_nmi; -extern int panic_on_io_nmi; -extern const char *print_tainted (void ); -extern void add_taint (unsigned flag); -extern int test_taint (unsigned flag); -extern unsigned long get_taint (void );extern int root_mountflags;/* Values used for system_state */
@@ -207,18 +192,6 @@ extern enum system_states {SYSTEM_SUSPEND_DISK , } system_state; -#define TAINT_PROPRIETARY_MODULE 0 -#define TAINT_FORCED_MODULE 1 -#define TAINT_UNSAFE_SMP 2 -#define TAINT_FORCED_RMMOD 3 -#define TAINT_MACHINE_CHECK 4 -#define TAINT_BAD_PAGE 5 -#define TAINT_USER 6 -#define TAINT_DIE 7 -#define TAINT_OVERRIDDEN_ACPI_TABLE 8 -#define TAINT_WARN 9 -#define TAINT_CRAP 10 -extern void dump_stack (void )__cold ; enum {
include/linux/panic.h new file +34 -0
@@ -0,0 +1,34 @@ +#ifndef _PANIC_H +#define _PANIC_H + +#include <linux/linkage.h> +#define TAINT_PROPRIETARY_MODULE 0 +#define TAINT_FORCED_MODULE 1 +#define TAINT_UNSAFE_SMP 2 +#define TAINT_FORCED_RMMOD 3 +#define TAINT_MACHINE_CHECK 4 +#define TAINT_BAD_PAGE 5 +#define TAINT_USER 6 +#define TAINT_DIE 7 +#define TAINT_OVERRIDDEN_ACPI_TABLE 8 +#define TAINT_WARN 9 +#define TAINT_CRAP 10 + +extern struct atomic_notifier_head panic_notifier_list; +extern long (*panic_blink)(long time); +NORET_TYPE void panic(const char *fmt, ...) + __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; +extern void oops_enter (void ); +extern void oops_exit (void ); +extern int oops_may_print (void ); +/* If set, an oops, panic(), BUG() or die() is in progress */ +extern int oops_in_progress; +extern int panic_timeout; +extern int panic_on_oops; +extern int panic_on_unrecovered_nmi; +extern int panic_on_io_nmi; +extern const char *print_tainted (void ); +extern void add_taint (unsigned flag); +extern int test_taint (unsigned flag); +extern unsigned long get_taint (void ); +#endif
Alexey Dobriyan
NAKQuoted 4 lines · Dave Young
Cleanup
kernel.hpanic related stuff, move tolinux/panic.hDue to lots of files need it, include them in
kernel.hjust for convinience It can be thought as the first step of further cleanup.
NAK, tainted stuff belongs to separate place.
Quoted 6 lines
include/linux/kernel.h +0
-4-extern const char *print_tainted (void ); -extern void add_taint (unsigned flag); -extern int test_taint (unsigned flag); -extern unsigned long get_taint (void );
Quoted 7 lines · Alexey Dobriyan
Quoted 4 lines · Dave Young
Cleanup
kernel.hpanic related stuff, move tolinux/panic.hDue to lots of files need it, include them in
kernel.hjust for convinience It can be thought as the first step of further cleanup.NAK, tainted stuff belongs to separate place.
Then where should they go?
Quoted 8 lines
Quoted 7 lines
include/linux/kernel.h +0
-4-extern const char *print_tainted (void ); -extern void add_taint (unsigned flag); -extern int test_taint (unsigned flag); -extern unsigned long get_taint (void );
Signature · 2 lines
Regards dave