blob: 241dbb5f75bf3e7be86da772836c2af775be320e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Holger Denglerdabecb22012-09-10 21:34:26 +02002/*
Harald Freudenbergercccd85b2016-11-24 06:45:21 +01003 * Copyright IBM Corp. 2016
Holger Denglerdabecb22012-09-10 21:34:26 +02004 * Author(s): Holger Dengler (hd@linux.vnet.ibm.com)
Harald Freudenbergercccd85b2016-11-24 06:45:21 +01005 * Harald Freudenberger <freude@de.ibm.com>
Holger Denglerdabecb22012-09-10 21:34:26 +02006 */
7#ifndef ZCRYPT_DEBUG_H
8#define ZCRYPT_DEBUG_H
9
10#include <asm/debug.h>
Holger Denglerdabecb22012-09-10 21:34:26 +020011
Harald Freudenbergercccd85b2016-11-24 06:45:21 +010012#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 Denglerdabecb22012-09-10 21:34:26 +020016
Harald Freudenbergercccd85b2016-11-24 06:45:21 +010017#define RC2ERR(rc) ((rc) ? DBF_ERR : DBF_INFO)
Holger Denglerdabecb22012-09-10 21:34:26 +020018#define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO)
19
Harald Freudenbergercccd85b2016-11-24 06:45:21 +010020#define DBF_MAX_SPRINTF_ARGS 5
Holger Denglerdabecb22012-09-10 21:34:26 +020021
Harald Freudenbergercccd85b2016-11-24 06:45:21 +010022#define ZCRYPT_DBF(...) \
23 debug_sprintf_event(zcrypt_dbf_info, ##__VA_ARGS__)
Holger Denglerdabecb22012-09-10 21:34:26 +020024
Harald Freudenbergercccd85b2016-11-24 06:45:21 +010025extern debug_info_t *zcrypt_dbf_info;
Holger Denglerdabecb22012-09-10 21:34:26 +020026
27int zcrypt_debug_init(void);
28void zcrypt_debug_exit(void);
29
30#endif /* ZCRYPT_DEBUG_H */