Print this page
10686 Debug macros causes smatch issues
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h
+++ new/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 +/*
28 + * Copyright 2019, Joyent, Inc.
29 + */
30 +
27 31 #ifndef _SYS_IB_IBTL_IMPL_IBTL_UTIL_H
28 32 #define _SYS_IB_IBTL_IMPL_IBTL_UTIL_H
29 33
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 34 /*
33 35 * ibtl_util.h
34 36 *
35 37 * All data structures and function prototypes that serve as helper
36 38 * routines for IBTF implementation.
37 39 */
38 40
39 41 #ifdef __cplusplus
40 42 extern "C" {
41 43 #endif
42 44
43 45 #include <sys/ib/ib_types.h>
44 46 #include <sys/varargs.h>
45 47
46 48 /*
47 49 * Time Related Functions
48 50 *
49 51 * ibt_usec2ib
50 52 * This function converts the standard input time in microseconds to
51 53 * IB's 6 bits of timeout exponent, calculated based on
52 54 * time = 4.096us * 2 ^ exp.
53 55 *
54 56 * ibt_ib2usec
55 57 * This function converts the input IB timeout exponent (6 bits) to
56 58 * standard time in microseconds, calculated based on
57 59 * time = 4.096us * 2 ^ exp.
58 60 */
59 61 ib_time_t ibt_usec2ib(clock_t microsecs);
60 62 clock_t ibt_ib2usec(ib_time_t ib_time);
61 63
62 64
63 65 /*
64 66 * IB logging, debug and console message handling
65 67 */
66 68
67 69
68 70 /*
69 71 * warnings, console & syslog buffer.
70 72 * For Non recoverable or Major Errors
71 73 */
72 74 #define IBTF_LOG_L0 0
73 75
74 76 /*
75 77 * syslog buffer or IBTF trace buffer (console if booted /w debug)
76 78 * For additional information on Non recoverable errors and
77 79 * warnings/informational message for sys-admin types.
78 80 */
79 81 #define IBTF_LOG_L1 1
80 82
81 83 /*
82 84 * debug only
83 85 * for more verbose trace than L1, for e.g. recoverable errors,
84 86 * or intersting trace
85 87 */
86 88 #define IBTF_LOG_L2 2
87 89
88 90 /*
89 91 * debug only
90 92 * for more verbose trace than L2, for e.g. printing function entries....
91 93 */
92 94 #define IBTF_LOG_L3 3
93 95
94 96 /*
95 97 * debug only
96 98 * for more verbose trace than L3, for e.g. printing minor function entries...
97 99 */
98 100 #define IBTF_LOG_L4 4
99 101
100 102 /*
101 103 * debug only
102 104 * most verbose level. Used only for excessive trace, for e.g.
103 105 * printing structures etc.
104 106 */
105 107 #define IBTF_LOG_L5 5
106 108
107 109 /*
108 110 * debug only
109 111 * for messages from softints, taskqs, intr handlers, timeout handlers etc.
110 112 * Only gets printed if "ibtl_allow_intr_msgs" is set
111 113 */
112 114 #define IBTF_LOG_LINTR 6
113 115
114 116
115 117 #ifdef DEBUG
116 118 #define IBTF_DPRINTF_LINTR ibtl_dprintf_intr
117 119 #define IBTF_DPRINTF_L5 ibtl_dprintf5
118 120 #define IBTF_DPRINTF_L4 ibtl_dprintf4
119 121 #define IBTF_DPRINTF_L3 ibtl_dprintf3
120 122
121 123 void ibtl_dprintf_intr(
122 124 char *name,
123 125 char *fmt, ...);
↓ open down ↓ |
82 lines elided |
↑ open up ↑ |
124 126 void ibtl_dprintf5(
125 127 char *name,
126 128 char *fmt, ...);
127 129 void ibtl_dprintf4(
128 130 char *name,
129 131 char *fmt, ...);
130 132 void ibtl_dprintf3(
131 133 char *name,
132 134 char *fmt, ...);
133 135 #else
134 -#define IBTF_DPRINTF_LINTR 0 &&
135 -#define IBTF_DPRINTF_L5 0 &&
136 -#define IBTF_DPRINTF_L4 0 &&
137 -#define IBTF_DPRINTF_L3 0 &&
136 +#define IBTF_DPRINTF_LINTR(...)
137 +#define IBTF_DPRINTF_L5(...)
138 +#define IBTF_DPRINTF_L4(...)
139 +#define IBTF_DPRINTF_L3(...)
138 140 #endif
139 141
140 142 #define IBTF_DPRINTF_L2 ibtl_dprintf2
141 143 #define IBTF_DPRINTF_L1 ibtl_dprintf1
142 144 #define IBTF_DPRINTF_L0 ibtl_dprintf0
143 145
144 146 void ibtl_dprintf2(
145 147 char *name,
146 148 char *fmt, ...);
147 149 void ibtl_dprintf1(
148 150 char *name,
149 151 char *fmt, ...);
150 152 void ibtl_dprintf0(
151 153 char *name,
152 154 char *fmt, ...);
153 155
154 156 #ifdef __cplusplus
155 157 }
156 158 #endif
157 159
158 160 #endif /* _SYS_IB_IBTL_IMPL_IBTL_UTIL_H */
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX