Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 916 → Rev 917

/shark/trunk/kernel/panic.c
36,11 → 36,11
*/
 
/*
* CVS : $Id: panic.c,v 1.1.1.1 2002-03-29 14:12:52 pj Exp $
* CVS : $Id: panic.c,v 1.2 2005-01-08 14:46:42 pj Exp $
*
* File: $File$
* Revision: $Revision: 1.1.1.1 $
* Last update: $Date: 2002-03-29 14:12:52 $
* Revision: $Revision: 1.2 $
* Last update: $Date: 2005-01-08 14:46:42 $
*/
 
#include <ll/i386/cons.h>
47,8 → 47,12
#include <ll/stdarg.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <stdlib.h>
#include <kernel/func.h>
 
// defined in kern.c
extern int runlevel;
 
static char buf[1024]; /* DANGER !!!!! */
 
static void sys_panic_stub(void *arg)
55,6 → 59,7
{
cprintf("KERNEL PANIC (sys_panic_stub): %s\n",buf);
}
 
void sys_panic(const char * fmt, ...)
{
va_list ap;
64,7 → 69,16
va_end(ap);
sys_atrunlevel(sys_panic_stub, NULL, RUNLEVEL_AFTER_EXIT);
cprintf("KERNEL PANIC (sys_panic): %s\n",buf);
sys_abort(333);
printk("KERNEL PANIC (sys_panic): %s\n",buf);
 
if (!ll_ActiveInt()) {
if (runlevel==RUNLEVEL_RUNNING)
exit(333);
if (runlevel==RUNLEVEL_SHUTDOWN)
sys_abort_shutdown(333);
}
else
kern_raise(XPANIC_INSIDE_IRQ, exec_shadow);
}