Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/lgrp_user.h
+++ new/usr/src/uts/common/sys/lgrp_user.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.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 #ifndef _LGRP_USER_H
28 30 #define _LGRP_USER_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 /*
33 33 * latency group definitions for user
34 34 */
35 35
36 36 #ifdef __cplusplus
37 37 extern "C" {
38 38 #endif
39 39
40 40
41 41 #include <sys/inttypes.h>
42 42 #include <sys/lgrp.h>
43 43 #include <sys/procset.h>
44 44 #include <sys/processor.h>
45 45 #include <sys/pset.h>
46 46 #include <sys/types.h>
47 47
48 48
49 49 /*
50 50 * lgroup interface version
51 51 */
52 52 #define LGRP_VER_NONE 0 /* no lgroup interface version */
53 53 #define LGRP_VER_CURRENT 2 /* current lgroup interface version */
54 54
55 55
56 56 /*
57 57 * lgroup system call subcodes
58 58 */
59 59 #define LGRP_SYS_MEMINFO 0 /* meminfo(2) aka MISYS_MEMINFO */
60 60 #define LGRP_SYS_GENERATION 1 /* lgrp_generation() */
61 61 #define LGRP_SYS_VERSION 2 /* lgrp_version() */
62 62 #define LGRP_SYS_SNAPSHOT 3 /* lgrp_snapshot() */
63 63 #define LGRP_SYS_AFFINITY_GET 4 /* lgrp_affinity_set() */
64 64 #define LGRP_SYS_AFFINITY_SET 5 /* lgrp_affinity_get() */
65 65 #define LGRP_SYS_LATENCY 6 /* lgrp_latency() */
66 66 #define LGRP_SYS_HOME 7 /* lgrp_home() */
67 67
68 68
69 69 /*
70 70 * lgroup resources
71 71 */
72 72 #define LGRP_RSRC_COUNT 2 /* no. of resource types in lgroup */
73 73 #define LGRP_RSRC_CPU 0 /* CPU resources */
74 74 #define LGRP_RSRC_MEM 1 /* memory resources */
75 75
76 76 typedef int lgrp_rsrc_t;
77 77
78 78
79 79
80 80 /*
81 81 * lgroup affinity
82 82 */
83 83 #define LGRP_AFF_NONE 0x0 /* no affinity */
84 84 #define LGRP_AFF_WEAK 0x10 /* weak affinity */
85 85 #define LGRP_AFF_STRONG 0x100 /* strong affinity */
86 86
87 87 typedef int lgrp_affinity_t;
88 88
89 89 /*
90 90 * Arguments to lgrp_affinity_{get,set}()
91 91 */
92 92 typedef struct lgrp_affinity_args {
93 93 idtype_t idtype; /* ID type */
94 94 id_t id; /* ID */
95 95 lgrp_id_t lgrp; /* lgroup */
96 96 lgrp_affinity_t aff; /* affinity */
97 97 } lgrp_affinity_args_t;
98 98
99 99
100 100 /*
101 101 * Flags to specify contents of lgroups desired
102 102 */
103 103 typedef enum lgrp_content {
104 104 LGRP_CONTENT_ALL, /* everything in lgroup */
105 105 /* everything in lgroup's hierarchy (for compatability) */
106 106 LGRP_CONTENT_HIERARCHY = LGRP_CONTENT_ALL,
107 107 LGRP_CONTENT_DIRECT /* what's directly contained in lgroup */
108 108 } lgrp_content_t;
109 109
110 110
111 111 /*
112 112 * Flags for lgrp_latency_cookie() specifying what hardware resources to get
113 113 * latency between
114 114 */
115 115 typedef enum lgrp_lat_between {
116 116 LGRP_LAT_CPU_TO_MEM /* latency between CPU and memory */
117 117 } lgrp_lat_between_t;
118 118
119 119
120 120 /*
121 121 * lgroup memory size type
122 122 */
123 123 typedef longlong_t lgrp_mem_size_t;
124 124
125 125
126 126 /*
127 127 * lgroup memory size flags
128 128 */
129 129 typedef enum lgrp_mem_size_flag {
130 130 LGRP_MEM_SZ_FREE, /* free memory */
131 131 LGRP_MEM_SZ_INSTALLED /* installed memory */
132 132 } lgrp_mem_size_flag_t;
133 133
134 134
135 135 /*
136 136 * View of lgroups
137 137 */
138 138 typedef enum lgrp_view {
139 139 LGRP_VIEW_CALLER, /* what's available to the caller */
140 140 LGRP_VIEW_OS /* what's available to operating system */
141 141 } lgrp_view_t;
142 142
143 143
144 144 /*
145 145 * lgroup information needed by user
146 146 */
147 147 typedef struct lgrp_info {
148 148 lgrp_id_t info_lgrpid; /* lgroup ID */
149 149 int info_latency; /* latency */
150 150 ulong_t *info_parents; /* parent lgroups */
151 151 ulong_t *info_children; /* children lgroups */
152 152 ulong_t *info_rset; /* lgroup resources */
153 153 pgcnt_t info_mem_free; /* free memory */
154 154 pgcnt_t info_mem_install; /* installed memory */
155 155 processorid_t *info_cpuids; /* CPU IDs */
156 156 int info_ncpus; /* number of CPUs */
157 157 } lgrp_info_t;
158 158
159 159
160 160 /*
161 161 * Type of lgroup cookie to use with interface routines
162 162 */
163 163 typedef uintptr_t lgrp_cookie_t;
164 164
165 165 #define LGRP_COOKIE_NONE 0 /* no cookie */
166 166
167 167
168 168 /*
169 169 * Type of lgroup generation number
170 170 */
171 171 typedef uint_t lgrp_gen_t;
172 172
173 173
174 174 /*
175 175 * Format of lgroup hierarchy snapshot
176 176 */
177 177 typedef struct lgrp_snapshot_header {
178 178 int ss_version; /* lgroup interface version */
179 179 int ss_levels; /* levels of hierarchy */
180 180 int ss_nlgrps; /* number of lgroups */
181 181 int ss_nlgrps_os; /* number of lgroups (OS view) */
182 182 int ss_nlgrps_max; /* maximum number of lgroups */
183 183 int ss_root; /* root lgroup */
184 184 int ss_ncpus; /* total number of CPUs */
185 185 lgrp_view_t ss_view; /* view of lgroup hierarchy */
186 186 psetid_t ss_pset; /* caller's pset ID */
187 187 lgrp_gen_t ss_gen; /* snapshot generation ID */
188 188 size_t ss_size; /* total size of snapshot */
189 189 uintptr_t ss_magic; /* snapshot magic number */
190 190 lgrp_info_t *ss_info; /* lgroup info array */
191 191 processorid_t *ss_cpuids; /* lgroup CPU ID array */
192 192 ulong_t *ss_lgrpset; /* bit mask of available lgroups */
193 193 ulong_t *ss_parents; /* lgroup parent bit masks */
194 194 ulong_t *ss_children; /* lgroup children bit masks */
195 195 ulong_t *ss_rsets; /* lgroup resource set bit masks */
196 196 int **ss_latencies; /* latencies between lgroups */
197 197 } lgrp_snapshot_header_t;
198 198
199 199
200 200 #ifdef _SYSCALL32
201 201 /*
202 202 * lgroup information needed by 32-bit user
203 203 */
204 204 typedef struct lgrp_info32 {
205 205 int info_lgrpid; /* lgroup ID */
206 206 int info_latency; /* latency */
207 207 caddr32_t info_parents; /* parent lgroups */
208 208 caddr32_t info_children; /* children lgroups */
209 209 caddr32_t info_rset; /* lgroup resources */
210 210 uint32_t info_mem_free; /* free memory */
211 211 uint32_t info_mem_install; /* installed memory */
212 212 caddr32_t info_cpuids; /* CPU IDs */
213 213 int info_ncpus; /* number of CPUs */
214 214 } lgrp_info32_t;
215 215
216 216
217 217 /*
218 218 * Format of lgroup hierarchy snapshot for 32-bit programs
219 219 */
220 220 typedef struct lgrp_snapshot_header32 {
221 221 int ss_version; /* lgroup interface version */
222 222 int ss_levels; /* levels of hierarchy */
223 223 int ss_nlgrps; /* number of lgroups */
224 224 int ss_nlgrps_os; /* number of lgroups (OS view) */
225 225 int ss_nlgrps_max; /* maximum number of lgroups */
226 226 int ss_root; /* root lgroup */
227 227 int ss_ncpus; /* total number of CPUs */
228 228 int ss_view; /* view of lgroup hierarchy */
229 229 int ss_pset; /* caller's pset ID */
230 230 uint_t ss_gen; /* snapshot generation ID */
231 231 size32_t ss_size; /* total size of snapshot */
232 232 uint32_t ss_magic; /* snapshot magic number */
233 233 caddr32_t ss_info; /* lgroup info array */
234 234 caddr32_t ss_cpuids; /* lgroup CPU ID array */
235 235 caddr32_t ss_lgrpset; /* bit mask of available lgroups */
236 236 caddr32_t ss_parents; /* lgroup parent bit masks */
↓ open down ↓ |
195 lines elided |
↑ open up ↑ |
237 237 caddr32_t ss_children; /* lgroup children bit masks */
238 238 caddr32_t ss_rsets; /* lgroup resource set bit masks */
239 239 caddr32_t ss_latencies; /* latencies between lgroups */
240 240 } lgrp_snapshot_header32_t;
241 241
242 242 #endif /* _SYSCALL32 */
243 243
244 244
245 245 #if (!defined(_KERNEL) && !defined(_KMEMUSER))
246 246
247 -#ifdef __STDC__
248 -
249 247 lgrp_affinity_t lgrp_affinity_get(idtype_t idtype, id_t id, lgrp_id_t lgrp);
250 248
251 249 int lgrp_affinity_set(idtype_t idtype, id_t id, lgrp_id_t lgrp,
252 250 lgrp_affinity_t aff);
253 251
254 252 int lgrp_children(lgrp_cookie_t cookie, lgrp_id_t lgrp,
255 253 lgrp_id_t *children, uint_t count);
256 254
257 255 int lgrp_cookie_stale(lgrp_cookie_t cookie);
258 256
259 257 int lgrp_cpus(lgrp_cookie_t cookie, lgrp_id_t lgrp,
260 258 processorid_t *cpuids, uint_t count, lgrp_content_t content);
261 259
262 260 int lgrp_fini(lgrp_cookie_t cookie);
263 261
264 262 int lgrp_latency(lgrp_id_t from, lgrp_id_t to);
265 263
266 264 int lgrp_latency_cookie(lgrp_cookie_t cookie, lgrp_id_t from,
267 265 lgrp_id_t to, lgrp_lat_between_t between);
268 266
269 267 lgrp_id_t lgrp_home(idtype_t idtype, id_t id);
270 268
271 269 lgrp_cookie_t lgrp_init(lgrp_view_t view);
272 270
273 271 lgrp_mem_size_t lgrp_mem_size(lgrp_cookie_t cookie, lgrp_id_t lgrp,
274 272 lgrp_mem_size_flag_t type, lgrp_content_t content);
275 273
276 274 int lgrp_nlgrps(lgrp_cookie_t cookie);
277 275
278 276 int lgrp_parents(lgrp_cookie_t cookie, lgrp_id_t lgrp,
279 277 lgrp_id_t *parents, uint_t count);
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
280 278
281 279 int lgrp_resources(lgrp_cookie_t cookie, lgrp_id_t lgrp,
282 280 lgrp_id_t *lgrps, uint_t count, lgrp_rsrc_t type);
283 281
284 282 lgrp_id_t lgrp_root(lgrp_cookie_t cookie);
285 283
286 284 int lgrp_version(int version);
287 285
288 286 lgrp_view_t lgrp_view(lgrp_cookie_t cookie);
289 287
290 -#else /* __STDC__ */
291 -lgrp_affinity_t lgrp_affinity_get();
292 -int lgrp_affinity_set();
293 -int lgrp_children();
294 -int lgrp_cookie_stale();
295 -int lgrp_cpus();
296 -int lgrp_fini();
297 -lgrp_id_t lgrp_home();
298 -int lgrp_init();
299 -int lgrp_latency();
300 -spgcnt_t lgrp_mem_size();
301 -int lgrp_nlgrps();
302 -int lgrp_parents();
303 -int lgrp_resources();
304 -lgrp_id_t lgrp_root();
305 -int lgrp_version();
306 -lgrp_view_t lgrp_view();
307 -#endif /* __STDC__ */
308 -
309 288 #endif /* !_KERNEL && !_KMEMUSER */
310 289
311 290 #ifdef __cplusplus
312 291 }
313 292 #endif
314 293
315 294 #endif /* _LGRP_USER_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX