17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5f841f6adSraf * Common Development and Distribution License (the "License"). 6f841f6adSraf * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21f841f6adSraf 227c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 237c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 247c478bd9Sstevel@tonic-gate 257c478bd9Sstevel@tonic-gate /* 26f841f6adSraf * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 277c478bd9Sstevel@tonic-gate * Use is subject to license terms. 287c478bd9Sstevel@tonic-gate */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _SYS_PRIOCNTL_H 317c478bd9Sstevel@tonic-gate #define _SYS_PRIOCNTL_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* from SVR4 1.6 */ 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #include <sys/types.h> 367c478bd9Sstevel@tonic-gate #include <sys/procset.h> 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate #ifdef __cplusplus 397c478bd9Sstevel@tonic-gate extern "C" { 407c478bd9Sstevel@tonic-gate #endif 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #define PC_VERSION 1 /* First version of priocntl */ 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #ifdef __STDC__ 457c478bd9Sstevel@tonic-gate extern long priocntl(idtype_t, id_t, int, ...); 467c478bd9Sstevel@tonic-gate extern long priocntlset(procset_t *, int, ...); 477c478bd9Sstevel@tonic-gate #else 487c478bd9Sstevel@tonic-gate extern long priocntl(), priocntlset(); 497c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate /* 527c478bd9Sstevel@tonic-gate * The following are the possible values of the command 537c478bd9Sstevel@tonic-gate * argument for the priocntl system call. 547c478bd9Sstevel@tonic-gate */ 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate #define PC_GETCID 0 /* Get class ID */ 577c478bd9Sstevel@tonic-gate #define PC_GETCLINFO 1 /* Get info about a configured class */ 587c478bd9Sstevel@tonic-gate #define PC_SETPARMS 2 /* Set scheduling parameters */ 597c478bd9Sstevel@tonic-gate #define PC_GETPARMS 3 /* Get scheduling parameters */ 607c478bd9Sstevel@tonic-gate #define PC_ADMIN 4 /* Scheduler administration (used by */ 617c478bd9Sstevel@tonic-gate /* dispadmin(1M), not for general use) */ 627c478bd9Sstevel@tonic-gate #define PC_GETPRIRANGE 5 /* Get global priority range for a class */ 637c478bd9Sstevel@tonic-gate /* posix.4 scheduling, not for general use */ 647c478bd9Sstevel@tonic-gate #define PC_DONICE 6 /* Set or get nice value */ 657c478bd9Sstevel@tonic-gate #define PC_SETXPARMS 7 /* Set extended scheduling parameters */ 667c478bd9Sstevel@tonic-gate #define PC_GETXPARMS 8 /* Get extended scheduling parameters */ 677c478bd9Sstevel@tonic-gate #define PC_SETDFLCL 9 /* Set default class, not for general use */ 68*0209230bSgjelinek #define PC_GETDFLCL 10 /* Get default class, not for general use */ 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate #define PC_CLNULL -1 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate #define PC_CLNMSZ 16 737c478bd9Sstevel@tonic-gate #define PC_CLINFOSZ (32 / sizeof (int)) 747c478bd9Sstevel@tonic-gate #define PC_CLPARMSZ (32 / sizeof (int)) 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #define PC_GETNICE 0 777c478bd9Sstevel@tonic-gate #define PC_SETNICE 1 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate typedef struct pcinfo { 807c478bd9Sstevel@tonic-gate id_t pc_cid; /* class id */ 817c478bd9Sstevel@tonic-gate char pc_clname[PC_CLNMSZ]; /* class name */ 827c478bd9Sstevel@tonic-gate int pc_clinfo[PC_CLINFOSZ]; /* class information */ 837c478bd9Sstevel@tonic-gate } pcinfo_t; 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate typedef struct pcparms { 867c478bd9Sstevel@tonic-gate id_t pc_cid; /* process class */ 877c478bd9Sstevel@tonic-gate int pc_clparms[PC_CLPARMSZ]; /* class specific parameters */ 887c478bd9Sstevel@tonic-gate } pcparms_t; 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate typedef struct pcnice { 917c478bd9Sstevel@tonic-gate int pc_val; /* nice value */ 927c478bd9Sstevel@tonic-gate int pc_op; /* type of operation, set or get */ 937c478bd9Sstevel@tonic-gate } pcnice_t; 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate /* 967c478bd9Sstevel@tonic-gate * The following is used by the priocntl(2) varargs interface (command 977c478bd9Sstevel@tonic-gate * codes: PC_SETXPARMS and PC_GETXPARMS). 987c478bd9Sstevel@tonic-gate */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #define PC_VAPARMCNT 8 /* maximal number of (key, value) pairs */ 1017c478bd9Sstevel@tonic-gate #define PC_KY_NULL 0 /* terminates the (key, value) pair chain */ 1027c478bd9Sstevel@tonic-gate #define PC_KY_CLNAME 1 /* get the class name of a process or LWP. */ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate typedef struct pc_vaparm { 1057c478bd9Sstevel@tonic-gate int pc_key; /* describing key */ 1067c478bd9Sstevel@tonic-gate u_longlong_t pc_parm; /* associated parameter */ 1077c478bd9Sstevel@tonic-gate } pc_vaparm_t; 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate typedef struct pc_vaparms { 1107c478bd9Sstevel@tonic-gate uint_t pc_vaparmscnt; /* # of (key, value) pairs */ 1117c478bd9Sstevel@tonic-gate pc_vaparm_t pc_parms[PC_VAPARMCNT]; /* parameter buffer */ 1127c478bd9Sstevel@tonic-gate } pc_vaparms_t; 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32) && \ 1157c478bd9Sstevel@tonic-gate _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate /* 1187c478bd9Sstevel@tonic-gate * These structures are needed by the 64-bit kernel on certain architectures 1197c478bd9Sstevel@tonic-gate * to translate pc_vaparms_t/pc_vaparm_t data structures from 32-bit userland. 1207c478bd9Sstevel@tonic-gate */ 1217c478bd9Sstevel@tonic-gate #pragma pack(4) 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate typedef struct { 1247c478bd9Sstevel@tonic-gate int32_t pc_key; /* describing key */ 1257c478bd9Sstevel@tonic-gate uint64_t pc_parm; /* associated parameter */ 1267c478bd9Sstevel@tonic-gate } pc_vaparm32_t; 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate #pragma pack() 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate typedef struct { 1317c478bd9Sstevel@tonic-gate uint32_t pc_vaparmscnt; /* # of (key, value) pairs */ 1327c478bd9Sstevel@tonic-gate pc_vaparm32_t pc_parms[PC_VAPARMCNT]; /* parameter buffer */ 1337c478bd9Sstevel@tonic-gate } pc_vaparms32_t; 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 && ... */ 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate /* 138f841f6adSraf * The following is used by libc for posix.4 139f841f6adSraf * scheduler interfaces and is not for general use. 1407c478bd9Sstevel@tonic-gate */ 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gate typedef struct pcpri { 1437c478bd9Sstevel@tonic-gate id_t pc_cid; /* process class */ 1447c478bd9Sstevel@tonic-gate pri_t pc_clpmax; /* class global priority max */ 1457c478bd9Sstevel@tonic-gate pri_t pc_clpmin; /* class global priority min */ 1467c478bd9Sstevel@tonic-gate } pcpri_t; 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gate /* 1497c478bd9Sstevel@tonic-gate * The following is used by the dispadmin(1M) command for 1507c478bd9Sstevel@tonic-gate * scheduler administration and is not for general use. 1517c478bd9Sstevel@tonic-gate */ 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32 1547c478bd9Sstevel@tonic-gate /* Data structure for ILP32 clients */ 1557c478bd9Sstevel@tonic-gate typedef struct pcadmin32 { 1567c478bd9Sstevel@tonic-gate id32_t pc_cid; 1577c478bd9Sstevel@tonic-gate caddr32_t pc_cladmin; 1587c478bd9Sstevel@tonic-gate } pcadmin32_t; 1597c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gate typedef struct pcadmin { 1627c478bd9Sstevel@tonic-gate id_t pc_cid; 1637c478bd9Sstevel@tonic-gate caddr_t pc_cladmin; 1647c478bd9Sstevel@tonic-gate } pcadmin_t; 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1677c478bd9Sstevel@tonic-gate } 1687c478bd9Sstevel@tonic-gate #endif 1697c478bd9Sstevel@tonic-gate 1707c478bd9Sstevel@tonic-gate #endif /* _SYS_PRIOCNTL_H */ 171