White space fixes, detab.
[AROS.git] / rom / kernel / kernel_panic.c
blob8a905069dd42feb9db3a1de79ac23d07965a975c
1 #include <aros/config.h>
2 #include <asm/cpu.h>
4 #include <stdio.h>
6 #include "kernel_base.h"
7 #include "kernel_debug.h"
9 /*
10 * This definition allows to move this buffer away from .bss.
11 * Can be used on native, by using, for example, zero page.
12 * This condition is considered fatal, there's no return.
14 #ifndef KERNEL_PANIC_BUFFER
15 static char panicBuffer[1024];
16 #define KERNEL_PANIC_BUFFER panicBuffer
17 #endif
19 void krnPanic(struct KernelBase *KernelBase,const char *fmt, ...)
21 const char *hdr = "Critical boot failure\n";
22 char *ptr = KERNEL_PANIC_BUFFER;
23 va_list ap;
25 /* Prepend the header */
26 while (*hdr)
27 *ptr++ = *hdr++;
29 /* vsprintf() here comes from librom.a */
30 va_start(ap, fmt);
31 vsprintf(ptr, fmt, ap);
32 va_end(ap);
34 krnDisplayAlert(KERNEL_PANIC_BUFFER, KernelBase);
36 #if AROS_FLAVOUR & AROS_FLAVOUR_STANDALONE
37 /* Hosted AROS may quit here */
38 for (;;) HALT;
39 #endif