18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef CIO_DEBUG_H 38c2ecf20Sopenharmony_ci#define CIO_DEBUG_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <asm/debug.h> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci/* for use of debug feature */ 88c2ecf20Sopenharmony_ciextern debug_info_t *cio_debug_msg_id; 98c2ecf20Sopenharmony_ciextern debug_info_t *cio_debug_trace_id; 108c2ecf20Sopenharmony_ciextern debug_info_t *cio_debug_crw_id; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define CIO_TRACE_EVENT(imp, txt) do { \ 138c2ecf20Sopenharmony_ci debug_text_event(cio_debug_trace_id, imp, txt); \ 148c2ecf20Sopenharmony_ci } while (0) 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define CIO_MSG_EVENT(imp, args...) do { \ 178c2ecf20Sopenharmony_ci debug_sprintf_event(cio_debug_msg_id, imp , ##args); \ 188c2ecf20Sopenharmony_ci } while (0) 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#define CIO_CRW_EVENT(imp, args...) do { \ 218c2ecf20Sopenharmony_ci debug_sprintf_event(cio_debug_crw_id, imp , ##args); \ 228c2ecf20Sopenharmony_ci } while (0) 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_cistatic inline void CIO_HEX_EVENT(int level, void *data, int length) 258c2ecf20Sopenharmony_ci{ 268c2ecf20Sopenharmony_ci debug_event(cio_debug_trace_id, level, data, length); 278c2ecf20Sopenharmony_ci} 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#endif 30