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