source: trunk/minix/kernel/utility.c@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 776 bytes
RevLine 
[9]1/* This file contains a collection of miscellaneous procedures:
2 * panic: abort MINIX due to a fatal error
3 */
4
5#include "kernel.h"
6#include <unistd.h>
7
8/*===========================================================================*
9 * panic *
10 *===========================================================================*/
11PUBLIC void panic(mess,nr)
12_CONST char *mess;
13int nr;
14{
15/* The system has run aground of a fatal kernel error. Terminate execution. */
16 static int panicking = 0;
17 if (panicking ++) return; /* prevent recursive panics */
18
19 if (mess != NULL) {
20 kprintf("\nKernel panic: %s", mess);
21 if (nr != NO_NUM) kprintf(" %d", nr);
22 kprintf("\n",NO_NUM);
23 }
24
25 /* Abort MINIX. */
26 prepare_shutdown(RBT_PANIC);
27}
Note: See TracBrowser for help on using the repository browser.