diff options
author | Andi Kleen <ak@suse.de> | 2004-11-01 23:07:18 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-01 23:07:18 -0800 |
commit | 99d4a6c9b95b3b83f275d64a2e59643a55b68ce0 (patch) | |
tree | 0f91548099c46df5484fb3905f2278c945e28b4f /kernel | |
parent | 99770da703ef1cbe32376aaa1b945af80acd3c82 (diff) | |
download | history-99d4a6c9b95b3b83f275d64a2e59643a55b68ce0.tar.gz |
[PATCH] Add panic blinking to 2.6
This patch readds the panic blinking that was in 2.4 to 2.6. This is
useful to see when you're in X that the machine has paniced
It addresses previously criticism.
It should work now when the keyboard interrupt is off.
It doesn't fully emulate the handler, but has a timeout
for this case.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/panic.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index c7ab9981c7aa76..97918d4ff44fe6 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -36,6 +36,15 @@ static int __init panic_setup(char *str) } __setup("panic=", panic_setup); +static long no_blink(long time) +{ + return 0; +} + +/* Returns how long it waited in ms */ +long (*panic_blink)(long time) = no_blink; +EXPORT_SYMBOL(panic_blink); + /** * panic - halt the system * @fmt: The text string to print @@ -48,6 +57,7 @@ __setup("panic=", panic_setup); NORET_TYPE void panic(const char * fmt, ...) { + long i; static char buf[1024]; va_list args; #if defined(CONFIG_ARCH_S390) @@ -69,15 +79,16 @@ NORET_TYPE void panic(const char * fmt, ...) if (panic_timeout > 0) { - int i; /* * Delay timeout seconds before rebooting the machine. * We can't use the "normal" timers since we just panicked.. */ printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout); - for (i = 0; i < panic_timeout; i++) { + for (i = 0; i < panic_timeout*1000; ) { touch_nmi_watchdog(); - mdelay(1000); + i += panic_blink(i); + mdelay(1); + i++; } /* * Should we run the reboot notifier. For the moment Im @@ -98,8 +109,11 @@ NORET_TYPE void panic(const char * fmt, ...) disabled_wait(caller); #endif local_irq_enable(); - for (;;) - ; + for (i = 0;;) { + i += panic_blink(i); + mdelay(1); + i++; + } } EXPORT_SYMBOL(panic); |