blob: f88844adae1ba432e58e8f1d3744415062dab1e7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef CIO_DEBUG_H
2#define CIO_DEBUG_H
3
4#include <asm/debug.h>
5
Peter Oberparleiter06fbcb12006-04-10 22:53:46 -07006/* for use of debug feature */
7extern debug_info_t *cio_debug_msg_id;
8extern debug_info_t *cio_debug_trace_id;
9extern debug_info_t *cio_debug_crw_id;
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#define CIO_TRACE_EVENT(imp, txt) do { \
12 debug_text_event(cio_debug_trace_id, imp, txt); \
13 } while (0)
14
15#define CIO_MSG_EVENT(imp, args...) do { \
16 debug_sprintf_event(cio_debug_msg_id, imp , ##args); \
17 } while (0)
18
19#define CIO_CRW_EVENT(imp, args...) do { \
20 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \
21 } while (0)
22
Peter Oberparleiter06fbcb12006-04-10 22:53:46 -070023static inline void
24CIO_HEX_EVENT(int level, void *data, int length)
25{
26 while (length > 0) {
27 debug_event(cio_debug_trace_id, level, data, length);
28 length -= cio_debug_trace_id->buf_size;
29 data += cio_debug_trace_id->buf_size;
30 }
31}
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
33#define CIO_DEBUG(printk_level,event_level,msg...) ({ \
34 if (cio_show_msg) printk(printk_level msg); \
35 CIO_MSG_EVENT (event_level, msg); \
36})
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#endif