#include <linux/syscalls.h>
#include <linux/interrupt.h>
#include <linux/nmi.h>
+#ifdef CONFIG_KEXEC
+#include <linux/kexec.h>
+#endif
int panic_timeout;
int panic_on_oops;
int tainted;
+void (*dump_function_ptr)(const char *, const struct pt_regs *) = 0;
EXPORT_SYMBOL(panic_timeout);
+EXPORT_SYMBOL(dump_function_ptr);
struct notifier_block *panic_notifier_list;
}
__setup("panic=", panic_setup);
+int netdump_mode = 0;
+EXPORT_SYMBOL_GPL(netdump_mode);
+
/**
* panic - halt the system
* @fmt: The text string to print
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
+
printk(KERN_EMERG "Kernel panic: %s\n",buf);
+ if (netdump_func)
+ BUG();
if (in_interrupt())
printk(KERN_EMERG "In interrupt handler - not syncing\n");
else if (!current->pid)
sys_sync();
bust_spinlocks(0);
+ notifier_call_chain(&panic_notifier_list, 0, buf);
+
#ifdef CONFIG_SMP
smp_send_stop();
#endif
- notifier_call_chain(&panic_notifier_list, 0, buf);
-
- if (panic_timeout > 0)
- {
+ 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);
+#ifdef CONFIG_KEXEC
+{
+ struct kimage *image;
+ image = xchg(&kexec_image, 0);
+ if (image) {
+ printk(KERN_EMERG "by starting a new kernel ..\n");
+ mdelay(panic_timeout*1000);
+ machine_kexec(image);
+ }
+ }
+#endif
for (i = 0; i < panic_timeout; i++) {
touch_nmi_watchdog();
mdelay(1000);