Line | |
---|
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 | *===========================================================================*/
|
---|
11 | PUBLIC void panic(mess,nr)
|
---|
12 | _CONST char *mess;
|
---|
13 | int 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.