kernel.resource: Pass in KernelBase to some krn* helper functions
[AROS.git] / arch / all-android / kernel / kernel_panic.c
blob24cbaa4c1c0f35c0f0b12ab95393298919044e92
1 #include <aros/config.h>
2 #include <asm/cpu.h>
3 #include <exec/alerts.h>
5 #include <stdio.h>
7 #include "kernel_base.h"
8 #include "kernel_debug.h"
9 #include "kernel_android.h"
11 static char panicBuffer[1024];
13 void krnPanic(struct KernelBase *KernelBase, const char *fmt, ...)
15 const char *hdr = "Critical boot failure\n";
16 char *ptr = panicBuffer;
17 va_list ap;
19 /* Prepend the header */
20 while (*hdr)
21 *ptr++ = *hdr++;
23 /* vsprintf() here comes from librom.a */
24 va_start(ap, fmt);
25 vsprintf(ptr, fmt, ap);
26 va_end(ap);
28 if (alertPipe == -1)
30 /* Very early panic (failure to load host's libc). Just dump to debug output. */
31 bug(panicBuffer);
32 return;
36 * Alert code is used by display server to specify buttons set in the dialog.
37 * We signal it's a deadend.
39 SendAlert(AT_DeadEnd, panicBuffer);
41 /* We simply return here, allowing the process to exit. */