. print kernel stacktrace unconditionally on panic
. provide a panic() in the kernel for if a library function wants to panic
This commit is contained in:
parent
b61687fb1b
commit
9d096e014b
1 changed files with 18 additions and 2 deletions
|
@ -14,6 +14,21 @@
|
|||
#include <minix/sysutil.h>
|
||||
#include <minix/sys_config.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* panic *
|
||||
*===========================================================================*/
|
||||
PUBLIC void panic(what, mess,nr)
|
||||
char *what;
|
||||
char *mess;
|
||||
int nr;
|
||||
{
|
||||
/* This function is for when a library call wants to panic.
|
||||
* The library call calls printf() and tries to exit a process,
|
||||
* which isn't applicable in the kernel.
|
||||
*/
|
||||
minix_panic(mess, nr);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* minix_panic *
|
||||
*===========================================================================*/
|
||||
|
@ -29,9 +44,10 @@ int nr;
|
|||
if(nr != NO_NUM)
|
||||
kprintf(" %d", nr);
|
||||
kprintf("\n");
|
||||
}
|
||||
|
||||
kprintf("kernel stacktrace: ");
|
||||
util_stacktrace();
|
||||
}
|
||||
|
||||
/* Abort MINIX. */
|
||||
minix_shutdown(NULL);
|
||||
|
|
Loading…
Reference in a new issue