From: Ben Gras Date: Thu, 11 Dec 2008 14:23:58 +0000 (+0000) Subject: . print kernel stacktrace unconditionally on panic X-Git-Tag: v3.1.4~204 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/verify-sign/verify.pl?a=commitdiff_plain;h=9d096e014bc12fa64a984f0a3d0111396ba3ab22;p=minix.git . print kernel stacktrace unconditionally on panic . provide a panic() in the kernel for if a library function wants to panic --- diff --git a/kernel/utility.c b/kernel/utility.c index b7377b1cc..9998067dd 100755 --- a/kernel/utility.c +++ b/kernel/utility.c @@ -14,6 +14,21 @@ #include #include +/*===========================================================================* + * 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); }