/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _SYS_CLASS_H
#define _SYS_CLASS_H
#include <sys/priocntl.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* NOTE: Developers making use of the scheduler class switch mechanism
* to develop scheduling class modules should be aware that the
* architecture is not frozen and the kernel interface for scheduling
* class modules may change in future releases of System V. Support
* for the current interface is not guaranteed and class modules
* developed to this interface may require changes in order to work
* with future releases of the system.
*/
/*
* three different ops vectors are bundled together, here.
* one is for each of the fundamental objects acted upon
* by these operators: procs, threads, and the class manager itself.
*/
typedef struct class_ops {
int (*cl_getclinfo)(void *);
int (*cl_parmsin)(void *);
int (*cl_alloc)(void **, int);
void (*cl_free)(void *);
} class_ops_t;
typedef struct thread_ops {
void (*cl_exitclass)(void *);
} thread_ops_t;
typedef struct classfuncs {
} classfuncs_t;
typedef struct sclass {
/* class specific initialization function */
} sclass_t;
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
extern int nclass; /* number of configured scheduling classes */
extern char *defaultclass; /* default class for newproc'd processes */
extern int loaded_classes; /* number of classes loaded */
extern pri_t minclsyspri;
extern int scheduler_load(char *, sclass_t *);
extern int getcidbyname(char *, id_t *);
#endif
#define CL_SET_PROCESS_GROUP(t, s, b, f) \
(*(t)->t_clfuncs->cl_set_process_group)(s, b, f)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CLASS_H */