]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo_bsp/ps7_cortexa9_0/include/xdebug.h
8ab5e212c629109f827084c8a7202a41af4cb453
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo_bsp / ps7_cortexa9_0 / include / xdebug.h
1 #ifndef XDEBUG
2 #define XDEBUG
3   
4 #undef DEBUG
5
6 #if defined(DEBUG) && !defined(NDEBUG)
7
8 #ifndef XDEBUG_WARNING
9 #define XDEBUG_WARNING
10 #warning DEBUG is enabled
11 #endif
12
13 int printf(const char *format, ...);
14
15 #define XDBG_DEBUG_ERROR             0x00000001    /* error  condition messages */
16 #define XDBG_DEBUG_GENERAL           0x00000002    /* general debug  messages */
17 #define XDBG_DEBUG_ALL               0xFFFFFFFF    /* all debugging data */
18
19 #define XDBG_DEBUG_FIFO_REG          0x00000100    /* display register reads/writes */
20 #define XDBG_DEBUG_FIFO_RX           0x00000101    /* receive debug messages */
21 #define XDBG_DEBUG_FIFO_TX           0x00000102    /* transmit debug messages */
22 #define XDBG_DEBUG_FIFO_ALL          0x0000010F    /* all fifo debug messages */
23
24 #define XDBG_DEBUG_TEMAC_REG         0x00000400    /* display register reads/writes */
25 #define XDBG_DEBUG_TEMAC_RX          0x00000401    /* receive debug messages */
26 #define XDBG_DEBUG_TEMAC_TX          0x00000402    /* transmit debug messages */
27 #define XDBG_DEBUG_TEMAC_ALL         0x0000040F    /* all temac  debug messages */
28
29 #define XDBG_DEBUG_TEMAC_ADPT_RX     0x00000800    /* receive debug messages */
30 #define XDBG_DEBUG_TEMAC_ADPT_TX     0x00000801    /* transmit debug messages */
31 #define XDBG_DEBUG_TEMAC_ADPT_IOCTL  0x00000802    /* ioctl debug messages */
32 #define XDBG_DEBUG_TEMAC_ADPT_MISC   0x00000803    /* debug msg for other routines */
33 #define XDBG_DEBUG_TEMAC_ADPT_ALL    0x0000080F    /* all temac adapter debug messages */
34
35 #define xdbg_current_types (XDBG_DEBUG_ERROR)
36
37 #define xdbg_stmnt(x)  x
38
39 /* In VxWorks, if _WRS_GNU_VAR_MACROS is defined, special syntax is needed for
40  * macros that accept variable number of arguments
41  */
42 #if defined(XENV_VXWORKS) && defined(_WRS_GNU_VAR_MACROS)
43 #define xdbg_printf(type, args...) (((type) & xdbg_current_types) ? printf (## args) : 0)
44 #else /* ANSI Syntax */
45 #define xdbg_printf(type, ...) (((type) & xdbg_current_types) ? printf (__VA_ARGS__) : 0)
46 #endif
47
48 #else /* defined(DEBUG) && !defined(NDEBUG) */
49
50 #define xdbg_stmnt(x)
51
52 /* See VxWorks comments above */
53 #if defined(XENV_VXWORKS) && defined(_WRS_GNU_VAR_MACROS)
54 #define xdbg_printf(type, args...)
55 #else /* ANSI Syntax */
56 #define xdbg_printf(...)
57 #endif
58
59 #endif /* defined(DEBUG) && !defined(NDEBUG) */
60
61 #endif /* XDEBUG */