Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 2 | /* |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 3 | * Copyright IBM Corp. 2016 |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 4 | * Author(s): Holger Dengler (hd@linux.vnet.ibm.com) |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 5 | * Harald Freudenberger <freude@de.ibm.com> |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 6 | */ |
| 7 | #ifndef ZCRYPT_DEBUG_H |
| 8 | #define ZCRYPT_DEBUG_H |
| 9 | |
| 10 | #include <asm/debug.h> |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 11 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 12 | #define DBF_ERR 3 /* error conditions */ |
| 13 | #define DBF_WARN 4 /* warning conditions */ |
| 14 | #define DBF_INFO 5 /* informational */ |
| 15 | #define DBF_DEBUG 6 /* for debugging only */ |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 16 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 17 | #define RC2ERR(rc) ((rc) ? DBF_ERR : DBF_INFO) |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 18 | #define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO) |
| 19 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 20 | #define DBF_MAX_SPRINTF_ARGS 5 |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 21 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 22 | #define ZCRYPT_DBF(...) \ |
| 23 | debug_sprintf_event(zcrypt_dbf_info, ##__VA_ARGS__) |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 24 | |
Harald Freudenberger | cccd85b | 2016-11-24 06:45:21 +0100 | [diff] [blame] | 25 | extern debug_info_t *zcrypt_dbf_info; |
Holger Dengler | dabecb2 | 2012-09-10 21:34:26 +0200 | [diff] [blame] | 26 | |
| 27 | int zcrypt_debug_init(void); |
| 28 | void zcrypt_debug_exit(void); |
| 29 | |
| 30 | #endif /* ZCRYPT_DEBUG_H */ |