Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright IBM Corp. 2016 |
| 4 | * Author(s): Harald Freudenberger <freude@de.ibm.com> |
| 5 | */ |
| 6 | #ifndef AP_DEBUG_H |
| 7 | #define AP_DEBUG_H |
| 8 | |
| 9 | #include <asm/debug.h> |
| 10 | |
| 11 | #define DBF_ERR 3 /* error conditions */ |
| 12 | #define DBF_WARN 4 /* warning conditions */ |
| 13 | #define DBF_INFO 5 /* informational */ |
| 14 | #define DBF_DEBUG 6 /* for debugging only */ |
| 15 | |
| 16 | #define RC2ERR(rc) ((rc) ? DBF_ERR : DBF_INFO) |
| 17 | #define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO) |
| 18 | |
| 19 | #define DBF_MAX_SPRINTF_ARGS 5 |
| 20 | |
| 21 | #define AP_DBF(...) \ |
| 22 | debug_sprintf_event(ap_dbf_info, ##__VA_ARGS__) |
Harald Freudenberger | 2ea2a60 | 2020-07-02 15:56:15 +0200 | [diff] [blame] | 23 | #define AP_DBF_ERR(...) \ |
| 24 | debug_sprintf_event(ap_dbf_info, DBF_ERR, ##__VA_ARGS__) |
| 25 | #define AP_DBF_WARN(...) \ |
| 26 | debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__) |
| 27 | #define AP_DBF_INFO(...) \ |
| 28 | debug_sprintf_event(ap_dbf_info, DBF_INFO, ##__VA_ARGS__) |
| 29 | #define AP_DBF_DBG(...) \ |
| 30 | debug_sprintf_event(ap_dbf_info, DBF_DEBUG, ##__VA_ARGS__) |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 31 | |
| 32 | extern debug_info_t *ap_dbf_info; |
| 33 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 34 | #endif /* AP_DEBUG_H */ |