xref: /illumos-gate/usr/src/uts/common/sys/iapriocntl.h (revision 4c28a617e3922d92a58e813a5b955eb526b9c386)
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 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 #ifndef _SYS_IAPRIOCNTL_H
31 #define	_SYS_IAPRIOCNTL_H
32 
33 #include <sys/types.h>
34 #include <sys/thread.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Interactive class specific structures for the priocntl system call.
42  */
43 
44 /*
45  * Beginning of iaparms structure must match tsparms structure so they
46  * can be used interchangeably.
47  */
48 
49 typedef struct iaparms {
50 	pri_t	ia_uprilim;		/* user priority limit */
51 	pri_t	ia_upri;		/* user priority */
52 	int	ia_mode;		/* interactive on/off */
53 } iaparms_t;
54 
55 typedef struct iaclass {
56 	id_t	pc_cid;
57 	int	pc_clparms[PC_CLPARMSZ];
58 } iaclass_t;
59 
60 typedef struct iainfo {
61 	pri_t	ia_maxupri;	/* configured limits of user priority range */
62 } iainfo_t;
63 
64 #define	IA_NOCHANGE	-32768
65 #define	IAMAXUPRI	60
66 #define	IAOFFUPRI	29
67 #define	IANPROCS	60
68 #define	IA_INTERACTIVE_OFF	0x00	/* thread is not interactive */
69 #define	IA_SET_INTERACTIVE	0x01	/* thread is interactive */
70 #define	IA_BOOST	10		/* value for boost */
71 
72 /*
73  * Interactive class specific keys for the priocntl system call
74  * varargs interface.
75  */
76 #define	IA_KY_UPRILIM	1	/* user priority limit */
77 #define	IA_KY_UPRI	2	/* user priority */
78 #define	IA_KY_MODE	3	/* interactive on/off */
79 
80 /*
81  * The following is used by the dispadmin(1M) command for
82  * scheduler administration and is not for general use.
83  */
84 
85 #ifdef _SYSCALL32
86 /* Data structure for ILP32 clients */
87 typedef struct iaadmin32 {
88 	caddr32_t	ia_dpents;
89 	int16_t		ia_ndpents;
90 	int16_t		ia_cmd;
91 } iaadmin32_t;
92 #endif /* _SYSCALL32 */
93 
94 typedef struct iaadmin {
95 	struct iadpent	*ia_dpents;
96 	short		ia_ndpents;
97 	short		ia_cmd;
98 } iaadmin_t;
99 
100 #define	IA_GETDPSIZE	1
101 #define	IA_GETDPTBL	2
102 #define	IA_SETDPTBL	3
103 
104 #ifdef	__cplusplus
105 }
106 #endif
107 
108 #endif	/* _SYS_IAPRIOCNTL_H */
109