delint
[AROS.git] / rom / kernel / kernel_debug.h
blob26dfa103e46fed38b6a925b99ab0bc076328d6cc
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 */
8 /*
9 * This file contains useful redefinition of bug() macro which uses
10 * kernel.resource's own debugging facilities. Include it if you
11 * need bug() in your code.
14 #ifndef __KERNEL_DEBUG_H_
15 #define __KERNEL_DEBUG_H_
17 #include <aros/asmcall.h>
18 #include <aros/libcall.h>
19 #include <stdarg.h>
21 #ifdef bug
22 #undef bug
23 #endif
25 int krnPutC(int chr, struct KernelBase *KernelBase);
26 int krnBug(const char *format, va_list args, APTR kernelBase);
27 void krnDisplayAlert(const char *text, struct KernelBase *KernelBase);
28 void krnPanic(struct KernelBase *KernelBase, const char *fmt, ...);
30 static inline void _bug(APTR kernelBase, const char *format, ...)
32 va_list args;
34 va_start(args, format);
36 /*
37 * We use internal entry here. This is done because this function can be used
38 * during early boot, while KernelBase is NULL. However it's still passed,
39 * just in case.
41 krnBug(format, args, kernelBase);
43 va_end(args);
46 #define bug(...) _bug(KernelBase, __VA_ARGS__)
47 #define nbug(...) _bug(NULL, __VA_ARGS__)
48 #endif