diff -urN 2.2.19pre3/include/linux/kernel.h hard_panic/include/linux/kernel.h --- 2.2.19pre3/include/linux/kernel.h Mon Dec 11 16:58:05 2000 +++ hard_panic/include/linux/kernel.h Fri Dec 22 20:43:43 2000 @@ -44,6 +44,8 @@ extern struct notifier_block *panic_notifier_list; NORET_TYPE void panic(const char * fmt, ...) __attribute__ ((NORET_AND format (printf, 1, 2))); +NORET_TYPE void hard_panic(const char * fmt, ...) + __attribute__ ((NORET_AND format (printf, 1, 2))); NORET_TYPE void do_exit(long error_code) ATTRIB_NORET; extern unsigned long simple_strtoul(const char *,char **,unsigned int); diff -urN 2.2.19pre3/kernel/ksyms.c hard_panic/kernel/ksyms.c --- 2.2.19pre3/kernel/ksyms.c Mon Dec 11 16:58:06 2000 +++ hard_panic/kernel/ksyms.c Fri Dec 22 20:43:43 2000 @@ -357,6 +357,7 @@ /* misc */ EXPORT_SYMBOL(panic); +EXPORT_SYMBOL(hard_panic); EXPORT_SYMBOL(printk); EXPORT_SYMBOL(sprintf); EXPORT_SYMBOL(vsprintf); diff -urN 2.2.19pre3/kernel/panic.c hard_panic/kernel/panic.c --- 2.2.19pre3/kernel/panic.c Thu May 4 13:00:40 2000 +++ hard_panic/kernel/panic.c Fri Dec 22 20:43:54 2000 @@ -88,3 +88,55 @@ CHECK_EMERGENCY_SYNC } } + +NORET_TYPE void hard_panic(const char * fmt, ...) +{ + static char buf[1024]; + va_list args; +#ifdef CONFIG_ARCH_S390 + unsigned long caller = (unsigned long) __builtin_return_address(0); +#endif + + va_start(args, fmt); + vsprintf(buf, fmt, args); + va_end(args); + printk(KERN_EMERG "Kernel panic: %s\n", buf); + + unblank_console(); + +#ifdef __SMP__ + smp_send_stop(); +#endif + + notifier_call_chain(&panic_notifier_list, 0, NULL); + + if (panic_timeout > 0) + { + /* + * 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); + mdelay(panic_timeout*1000); + /* + * Should we run the reboot notifier. For the moment Im + * choosing not too. It might crash, be corrupt or do + * more harm than good for other reasons. + */ + machine_restart(NULL); + } +#ifdef __sparc__ + { + extern int stop_a_enabled; + /* Make sure the user can actually press L1-A */ + stop_a_enabled = 1; + printk("Press L1-A to return to the boot prom\n"); + } +#endif +#ifdef CONFIG_ARCH_S390 + disabled_wait(caller); +#endif + sti(); + for(;;) { + } +}