4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_POOL_IMPL_H
28 #define _SYS_POOL_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
33 #include <sys/cpupart.h>
34 #include <sys/exacct_catalog.h>
35 #include <sys/nvpair.h>
42 * Pools driver ioctl interfaces
45 #define POOL_STATUSQ 1
47 #define POOL_DESTROY 3
51 #define POOL_TRANSFER 7
52 #define POOL_XTRANSFER 8
53 #define POOL_PROPGET 9
54 #define POOL_PROPPUT 10
55 #define POOL_PROPRM 11
58 #define POOL_COMMIT 14
61 * Pools-related exacct catalog IDs
63 #define EXD_GROUP_SYSTEM 0x000000
64 #define EXD_SYSTEM_PROP 0x000001
65 #define EXD_SYSTEM_TSTAMP 0x000002
67 #define EXD_GROUP_POOL 0x000100
68 #define EXD_POOL_POOLID 0x000101
69 #define EXD_POOL_PSETID 0x000102
70 #define EXD_POOL_PROP 0x000104
71 #define EXD_POOL_TSTAMP 0x000105
73 #define EXD_GROUP_PSET 0x000200
74 #define EXD_PSET_PSETID 0x000201
75 #define EXD_PSET_PROP 0x000202
76 #define EXD_PSET_TSTAMP 0x000203
78 #define EXD_GROUP_CPU 0x000400
79 #define EXD_CPU_CPUID 0x000401
80 #define EXD_CPU_PROP 0x000402
81 #define EXD_CPU_TSTAMP 0x000403
86 typedef enum pool_elem_class
{
87 PEC_INVALID
= 0, /* invalid class, for error reporting */
88 PEC_SYSTEM
, /* a system */
89 PEC_POOL
, /* a pool */
90 PEC_RES_COMP
, /* a set */
91 PEC_RES_AGG
, /* a set */
92 PEC_COMP
/* a resource component */
95 typedef enum pool_resource_elem_class
{
97 PREC_PSET
/* processor set */
98 } pool_resource_elem_class_t
;
100 typedef enum pool_component_elem_class
{
103 } pool_component_elem_class_t
;
106 * Constants used by devpool.
108 #define POOL_IDLIST_SIZE 1024
109 #define POOL_PROPNAME_SIZE 8192
110 #define POOL_PROPBUF_SIZE 65535
112 typedef struct pool_status
{
116 typedef struct pool_create
{
122 typedef struct pool_destroy
{
128 typedef struct pool_query
{
129 size_t pq_io_bufsize
;
134 typedef struct pool_query32
{
135 size32_t pq_io_bufsize
;
138 #endif /* _SYSCALL32 */
140 typedef struct pool_assoc
{
141 poolid_t pa_o_pool_id
;
142 pool_resource_elem_class_t pa_o_id_type
;
146 typedef struct pool_dissoc
{
147 poolid_t pd_o_pool_id
;
148 pool_resource_elem_class_t pd_o_id_type
;
151 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
155 typedef struct pool_transfer
{
156 pool_resource_elem_class_t pt_o_id_type
;
162 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
166 typedef struct pool_xtransfer
{
167 pool_resource_elem_class_t px_o_id_type
;
170 uint_t px_o_complist_size
;
171 id_t
*px_o_comp_list
;
175 typedef struct pool_xtransfer32
{
176 pool_resource_elem_class_t px_o_id_type
;
179 uint_t px_o_complist_size
;
180 caddr32_t px_o_comp_list
;
181 } pool_xtransfer32_t
;
182 #endif /* _SYSCALL32 */
184 typedef struct pool_propget
{
187 pool_elem_class_t pp_o_id_type
;
188 pool_resource_elem_class_t pp_o_id_subtype
;
190 uint_t pp_o_prop_name_size
;
191 char *pp_o_prop_name
;
195 typedef struct pool_propget32
{
196 size32_t pp_i_bufsize
;
198 pool_elem_class_t pp_o_id_type
;
199 pool_resource_elem_class_t pp_o_id_subtype
;
201 uint_t pp_o_prop_name_size
;
202 caddr32_t pp_o_prop_name
;
204 #endif /* _SYSCALL32 */
206 typedef struct pool_propgetall
{
207 size_t pp_i_proplist_size
;
208 char *pp_i_prop_list
;
209 pool_elem_class_t pp_o_id_type
;
210 pool_resource_elem_class_t pp_o_id_sub_type
;
215 typedef struct pool_propgetall32
{
216 size32_t pp_i_proplist_size
;
217 caddr32_t pp_i_prop_list
;
218 pool_elem_class_t pp_o_id_type
;
219 pool_resource_elem_class_t pp_o_id_sub_type
;
221 } pool_propgetall32_t
;
222 #endif /* _SYSCALL32 */
224 typedef struct pool_propput
{
225 pool_elem_class_t pp_o_id_type
;
226 pool_resource_elem_class_t pp_o_id_sub_type
;
233 typedef struct pool_propput32
{
234 pool_elem_class_t pp_o_id_type
;
235 pool_resource_elem_class_t pp_o_id_sub_type
;
237 size32_t pp_o_bufsize
;
240 #endif /* _SYSCALL32 */
242 typedef struct pool_proprm
{
243 pool_elem_class_t pp_o_id_type
;
244 pool_resource_elem_class_t pp_o_id_sub_type
;
246 size_t pp_o_prop_name_size
;
247 char *pp_o_prop_name
;
251 typedef struct pool_proprm32
{
252 pool_elem_class_t pp_o_id_type
;
253 pool_resource_elem_class_t pp_o_id_sub_type
;
255 size32_t pp_o_prop_name_size
;
256 caddr32_t pp_o_prop_name
;
258 #endif /* _SYSCALL32 */
260 typedef struct pool_bind
{
261 idtype_t pb_o_id_type
;
266 typedef struct pool_bindq
{
267 idtype_t pb_o_id_type
;
273 * Values for pp_type below
275 #define PP_READ 0x0001
276 #define PP_WRITE 0x0002
277 #define PP_RDWR 0x0003
278 #define PP_OPTIONAL 0x0004
279 #define PP_STORED 0x0008
280 #define PP_INIT 0x0010
281 #define PP_HIDDEN 0x0020
286 * For special properties
288 typedef struct pool_property
{
289 char *pp_name
; /* name of the property */
290 data_type_t pp_type
; /* type of the property */
291 int pp_perm
; /* permissions */
294 extern int pool_propput_common(nvlist_t
*, nvpair_t
*, pool_property_t
*);
295 extern int pool_proprm_common(nvlist_t
*, char *, pool_property_t
*);
303 #endif /* _SYS_POOL_IMPL_H */