xref: /haiku/headers/private/kernel/debug.h (revision 7120e97489acbf17d86d3f33e3b2e68974fd4b23)
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _KERNEL_DEBUG_H
6 #define _KERNEL_DEBUG_H
7 
8 #include <kernel.h>
9 #include <stage2.h>
10 #include <cdefs.h>
11 
12 extern int dbg_register_file[2][14]; /* XXXmpetit -- must be made generic */
13 
14 int  dbg_init(kernel_args *ka);
15 int  dbg_init2(kernel_args *ka);
16 char dbg_putch(char c);
17 void dbg_puts(const char *s);
18 bool dbg_set_serial_debug(bool new_val);
19 bool dbg_get_serial_debug(void);
20 
21 /* special return codes for kernel debugger command function*/
22 #define  B_KDEBUG_CONT   2
23 #define  B_KDEBUG_QUIT   3
24 
25 extern void dbg_save_registers(int *);	/* arch provided */
26 
27 #if DEBUG
28 #	define ASSERT(x) \
29 	if (x) {} else { panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); }
30 #else
31 #	define ASSERT(x)
32 #endif
33 
34 #endif	/* _KERNEL_DEBUG_H */
35