Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef CIO_DEBUG_H |
2 | #define CIO_DEBUG_H | |
3 | ||
4 | #include <asm/debug.h> | |
5 | ||
06fbcb10 PO |
6 | /* for use of debug feature */ |
7 | extern debug_info_t *cio_debug_msg_id; | |
8 | extern debug_info_t *cio_debug_trace_id; | |
9 | extern debug_info_t *cio_debug_crw_id; | |
10 | ||
bc698bcf | 11 | #define CIO_TRACE_EVENT(imp, txt) do { \ |
1da177e4 LT |
12 | debug_text_event(cio_debug_trace_id, imp, txt); \ |
13 | } while (0) | |
14 | ||
bc698bcf CH |
15 | #define CIO_MSG_EVENT(imp, args...) do { \ |
16 | debug_sprintf_event(cio_debug_msg_id, imp , ##args); \ | |
1da177e4 LT |
17 | } while (0) |
18 | ||
bc698bcf CH |
19 | #define CIO_CRW_EVENT(imp, args...) do { \ |
20 | debug_sprintf_event(cio_debug_crw_id, imp , ##args); \ | |
1da177e4 LT |
21 | } while (0) |
22 | ||
bc698bcf | 23 | static inline void CIO_HEX_EVENT(int level, void *data, int length) |
06fbcb10 | 24 | { |
303fa9e3 CH |
25 | if (unlikely(!cio_debug_trace_id)) |
26 | return; | |
06fbcb10 PO |
27 | while (length > 0) { |
28 | debug_event(cio_debug_trace_id, level, data, length); | |
29 | length -= cio_debug_trace_id->buf_size; | |
30 | data += cio_debug_trace_id->buf_size; | |
31 | } | |
32 | } | |
1da177e4 | 33 | |
1da177e4 | 34 | #endif |