patch-1.3.63 linux/kernel/panic.c
Next file: linux/kernel/sched.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
Mon Feb 12 06:45:31 1996
- Orig file:
v1.3.62/linux/kernel/panic.c
- Orig date:
Tue Jun 20 09:10:32 1995
diff -u --recursive --new-file v1.3.62/linux/kernel/panic.c linux/kernel/panic.c
@@ -12,13 +12,24 @@
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/delay.h>
asmlinkage void sys_sync(void); /* it's really int */
+extern void hard_reset_now(void);
+
+static int timeout = -1;
+
+void panic_setup(char *str, int *ints)
+{
+ if (ints[0] == 1)
+ timeout = ints[1];
+}
NORET_TYPE void panic(const char * fmt, ...)
{
static char buf[1024];
va_list args;
+ int i;
va_start(args, fmt);
vsprintf(buf, fmt, args);
@@ -28,6 +39,17 @@
printk(KERN_EMERG "In swapper task - not syncing\n");
else
sys_sync();
+ if (timeout >= 0)
+ {
+ /*
+ * Delay timeout seconds before rebooting the machine.
+ * We can't use the "normal" timers since we just paniced..
+ */
+ printk(KERN_EMERG "Rebooting in %d seconds..",timeout);
+ for(i = 0; i < (timeout*1000); i++)
+ udelay(1000);
+ hard_reset_now();
+ }
for(;;);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this