4 /* This header file defines all debugging constants and macros, and declares
5 * some variables. Certain debugging features redefine standard constants
6 * and macros. Therefore, this header file should be included after the
7 * other kernel headers.
11 #include <minix/debug.h>
14 /* Enable prints such as
15 * . send/receive failed due to deadlock or dead source or dead destination
17 * . bogus message pointer
18 * . kernel call number not allowed by this process
20 * Of course the call still fails, but nothing is printed if these warnings
23 #define DEBUG_ENABLE_IPC_WARNINGS 1
24 #define DEBUG_STACKTRACE 1
25 #define DEBUG_TIME_LOCKS 1
27 /* Runtime sanity checking. */
28 #define DEBUG_VMASSERT 0
29 #define DEBUG_SCHED_CHECK 0
30 #define DEBUG_STACK_CHECK 0
35 #define VF_SCHEDULING (1L << 1)
36 #define VF_PICKPROC (1L << 2)
38 #define TRACE(code, statement) if(verboseflags & code) { printf("%s:%d: ", __FILE__, __LINE__); statement }
41 #define TRACE(code, statement)
44 #define ENTERED 0xBA5E1514
45 #define NOTENTERED 0x1415BEE1
47 #define NOREC_ENTER(varname) \
48 static int varname = NOTENTERED; \
50 if(!intr_disabled()) { lock; mustunlock = 1; } \
51 vmassert(varname == ENTERED || varname == NOTENTERED); \
52 vmassert(magictest == MAGICTEST); \
53 vmassert(varname != ENTERED); \
56 #define NOREC_RETURN(varname, v) do { \
57 vmassert(intr_disabled()); \
58 vmassert(magictest == MAGICTEST); \
59 vmassert(varname == ENTERED || varname == NOTENTERED); \
60 varname = NOTENTERED; \
61 if(mustunlock) { unlock; } \
66 #define vmassert(t) { \
67 if(!(t)) { minix_panic("vm: assert " #t " failed in " __FILE__, __LINE__); } }
69 #define vmassert(t) { }
72 #define NOT_REACHABLE do { \
73 kprintf("NOT_REACHABLE at %s:%d\n", __FILE__, __LINE__); \
74 minix_panic("execution at an unexpected location\n", NO_NUM); \
78 #define NOT_IMPLEMENTED do { \
79 kprintf("NOT_IMPLEMENTED at %s:%d\n", __FILE__, __LINE__); \
80 minix_panic("NOT_IMPLEMENTED", NO_NUM); \
83 #ifdef CONFIG_BOOT_VERBOSE
84 #define BOOT_VERBOSE(x) x
86 #define BOOT_VERBOSE(x)