CopyToAFS: Remove dead FMF_* flags
[AROS.git] / rom / kernel / kernel_debug.h
blobffbfc1cda4916f8834a5c057528982fd7efab417
1 /*
2 * This file contains useful redefinition of bug() macro which uses
3 * kernel.resource's own debugging facilities. Include it if you
4 * need bug() in your code.
5 */
7 #include <aros/asmcall.h>
8 #include <aros/libcall.h>
9 #include <stdarg.h>
11 #ifdef bug
12 #undef bug
13 #endif
15 int __KrnBugBoot(const char *format, va_list args);
17 AROS_LD2(int, KrnBug,
18 AROS_LDA(const char *, format, A0),
19 AROS_LDA(va_list, args, A1),
20 struct KernelBase *, KernelBase, 12, Kernel);
22 static inline void _bug(struct KernelBase *KernelBase, const char *format, ...)
24 va_list args;
26 va_start(args, format);
28 /* KernelBase can be NULL, use __KrnBugBoot if it is */
29 if (KernelBase != NULL) {
30 /* We use AROS_CALL2 here, since there are files that
31 * include this that cannot tolerate <proto/kernel.h>
33 AROS_CALL2(int, AROS_SLIB_ENTRY(KrnBug, Kernel),
34 AROS_LCA(const char *, format, A0),
35 AROS_LCA(va_list, args, A1),
36 struct KernelBase *, KernelBase);
37 } else
38 __KrnBugBoot(format, args);
40 va_end(args);
43 #define bug(...) _bug(KernelBase, __VA_ARGS__)
46 * Character output function. All debug output ends up there.
47 * This function needs to be implemented for every supported
48 * architecture.
50 int krnPutC(int chr, struct KernelBase *KernelBase);