xref: /illumos-gate/usr/src/uts/common/sys/pset.h (revision ba3594ba)
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
50b70c467Sakolb  * Common Development and Distribution License (the "License").
60b70c467Sakolb  * 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  */
217c478bd9Sstevel@tonic-gate /*
22*ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23*ba3594baSGarrett D'Amore  *
24fb9b0aa8SSurya Prakki  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef	_SYS_PSET_H
297c478bd9Sstevel@tonic-gate #define	_SYS_PSET_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #if !defined(_ASM)
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #include <sys/types.h>
387c478bd9Sstevel@tonic-gate #include <sys/processor.h>
397c478bd9Sstevel@tonic-gate #include <sys/procset.h>
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate typedef int psetid_t;
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /* special processor set id's */
447c478bd9Sstevel@tonic-gate #define	PS_NONE		-1
457c478bd9Sstevel@tonic-gate #define	PS_QUERY	-2
467c478bd9Sstevel@tonic-gate #define	PS_MYID		-3
470b70c467Sakolb #define	PS_SOFT		-4
480b70c467Sakolb #define	PS_HARD		-5
490b70c467Sakolb #define	PS_QUERY_TYPE	-6
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /* types of processor sets */
527c478bd9Sstevel@tonic-gate #define	PS_SYSTEM	1
537c478bd9Sstevel@tonic-gate #define	PS_PRIVATE	2
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #ifndef	_KERNEL
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate extern int	pset_create(psetid_t *);
587c478bd9Sstevel@tonic-gate extern int	pset_destroy(psetid_t);
597c478bd9Sstevel@tonic-gate extern int	pset_assign(psetid_t, processorid_t, psetid_t *);
607c478bd9Sstevel@tonic-gate extern int	pset_info(psetid_t, int *, uint_t *, processorid_t *);
617c478bd9Sstevel@tonic-gate extern int	pset_bind(psetid_t, idtype_t, id_t, psetid_t *);
62fb9b0aa8SSurya Prakki extern int	pset_bind_lwp(psetid_t, id_t, pid_t, psetid_t *);
637c478bd9Sstevel@tonic-gate extern int	pset_getloadavg(psetid_t, double [], int);
647c478bd9Sstevel@tonic-gate extern int	pset_list(psetid_t *, uint_t *);
657c478bd9Sstevel@tonic-gate extern int	pset_setattr(psetid_t, uint_t);
667c478bd9Sstevel@tonic-gate extern int	pset_getattr(psetid_t, uint_t *);
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #endif	/* ! _KERNEL */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #endif	/* !defined(_ASM) */
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /* system call subcodes */
737c478bd9Sstevel@tonic-gate #define	PSET_CREATE		0
747c478bd9Sstevel@tonic-gate #define	PSET_DESTROY		1
757c478bd9Sstevel@tonic-gate #define	PSET_ASSIGN		2
767c478bd9Sstevel@tonic-gate #define	PSET_INFO		3
777c478bd9Sstevel@tonic-gate #define	PSET_BIND		4
787c478bd9Sstevel@tonic-gate #define	PSET_GETLOADAVG		5
797c478bd9Sstevel@tonic-gate #define	PSET_LIST		6
807c478bd9Sstevel@tonic-gate #define	PSET_SETATTR		7
817c478bd9Sstevel@tonic-gate #define	PSET_GETATTR		8
827c478bd9Sstevel@tonic-gate #define	PSET_ASSIGN_FORCED	9
83fb9b0aa8SSurya Prakki #define	PSET_BIND_LWP		10
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /* attribute bits */
867c478bd9Sstevel@tonic-gate #define	PSET_NOESCAPE	0x0001
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
897c478bd9Sstevel@tonic-gate }
907c478bd9Sstevel@tonic-gate #endif
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #endif	/* _SYS_PSET_H */
93