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.
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.
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]
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
32 #ifndef _SYS_PRIOCNTL_H
33 #define _SYS_PRIOCNTL_H
35 #include <sys/types.h>
36 #include <sys/procset.h>
42 #define PC_VERSION 1 /* First version of priocntl */
44 extern long priocntl(idtype_t
, id_t
, int, ...);
45 extern long priocntlset(procset_t
*, int, ...);
48 * The following are the possible values of the command
49 * argument for the priocntl system call.
52 #define PC_GETCID 0 /* Get class ID */
53 #define PC_GETCLINFO 1 /* Get info about a configured class */
54 #define PC_SETPARMS 2 /* Set scheduling parameters */
55 #define PC_GETPARMS 3 /* Get scheduling parameters */
56 #define PC_ADMIN 4 /* Scheduler administration (used by */
57 /* dispadmin(1M), not for general use) */
58 #define PC_GETPRIRANGE 5 /* Get priority range for a class */
59 /* posix.4 scheduling, not for general use */
60 #define PC_DONICE 6 /* Set or get nice value */
61 #define PC_SETXPARMS 7 /* Set extended scheduling parameters */
62 #define PC_GETXPARMS 8 /* Get extended scheduling parameters */
63 #define PC_SETDFLCL 9 /* Set default class, not for general use */
64 #define PC_GETDFLCL 10 /* Get default class, not for general use */
65 #define PC_DOPRIO 11 /* Set or get priority, not for general use */
70 #define PC_CLINFOSZ (32 / sizeof (int))
71 #define PC_CLPARMSZ (32 / sizeof (int))
79 typedef struct pcinfo
{
80 id_t pc_cid
; /* class id */
81 char pc_clname
[PC_CLNMSZ
]; /* class name */
82 int pc_clinfo
[PC_CLINFOSZ
]; /* class information */
85 typedef struct pcparms
{
86 id_t pc_cid
; /* process class */
87 int pc_clparms
[PC_CLPARMSZ
]; /* class specific parameters */
90 typedef struct pcnice
{
91 int pc_val
; /* nice value */
92 int pc_op
; /* type of operation, set or get */
95 typedef struct pcprio
{
96 int pc_op
; /* type of operation, set or get */
97 id_t pc_cid
; /* class id */
98 int pc_val
; /* priority value */
102 * The following is used by the priocntl(2) varargs interface (command
103 * codes: PC_SETXPARMS and PC_GETXPARMS).
106 #define PC_VAPARMCNT 8 /* maximal number of (key, value) pairs */
107 #define PC_KY_NULL 0 /* terminates the (key, value) pair chain */
108 #define PC_KY_CLNAME 1 /* get the class name of a process or LWP. */
110 typedef struct pc_vaparm
{
111 int pc_key
; /* describing key */
112 u_longlong_t pc_parm
; /* associated parameter */
115 typedef struct pc_vaparms
{
116 uint_t pc_vaparmscnt
; /* # of (key, value) pairs */
117 pc_vaparm_t pc_parms
[PC_VAPARMCNT
]; /* parameter buffer */
120 #if defined(_SYSCALL32) && \
121 _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
124 * These structures are needed by the 64-bit kernel on certain architectures
125 * to translate pc_vaparms_t/pc_vaparm_t data structures from 32-bit userland.
130 int32_t pc_key
; /* describing key */
131 uint64_t pc_parm
; /* associated parameter */
137 uint32_t pc_vaparmscnt
; /* # of (key, value) pairs */
138 pc_vaparm32_t pc_parms
[PC_VAPARMCNT
]; /* parameter buffer */
141 #endif /* _SYSCALL32 && ... */
144 * The following is used by libc for posix.4
145 * scheduler interfaces and is not for general use.
148 typedef struct pcpri
{
149 id_t pc_cid
; /* process class */
150 pri_t pc_clpmax
; /* class priority max */
151 pri_t pc_clpmin
; /* class priority min */
155 * The following is used by the dispadmin(1M) command for
156 * scheduler administration and is not for general use.
160 /* Data structure for ILP32 clients */
161 typedef struct pcadmin32
{
163 caddr32_t pc_cladmin
;
165 #endif /* _SYSCALL32 */
167 typedef struct pcadmin
{
176 #endif /* _SYS_PRIOCNTL_H */