root/kernel/panic.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. panic

   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 <stdarg.h>
  12 
  13 #include <linux/kernel.h>
  14 #include <linux/sched.h>
  15 
  16 asmlinkage void sys_sync(void); /* it's really int */
  17 
  18 extern int vsprintf(char * buf, const char * fmt, va_list args);
  19 
  20 volatile void panic(const char * fmt, ...)
     /* [previous][next][first][last][top][bottom][index][help] */
  21 {
  22         extern int log_to_console;
  23         static char buf[1024];
  24         va_list args;
  25 
  26         va_start(args, fmt);
  27         vsprintf(buf, fmt, args);
  28         va_end(args);
  29         log_to_console = 1;
  30         printk("Kernel panic: %s\n",buf);
  31         if (current == task[0])
  32                 printk("In swapper task - not syncing\n");
  33         else
  34                 sys_sync();
  35         for(;;);
  36 }

/* [previous][next][first][last][top][bottom][index][help] */