. 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:
Ben Gras 2008-12-11 14:23:58 +00:00
parent b61687fb1b
commit 9d096e014b

View file

@ -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,10 +44,11 @@ int nr;
if(nr != NO_NUM)
kprintf(" %d", nr);
kprintf("\n");
kprintf("kernel stacktrace: ");
util_stacktrace();
}
kprintf("kernel stacktrace: ");
util_stacktrace();
/* Abort MINIX. */
minix_shutdown(NULL);
}