Merge branch 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6/mini2440.git] / drivers / staging / meilhaus / medebug.h
blobdcfb97c26fd159b336169de0d81150d1b85c7dca
1 /**
2 * @file medebug.h
4 * @brief Debugging defines.
5 * @note Copyright (C) 2006 Meilhaus Electronic GmbH (support@meilhaus.de)
6 * @author Guenter Gebhardt
7 * @author Krzysztof Gantzke (k.gantzke@meilhaus.de)
8 */
10 #ifndef _MEDEBUG_H_
11 #define _MEDEBUG_H_
13 #ifdef __KERNEL__
15 #include <linux/kernel.h>
17 //Messages control.
19 #ifdef MEDEBUG_TEST_ALL /* Switch to enable all info messages. */
20 # ifndef MEDEBUG_TEST
21 # define MEDEBUG_TEST
22 # endif
23 # ifndef MEDEBUG_TEST_INFO
24 # define MEDEBUG_TEST_INFO
25 # endif
26 # ifndef MEDEBUG_DEBUG_REG
27 # define MEDEBUG_DEBUG_REG /* Switch to enable registry access debuging messages. */
28 # endif
29 # ifndef MEDEBUG_DEBUG_LOCKS
30 # define MEDEBUG_DEBUG_LOCKS /* Switch to enable locking messages. */
31 # endif
32 #endif
34 #ifdef MEDEBUG_TEST_INFO /* Switch to enable info and test messages. */
35 # ifndef MEDEBUG_INFO
36 # define MEDEBUG_INFO /* Switch to enable info messages. */
37 # endif
38 # ifndef MEDEBUG_TEST
39 # define MEDEBUG_TEST
40 # endif
41 #endif
43 #ifdef MEDEBUG_TEST /* Switch to enable debug test messages. */
44 # ifndef MEDEBUG_DEBUG
45 # define MEDEBUG_DEBUG /* Switch to enable debug messages. */
46 # endif
47 # ifndef MEDEBUG_ERROR
48 # define MEDEBUG_ERROR /* Switch to enable error messages. */
49 # endif
50 #endif
52 #ifdef MEDEBUG_ERROR /* Switch to enable error messages. */
53 # ifndef MEDEBUG_ERROR_CRITICAL /* Also critical error messages. */
54 # define MEDEBUG_ERROR_CRITICAL /* Switch to enable high importance error messages. */
55 # endif
56 #endif
58 #undef PDEBUG /* Only to be sure. */
59 #undef PINFO /* Only to be sure. */
60 #undef PERROR /* Only to be sure. */
61 #undef PERROR_CRITICAL /* Only to be sure. */
62 #undef PDEBUG_REG /* Only to be sure. */
63 #undef PDEBUG_LOCKS /* Only to be sure. */
64 #undef PSECURITY /* Only to be sure. */
65 #undef PLOG /* Only to be sure. */
67 #ifdef MEDEBUG_DEBUG
68 # define PDEBUG(fmt, args...) \
69 printk(KERN_DEBUG"ME_DRV D: <%s> " fmt, __func__, ##args)
70 #else
71 # define PDEBUG(fmt, args...)
72 #endif
74 #ifdef MEDEBUG_DEBUG_LOCKS
75 # define PDEBUG_LOCKS(fmt, args...) \
76 printk(KERN_DEBUG"ME_DRV L: <%s> " fmt, __func__, ##args)
77 #else
78 # define PDEBUG_LOCKS(fmt, args...)
79 #endif
81 #ifdef MEDEBUG_DEBUG_REG
82 # define PDEBUG_REG(fmt, args...) \
83 printk(KERN_DEBUG"ME_DRV R: <%s:%d> REG:" fmt, __func__, __LINE__, ##args)
84 #else
85 # define PDEBUG_REG(fmt, args...)
86 #endif
88 #ifdef MEDEBUG_INFO
89 # define PINFO(fmt, args...) \
90 printk(KERN_INFO"ME_DRV I: " fmt, ##args)
91 #else
92 # define PINFO(fmt, args...)
93 #endif
95 #ifdef MEDEBUG_ERROR
96 # define PERROR(fmt, args...) \
97 printk(KERN_ERR"ME_DRV E: <%s:%i> " fmt, __FILE__, __LINE__, ##args)
98 #else
99 # define PERROR(fmt, args...)
100 #endif
102 #ifdef MEDEBUG_ERROR_CRITICAL
103 # define PERROR_CRITICAL(fmt, args...) \
104 printk(KERN_CRIT"ME_DRV C: <%s:%i> " fmt, __FILE__, __LINE__, ##args)
105 #else
106 # define PERROR_CRITICAL(fmt, args...)
107 #endif
109 //This debug is only to detect logical errors!
110 # define PSECURITY(fmt, args...) \
111 printk(KERN_CRIT"ME_DRV SECURITY: <%s:%s:%i> " fmt, __FILE__, __func__, __LINE__, ##args)
112 //This debug is to keep track in customers' system
113 # define PLOG(fmt, args...) \
114 printk(KERN_INFO"ME_DRV: " fmt, ##args)
116 //This debug is to check new parts during development
117 #ifdef MEDEBUG_DEVELOP
118 # define PDEVELOP(fmt, args...) \
119 printk(KERN_CRIT"ME_DRV: <%s:%s:%i> " fmt, __FILE__, __func__, __LINE__, ##args)
120 #else
121 # define PDEVELOP(fmt, args...)
122 #endif
124 #endif //__KERNEL__
125 #endif //_MEDEBUG_H_