1 /*
2 * linux/kernel/panic.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7 /*
8 * This function is used through-out the kernel (includeinh mm and fs)
9 * to indicate a major problem.
10 */
11 #include <linux/kernel.h>
12 #include <linux/sched.h>
13
14 void sys_sync(void); /* it's really int */
15
16 volatile void panic(const char * s)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
17 {
18 printk("Kernel panic: %s\n\r",s);
19 if (current == task[0])
20 printk("In swapper task - not syncing\n\r");
21 else
22 sys_sync();
23 for(;;);
24 }