1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2023 Intel Corporation
6 #ifndef __INTEL_GUC_PRINT__
7 #define __INTEL_GUC_PRINT__
9 #include "gt/intel_gt.h"
10 #include "gt/intel_gt_print.h"
12 #define guc_printk(_guc, _level, _fmt, ...) \
13 gt_##_level(guc_to_gt(_guc), "GUC: " _fmt, ##__VA_ARGS__)
15 #define guc_err(_guc, _fmt, ...) \
16 guc_printk((_guc), err, _fmt, ##__VA_ARGS__)
18 #define guc_warn(_guc, _fmt, ...) \
19 guc_printk((_guc), warn, _fmt, ##__VA_ARGS__)
21 #define guc_notice(_guc, _fmt, ...) \
22 guc_printk((_guc), notice, _fmt, ##__VA_ARGS__)
24 #define guc_info(_guc, _fmt, ...) \
25 guc_printk((_guc), info, _fmt, ##__VA_ARGS__)
27 #define guc_dbg(_guc, _fmt, ...) \
28 guc_printk((_guc), dbg, _fmt, ##__VA_ARGS__)
30 #define guc_err_ratelimited(_guc, _fmt, ...) \
31 guc_printk((_guc), err_ratelimited, _fmt, ##__VA_ARGS__)
33 #define guc_notice_ratelimited(_guc, _fmt, ...) \
34 guc_printk((_guc), notice_ratelimited, _fmt, ##__VA_ARGS__)
36 #define guc_probe_error(_guc, _fmt, ...) \
37 guc_printk((_guc), probe_error, _fmt, ##__VA_ARGS__)
39 #define guc_WARN(_guc, _cond, _fmt, ...) \
40 gt_WARN(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__)
42 #define guc_WARN_ONCE(_guc, _cond, _fmt, ...) \
43 gt_WARN_ONCE(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__)
45 #define guc_WARN_ON(_guc, _cond) \
46 gt_WARN(guc_to_gt(_guc), _cond, "%s(%s)", "guc_WARN_ON", __stringify(_cond))
48 #define guc_WARN_ON_ONCE(_guc, _cond) \
49 gt_WARN_ONCE(guc_to_gt(_guc), _cond, "%s(%s)", "guc_WARN_ON_ONCE", __stringify(_cond))
51 #endif /* __INTEL_GUC_PRINT__ */