This source file includes following definitions.
- panic_setup
- panic
- bad_user_access_length
1
2
3
4
5
6
7
8
9
10
11 #include <stdarg.h>
12
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/delay.h>
16
17 asmlinkage void sys_sync(void);
18 extern void hard_reset_now(void);
19 extern void do_unblank_screen(void);
20 extern int C_A_D;
21
22 int panic_timeout = 0;
23
24 void panic_setup(char *str, int *ints)
25 {
26 if (ints[0] == 1)
27 panic_timeout = ints[1];
28 }
29
30 NORET_TYPE void panic(const char * fmt, ...)
31 {
32 static char buf[1024];
33 va_list args;
34 int i;
35
36 va_start(args, fmt);
37 vsprintf(buf, fmt, args);
38 va_end(args);
39 printk(KERN_EMERG "Kernel panic: %s\n",buf);
40 if (current == task[0])
41 printk(KERN_EMERG "In swapper task - not syncing\n");
42 else
43 sys_sync();
44
45 do_unblank_screen();
46
47 if (panic_timeout > 0)
48 {
49
50
51
52
53 printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout);
54 for(i = 0; i < (panic_timeout*1000); i++)
55 udelay(1000);
56 hard_reset_now();
57 }
58 for(;;);
59 }
60
61
62
63
64
65 int bad_user_access_length(void)
66 {
67 panic("bad_user_access_length executed (not cool, dude)");
68 }