summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/include/debug_defs.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 13:25:42 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 13:25:42 +0000
commite16e0caf72ca74b2f94c04ebeaac63bc460c5e6c (patch)
tree7ac3782574e95031c0d1fbe418a45fe6117046ac /c/src/lib/libbsp/sparc/shared/include/debug_defs.h
parent2007-09-06 Daniel Hellstrom <daniel@gaisler.com> (diff)
downloadrtems-e16e0caf72ca74b2f94c04ebeaac63bc460c5e6c.tar.bz2
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
* Makefile.am: Add the following new drivers: PCI, b1553BRM, SpaceWire(GRSPW), CAN (GRCAN,OC_CAN), Raw UART. * shared/include/apbuart.h, shared/include/apbuart_pci.h, shared/include/apbuart_rasta.h, shared/include/b1553brm.h, shared/include/b1553brm_pci.h, shared/include/b1553brm_rasta.h, shared/include/debug_defs.h, shared/include/grcan.h, shared/include/grcan_rasta.h, shared/include/grcan_spwrtc.h, shared/include/grspw.h, shared/include/grspw_pci.h, shared/include/grspw_rasta.h, shared/include/occan.h, shared/include/occan_pci.h, shared/include/pci.h: New files.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/include/debug_defs.h')
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/debug_defs.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/debug_defs.h b/c/src/lib/libbsp/sparc/shared/include/debug_defs.h
new file mode 100644
index 0000000000..970230eb0a
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/debug_defs.h
@@ -0,0 +1,40 @@
+
+#ifndef __DEBUG_DEFS_H__
+#define __DEBUG_DEFS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef DEBUG
+
+ #ifndef DEBUG_FLAGS
+ #define DEBUG_FLAGS 0
+ #endif
+
+ extern int DEBUG_printf(const char *fmt, ...);
+ #define DBG(fmt, args...) do { printk(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__,## args); } while(0)
+ #define DBG2(fmt) do { printk(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__); } while(0)
+ #define DBGC(c,fmt, args...) do { if (DEBUG_FLAGS & c) { printk(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__,## args); }} while(0)
+
+#else
+
+ #define DBG(fmt, args...)
+ #define DBG2(fmt, args...)
+ #define DBGC(c, fmt, args...)
+
+#endif
+
+#ifdef DEBUGFUNCS
+ #define FUNCDBG() do { printk("%s\n\r",__FUNCTION__); } while(0)
+ extern int DEBUG_printf(const char *fmt, ...);
+#else
+ #define FUNCDBG()
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DEBUG_DEFS_H__ */