From: James S. <jsi...@us...> - 2002-01-24 18:49:00
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/i386/mm In directory usw-pr-cvs1:/tmp/cvs-serv15926/arch/i386/mm Modified Files: fault.c Log Message: Got ride of the do_BUG thing. Unfortunely the bust_spinlock code is not generic enough. Index: fault.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/mm/fault.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- fault.c 2002/01/20 03:54:45 1.7 +++ fault.c 2002/01/24 18:48:57 1.8 @@ -18,6 +18,7 @@ #include <linux/interrupt.h> #include <linux/init.h> #include <linux/tty.h> +#include <linux/vt_kern.h> /* For unblank_screen() */ #include <asm/system.h> #include <asm/uaccess.h> @@ -26,6 +27,8 @@ extern void die(const char *,struct pt_regs *,long); +extern int console_loglevel; + /* * Ugly, ugly, but the goto's result in better assembly.. */ @@ -89,6 +92,42 @@ goto survive; } goto bad_area; +} + +extern spinlock_t timerlist_lock; + +/* + * Unlock any spinlocks which will prevent us from getting the + * message out (timerlist_lock is acquired through the + * console unblank code) + */ +void bust_spinlocks(int yes) +{ + spin_lock_init(&timerlist_lock); + if (yes) { + oops_in_progress = 1; +#ifdef CONFIG_SMP + global_irq_lock = 0; /* Many serial drivers do __global_cli() */ +#endif + } else { + int loglevel_save = console_loglevel; + + oops_in_progress = 0; + /* + * OK, the message is on the console. Now we call printk() + * without oops_in_progress set so that printk will give klogd + * a poke. Hold onto your hats... + */ + console_loglevel = 15; /* NMI oopser may have shut the console up */ + printk(" "); + console_loglevel = loglevel_save; + } +} + +void do_BUG(const char *file, int line) +{ + bust_spinlocks(1); + printk("kernel BUG at %s:%d!\n", file, line); } asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); |