Copyright clean-up (part 1):
[AROS.git] / arch / all-android / kernel / kernel_panic.c
blobb2abe884f72076497808bca1db4a3dea052bbade
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/config.h>
7 #include <asm/cpu.h>
8 #include <exec/alerts.h>
10 #include <stdio.h>
12 #include "kernel_base.h"
13 #include "kernel_debug.h"
14 #include "kernel_android.h"
16 static char panicBuffer[1024];
18 void krnPanic(struct KernelBase *KernelBase, const char *fmt, ...)
20 const char *hdr = "Critical boot failure\n";
21 char *ptr = panicBuffer;
22 va_list ap;
24 /* Prepend the header */
25 while (*hdr)
26 *ptr++ = *hdr++;
28 /* vsprintf() here comes from librom.a */
29 va_start(ap, fmt);
30 vsprintf(ptr, fmt, ap);
31 va_end(ap);
33 if (alertPipe == -1)
35 /* Very early panic (failure to load host's libc). Just dump to debug output. */
36 bug(panicBuffer);
37 return;
41 * Alert code is used by display server to specify buttons set in the dialog.
42 * We signal it's a deadend.
44 SendAlert(AT_DeadEnd, panicBuffer);
46 /* We simply return here, allowing the process to exit. */