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.
7 #include <aros/asmcall.h>
8 #include <aros/libcall.h>
15 int __KrnBugBoot(const char *format
, va_list args
);
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
, ...)
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
);
38 __KrnBugBoot(format
, 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
50 int krnPutC(int chr
, struct KernelBase
*KernelBase
);