1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #ifndef _DEBUG_H
31 #define _DEBUG_H
32
33 #include <sys/cdefs.h>
34 #include <hal.h>
35
36 #ifdef CONFIG_TINY
37 #define LOGBUFSZ 512
38 #else
39 #define LOGBUFSZ 2048
40 #endif
41
42 #define DBGMSGSZ 128
43
44 #ifdef DEBUG
45 #define DPRINTF(a) printf a
46 #define ASSERT(exp) do { if (!(exp)) \
47 assert(__FILE__, __LINE__, #exp); } while (0)
48 #else
49 #define DPRINTF(a) ((void)0)
50 #define ASSERT(exp) ((void)0)
51 #define panic(x) machine_abort()
52 #endif
53
54 __BEGIN_DECLS
55 #ifdef DEBUG
56 void printf(const char *, ...);
57 void assert(const char *, int, const char *);
58 void panic(const char *);
59 int dbgctl(int, void *);
60 #endif
61 __END_DECLS
62
63 #endif
|