fx.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_FX_H
#define _SYS_FX_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Fixed-priority dispatcher parameter table entry
*/
typedef struct fxdpent {
int fx_quantum; /* time quantum given to procs at this level */
} fxdpent_t;
#ifdef _KERNEL
/*
* callbacks supplied by custom scheduler. In general, a change to quantum
*
* fx_exit - called when a thread exits. This also needs to free any storage
* for the fx_cookie_t.
*
* fx_callb_tick - called at every clock tick attributed to this thread
*
* fx_callb_preempt - called when a thread is being preempted or yielding
*
* fx_callb_stop/fx_callb_sleep - called when a thread stops running
*
* fx_callb_wakeup - called when a thread is again runnable
*/
typedef struct fx_callbacks {
int fx_callb_version;
void (*fx_callb_exit)(fx_cookie_t);
void (*fx_callb_stop)(fx_cookie_t);
void (*fx_callb_sleep)(fx_cookie_t);
#define FX_CALLB_VERSION_1 1
#define FX_CALLB_REV FX_CALLB_VERSION_1
/* priority setting */
#define FX_CB_NOCHANGE -32768
/*
* Fixed-priority class specific thread structure
*/
typedef struct fxproc {
int fx_pquantum; /* time quantum given to this proc */
int fx_timeleft; /* time remaining in procs quantum */
/* same as user priority */
char fx_nice; /* nice value for compatibility */
/* the following are used only when we have callbacks registered */
/* has a callback */
/* has a callback */
/* was registered */
} fxproc_t;
/* flags */
/*
* Kernel version of fixed-priority class specific parameter structure
*/
typedef struct fxkparms {
int fx_tqntm;
} fxkparms_t;
/*
* Interface for partner private code. This is not a public interface.
*/
extern int fx_unregister_callbacks();
extern void *fx_get_mutex_cookie();
extern pri_t fx_get_maxpri();
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FX_H */