This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / panic.c
index 3fea0f2..fda5691 100644 (file)
 #include <linux/notifier.h>
 #include <linux/init.h>
 #include <linux/sysrq.h>
+#include <linux/syscalls.h>
 #include <linux/interrupt.h>
 #include <linux/nmi.h>
+#ifdef CONFIG_KEXEC
 #include <linux/kexec.h>
-#include <linux/crash_dump.h>
+#endif
 
 int panic_timeout = 900;
 int panic_on_oops = 1;
 int tainted;
-unsigned int crashed;
-int crash_dump_on;
 void (*dump_function_ptr)(const char *, const struct pt_regs *) = 0;
 
 EXPORT_SYMBOL(panic_timeout);
@@ -48,7 +48,7 @@ static long no_blink(long time)
 }
 
 /* Returns how long it waited in ms */
-long (*panic_blink)(long time);
+long (*panic_blink)(long time) = no_blink;
 EXPORT_SYMBOL(panic_blink);
 
 /**
@@ -74,14 +74,21 @@ NORET_TYPE void panic(const char * fmt, ...)
        va_start(args, fmt);
        vsnprintf(buf, sizeof(buf), fmt, args);
        va_end(args);
-       printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
-       if (crashdump_func())
+
+       printk(KERN_EMERG "Kernel panic: %s\n",buf);
+#warning MEF netdump_func not part of 2.6.9-1.11-FC2; taking out call for now
+#if 0
+       if (netdump_func)
                BUG();
+#endif
+       if (in_interrupt())
+               printk(KERN_EMERG "In interrupt handler - not syncing\n");
+       else if (!current->pid)
+               printk(KERN_EMERG "In idle task - not syncing\n");
+       else
+               sys_sync();
        bust_spinlocks(0);
 
-       /* If we have crashed, perform a kexec reboot, for dump write-out */
-       crash_machine_kexec();
-
         notifier_call_chain(&panic_notifier_list, 0, buf);
        
 #ifdef CONFIG_SMP
@@ -90,9 +97,6 @@ NORET_TYPE void panic(const char * fmt, ...)
 
        notifier_call_chain(&panic_notifier_list, 0, buf);
 
-       if (!panic_blink)
-               panic_blink = no_blink;
-
        if (panic_timeout > 0)
        {
                /*
@@ -136,10 +140,10 @@ NORET_TYPE void panic(const char * fmt, ...)
         disabled_wait(caller);
 #endif
        local_irq_enable();
-       for (i = 0;;) {
+       for (i = 0;;) { 
                i += panic_blink(i);
-               mdelay(1);
-               i++;
+               mdelay(1); 
+               i++; 
        }
 }