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