xref: /illumos-gate/usr/src/uts/common/sys/pset.h (revision 7ab4e62e3b5c454f248a38bec0d489e8f5543324)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_PSET_H
27 #define	_SYS_PSET_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #if !defined(_ASM)
34 
35 #include <sys/types.h>
36 #include <sys/processor.h>
37 #include <sys/procset.h>
38 
39 typedef int psetid_t;
40 
41 /* special processor set id's */
42 #define	PS_NONE		-1
43 #define	PS_QUERY	-2
44 #define	PS_MYID		-3
45 #define	PS_SOFT		-4
46 #define	PS_HARD		-5
47 #define	PS_QUERY_TYPE	-6
48 
49 /* types of processor sets */
50 #define	PS_SYSTEM	1
51 #define	PS_PRIVATE	2
52 
53 #ifndef	_KERNEL
54 #ifdef	__STDC__
55 
56 extern int	pset_create(psetid_t *);
57 extern int	pset_destroy(psetid_t);
58 extern int	pset_assign(psetid_t, processorid_t, psetid_t *);
59 extern int	pset_info(psetid_t, int *, uint_t *, processorid_t *);
60 extern int	pset_bind(psetid_t, idtype_t, id_t, psetid_t *);
61 extern int	pset_bind_lwp(psetid_t, id_t, pid_t, psetid_t *);
62 extern int	pset_getloadavg(psetid_t, double [], int);
63 extern int	pset_list(psetid_t *, uint_t *);
64 extern int	pset_setattr(psetid_t, uint_t);
65 extern int	pset_getattr(psetid_t, uint_t *);
66 
67 #else
68 
69 extern int	pset_create();
70 extern int	pset_destroy();
71 extern int	pset_assign();
72 extern int	pset_info();
73 extern int	pset_bind();
74 extern int	pset_bind_lwp();
75 extern int	pset_getloadavg();
76 extern int	pset_list();
77 extern int	pset_setattr();
78 extern int	pset_getattr();
79 
80 #endif	/* __STDC__ */
81 #endif	/* ! _KERNEL */
82 
83 #endif	/* !defined(_ASM) */
84 
85 /* system call subcodes */
86 #define	PSET_CREATE		0
87 #define	PSET_DESTROY		1
88 #define	PSET_ASSIGN		2
89 #define	PSET_INFO		3
90 #define	PSET_BIND		4
91 #define	PSET_GETLOADAVG		5
92 #define	PSET_LIST		6
93 #define	PSET_SETATTR		7
94 #define	PSET_GETATTR		8
95 #define	PSET_ASSIGN_FORCED	9
96 #define	PSET_BIND_LWP		10
97 
98 /* attribute bits */
99 #define	PSET_NOESCAPE	0x0001
100 
101 #ifdef	__cplusplus
102 }
103 #endif
104 
105 #endif	/* _SYS_PSET_H */
106