Print this page
10805 Fix for 10687 can be improved
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
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 27 /*
28 28 * Copyright 2019, Joyent, Inc.
29 29 */
30 30
31 31 #ifndef _SYS_IB_IBTL_IMPL_IBTL_UTIL_H
32 32 #define _SYS_IB_IBTL_IMPL_IBTL_UTIL_H
33 33
34 34 /*
35 35 * ibtl_util.h
36 36 *
37 37 * All data structures and function prototypes that serve as helper
38 38 * routines for IBTF implementation.
39 39 */
40 40
41 41 #ifdef __cplusplus
42 42 extern "C" {
43 43 #endif
44 44
45 45 #include <sys/ib/ib_types.h>
46 46 #include <sys/varargs.h>
47 47
48 48 /*
49 49 * Time Related Functions
50 50 *
51 51 * ibt_usec2ib
52 52 * This function converts the standard input time in microseconds to
53 53 * IB's 6 bits of timeout exponent, calculated based on
54 54 * time = 4.096us * 2 ^ exp.
55 55 *
56 56 * ibt_ib2usec
57 57 * This function converts the input IB timeout exponent (6 bits) to
58 58 * standard time in microseconds, calculated based on
59 59 * time = 4.096us * 2 ^ exp.
60 60 */
61 61 ib_time_t ibt_usec2ib(clock_t microsecs);
62 62 clock_t ibt_ib2usec(ib_time_t ib_time);
63 63
64 64
65 65 /*
66 66 * IB logging, debug and console message handling
67 67 */
68 68
69 69
70 70 /*
71 71 * warnings, console & syslog buffer.
72 72 * For Non recoverable or Major Errors
73 73 */
74 74 #define IBTF_LOG_L0 0
75 75
76 76 /*
77 77 * syslog buffer or IBTF trace buffer (console if booted /w debug)
78 78 * For additional information on Non recoverable errors and
79 79 * warnings/informational message for sys-admin types.
80 80 */
81 81 #define IBTF_LOG_L1 1
82 82
83 83 /*
84 84 * debug only
85 85 * for more verbose trace than L1, for e.g. recoverable errors,
86 86 * or intersting trace
87 87 */
88 88 #define IBTF_LOG_L2 2
89 89
90 90 /*
91 91 * debug only
92 92 * for more verbose trace than L2, for e.g. printing function entries....
93 93 */
94 94 #define IBTF_LOG_L3 3
95 95
96 96 /*
97 97 * debug only
98 98 * for more verbose trace than L3, for e.g. printing minor function entries...
99 99 */
100 100 #define IBTF_LOG_L4 4
101 101
102 102 /*
103 103 * debug only
104 104 * most verbose level. Used only for excessive trace, for e.g.
105 105 * printing structures etc.
106 106 */
107 107 #define IBTF_LOG_L5 5
108 108
109 109 /*
110 110 * debug only
111 111 * for messages from softints, taskqs, intr handlers, timeout handlers etc.
112 112 * Only gets printed if "ibtl_allow_intr_msgs" is set
113 113 */
114 114 #define IBTF_LOG_LINTR 6
115 115
116 116
117 117 #ifdef DEBUG
118 118 #define IBTF_DPRINTF_LINTR ibtl_dprintf_intr
119 119 #define IBTF_DPRINTF_L5 ibtl_dprintf5
120 120 #define IBTF_DPRINTF_L4 ibtl_dprintf4
121 121 #define IBTF_DPRINTF_L3 ibtl_dprintf3
122 122
123 123 void ibtl_dprintf_intr(
124 124 char *name,
125 125 char *fmt, ...);
↓ open down ↓ |
125 lines elided |
↑ open up ↑ |
126 126 void ibtl_dprintf5(
127 127 char *name,
128 128 char *fmt, ...);
129 129 void ibtl_dprintf4(
130 130 char *name,
131 131 char *fmt, ...);
132 132 void ibtl_dprintf3(
133 133 char *name,
134 134 char *fmt, ...);
135 135 #else
136 -#define IBTF_DPRINTF_LINTR(...)
137 -#define IBTF_DPRINTF_L5(...)
138 -#define IBTF_DPRINTF_L4(...)
139 -#define IBTF_DPRINTF_L3(...)
136 +#define IBTF_DPRINTF_LINTR(...) (void)(0)
137 +#define IBTF_DPRINTF_L5(...) (void)(0)
138 +#define IBTF_DPRINTF_L4(...) (void)(0)
139 +#define IBTF_DPRINTF_L3(...) (void)(0)
140 140 #endif
141 141
142 142 #define IBTF_DPRINTF_L2 ibtl_dprintf2
143 143 #define IBTF_DPRINTF_L1 ibtl_dprintf1
144 144 #define IBTF_DPRINTF_L0 ibtl_dprintf0
145 145
146 146 void ibtl_dprintf2(
147 147 char *name,
148 148 char *fmt, ...);
149 149 void ibtl_dprintf1(
150 150 char *name,
151 151 char *fmt, ...);
152 152 void ibtl_dprintf0(
153 153 char *name,
154 154 char *fmt, ...);
155 155
156 156 #ifdef __cplusplus
157 157 }
158 158 #endif
159 159
160 160 #endif /* _SYS_IB_IBTL_IMPL_IBTL_UTIL_H */
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX