1 /* 2 * CDDL HEADER START 3 * 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 7 * with the License. 8 * 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. 13 * 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] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_POOL_PSET_H 28 #define _SYS_POOL_PSET_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #include <sys/types.h> 33 #include <sys/cpupart.h> 34 #include <sys/procset.h> 35 #include <sys/nvpair.h> 36 #include <sys/exacct.h> 37 #include <sys/time.h> 38 #include <sys/list.h> 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 #ifdef _KERNEL 45 46 struct zone; 47 48 typedef struct pool_pset { 49 psetid_t pset_id; /* pset ID */ 50 uint_t pset_npools; /* # of pools we belong to */ 51 list_node_t pset_link; /* link to next/prev pset */ 52 nvlist_t *pset_props; /* pset properties */ 53 } pool_pset_t; 54 55 extern pool_pset_t *pool_pset_default; /* default pset */ 56 extern hrtime_t pool_pset_mod; /* pset modification time */ 57 extern hrtime_t pool_cpu_mod; /* cpu modification time */ 58 59 extern void pool_pset_init(void); 60 extern int pool_pset_enable(void); 61 extern int pool_pset_disable(void); 62 extern int pool_pset_create(psetid_t *); 63 extern int pool_pset_destroy(psetid_t); 64 extern int pool_pset_assoc(poolid_t, psetid_t); 65 extern void pool_pset_bind(proc_t *, psetid_t, void *, void *); 66 extern int pool_pset_xtransfer(id_t, id_t, size_t, id_t *); 67 extern int pool_pset_proprm(psetid_t, char *); 68 extern int pool_pset_propput(psetid_t, nvpair_t *); 69 extern int pool_pset_propget(psetid_t, char *, nvlist_t *); 70 extern int pool_cpu_proprm(processorid_t, char *); 71 extern int pool_cpu_propput(processorid_t, nvpair_t *); 72 extern int pool_cpu_propget(processorid_t, char *, nvlist_t *); 73 extern int pool_pset_pack(ea_object_t *); 74 75 extern int pset_bind_start(struct proc **, struct pool *); 76 extern void pset_bind_abort(struct proc **, struct pool *); 77 extern void pset_bind_finish(void); 78 79 extern boolean_t pool_pset_enabled(void); 80 81 extern void pool_pset_visibility_add(psetid_t, struct zone *); 82 extern void pool_pset_visibility_remove(psetid_t, struct zone *); 83 84 #endif /* _KERNEL */ 85 86 #ifdef __cplusplus 87 } 88 #endif 89 90 #endif /* _SYS_POOL_PSET_H */ 91