18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright IBM Corp. 2016
48c2ecf20Sopenharmony_ci *  Author(s): Harald Freudenberger <freude@de.ibm.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef AP_DEBUG_H
78c2ecf20Sopenharmony_ci#define AP_DEBUG_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <asm/debug.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define DBF_ERR		3	/* error conditions   */
128c2ecf20Sopenharmony_ci#define DBF_WARN	4	/* warning conditions */
138c2ecf20Sopenharmony_ci#define DBF_INFO	5	/* informational      */
148c2ecf20Sopenharmony_ci#define DBF_DEBUG	6	/* for debugging only */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define RC2ERR(rc) ((rc) ? DBF_ERR : DBF_INFO)
178c2ecf20Sopenharmony_ci#define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define DBF_MAX_SPRINTF_ARGS 5
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define AP_DBF(...)					\
228c2ecf20Sopenharmony_ci	debug_sprintf_event(ap_dbf_info, ##__VA_ARGS__)
238c2ecf20Sopenharmony_ci#define AP_DBF_ERR(...)					\
248c2ecf20Sopenharmony_ci	debug_sprintf_event(ap_dbf_info, DBF_ERR, ##__VA_ARGS__)
258c2ecf20Sopenharmony_ci#define AP_DBF_WARN(...)					\
268c2ecf20Sopenharmony_ci	debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
278c2ecf20Sopenharmony_ci#define AP_DBF_INFO(...)					\
288c2ecf20Sopenharmony_ci	debug_sprintf_event(ap_dbf_info, DBF_INFO, ##__VA_ARGS__)
298c2ecf20Sopenharmony_ci#define AP_DBF_DBG(...)					\
308c2ecf20Sopenharmony_ci	debug_sprintf_event(ap_dbf_info, DBF_DEBUG, ##__VA_ARGS__)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciextern debug_info_t *ap_dbf_info;
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#endif /* AP_DEBUG_H */
35