xref: /onnv-gate/usr/src/uts/common/disp/fx_dptbl.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate #include <sys/proc.h>
30*0Sstevel@tonic-gate #include <sys/priocntl.h>
31*0Sstevel@tonic-gate #include <sys/class.h>
32*0Sstevel@tonic-gate #include <sys/disp.h>
33*0Sstevel@tonic-gate #include <sys/fx.h>
34*0Sstevel@tonic-gate #include <sys/fxpriocntl.h>
35*0Sstevel@tonic-gate #include <sys/modctl.h>
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate /*
38*0Sstevel@tonic-gate  * The purpose of this file is to allow a user to make their own
39*0Sstevel@tonic-gate  * fx_dptbl. The contents of this file should be included in the
40*0Sstevel@tonic-gate  * fx_dptbl(4) man page with proper instructions for making
41*0Sstevel@tonic-gate  * and replacing the FX_DPTBL in usr/kernel/sched.
42*0Sstevel@tonic-gate  * It is recommended that the system calls be used to change the time
43*0Sstevel@tonic-gate  * quantums instead of re-building the module.
44*0Sstevel@tonic-gate  */
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate static struct modlmisc modlmisc = {
47*0Sstevel@tonic-gate 	&mod_miscops, "Fixed priority dispatch table"
48*0Sstevel@tonic-gate };
49*0Sstevel@tonic-gate 
50*0Sstevel@tonic-gate static struct modlinkage modlinkage = {
51*0Sstevel@tonic-gate 	MODREV_1, &modlmisc, 0
52*0Sstevel@tonic-gate };
53*0Sstevel@tonic-gate 
54*0Sstevel@tonic-gate int
_init()55*0Sstevel@tonic-gate _init()
56*0Sstevel@tonic-gate {
57*0Sstevel@tonic-gate 	return (mod_install(&modlinkage));
58*0Sstevel@tonic-gate }
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate int
_info(struct modinfo * modinfop)61*0Sstevel@tonic-gate _info(struct modinfo *modinfop)
62*0Sstevel@tonic-gate {
63*0Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
64*0Sstevel@tonic-gate }
65*0Sstevel@tonic-gate 
66*0Sstevel@tonic-gate #define	FXGPUP0	0	/* Global priority for FX user priority 0 */
67*0Sstevel@tonic-gate 
68*0Sstevel@tonic-gate 
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate fxdpent_t	config_fx_dptbl[] = {
71*0Sstevel@tonic-gate 
72*0Sstevel@tonic-gate /*	glbpri		qntm */
73*0Sstevel@tonic-gate 
74*0Sstevel@tonic-gate 	FXGPUP0+0,	20,
75*0Sstevel@tonic-gate 	FXGPUP0+1,	20,
76*0Sstevel@tonic-gate 	FXGPUP0+2,	20,
77*0Sstevel@tonic-gate 	FXGPUP0+3,	20,
78*0Sstevel@tonic-gate 	FXGPUP0+4,	20,
79*0Sstevel@tonic-gate 	FXGPUP0+5,	20,
80*0Sstevel@tonic-gate 	FXGPUP0+6,	20,
81*0Sstevel@tonic-gate 	FXGPUP0+7,	20,
82*0Sstevel@tonic-gate 	FXGPUP0+8,	20,
83*0Sstevel@tonic-gate 	FXGPUP0+9,	20,
84*0Sstevel@tonic-gate 	FXGPUP0+10,	16,
85*0Sstevel@tonic-gate 	FXGPUP0+11,	16,
86*0Sstevel@tonic-gate 	FXGPUP0+12,	16,
87*0Sstevel@tonic-gate 	FXGPUP0+13,	16,
88*0Sstevel@tonic-gate 	FXGPUP0+14,	16,
89*0Sstevel@tonic-gate 	FXGPUP0+15,	16,
90*0Sstevel@tonic-gate 	FXGPUP0+16,	16,
91*0Sstevel@tonic-gate 	FXGPUP0+17,	16,
92*0Sstevel@tonic-gate 	FXGPUP0+18,	16,
93*0Sstevel@tonic-gate 	FXGPUP0+19,	16,
94*0Sstevel@tonic-gate 	FXGPUP0+20,	12,
95*0Sstevel@tonic-gate 	FXGPUP0+21,	12,
96*0Sstevel@tonic-gate 	FXGPUP0+22,	12,
97*0Sstevel@tonic-gate 	FXGPUP0+23,	12,
98*0Sstevel@tonic-gate 	FXGPUP0+24,	12,
99*0Sstevel@tonic-gate 	FXGPUP0+25,	12,
100*0Sstevel@tonic-gate 	FXGPUP0+26,	12,
101*0Sstevel@tonic-gate 	FXGPUP0+27,	12,
102*0Sstevel@tonic-gate 	FXGPUP0+28,	12,
103*0Sstevel@tonic-gate 	FXGPUP0+29,	12,
104*0Sstevel@tonic-gate 	FXGPUP0+30,	 8,
105*0Sstevel@tonic-gate 	FXGPUP0+31,	 8,
106*0Sstevel@tonic-gate 	FXGPUP0+32,	 8,
107*0Sstevel@tonic-gate 	FXGPUP0+33,	 8,
108*0Sstevel@tonic-gate 	FXGPUP0+34,	 8,
109*0Sstevel@tonic-gate 	FXGPUP0+35,	 8,
110*0Sstevel@tonic-gate 	FXGPUP0+36,	 8,
111*0Sstevel@tonic-gate 	FXGPUP0+37,	 8,
112*0Sstevel@tonic-gate 	FXGPUP0+38,	 8,
113*0Sstevel@tonic-gate 	FXGPUP0+39,	 8,
114*0Sstevel@tonic-gate 	FXGPUP0+40,	 4,
115*0Sstevel@tonic-gate 	FXGPUP0+41,	 4,
116*0Sstevel@tonic-gate 	FXGPUP0+42,	 4,
117*0Sstevel@tonic-gate 	FXGPUP0+43,	 4,
118*0Sstevel@tonic-gate 	FXGPUP0+44,	 4,
119*0Sstevel@tonic-gate 	FXGPUP0+45,	 4,
120*0Sstevel@tonic-gate 	FXGPUP0+46,	 4,
121*0Sstevel@tonic-gate 	FXGPUP0+47,	 4,
122*0Sstevel@tonic-gate 	FXGPUP0+48,	 4,
123*0Sstevel@tonic-gate 	FXGPUP0+49,	 4,
124*0Sstevel@tonic-gate 	FXGPUP0+50,	 4,
125*0Sstevel@tonic-gate 	FXGPUP0+51,	 4,
126*0Sstevel@tonic-gate 	FXGPUP0+52,	 4,
127*0Sstevel@tonic-gate 	FXGPUP0+53,	 4,
128*0Sstevel@tonic-gate 	FXGPUP0+54,	 4,
129*0Sstevel@tonic-gate 	FXGPUP0+55,	 4,
130*0Sstevel@tonic-gate 	FXGPUP0+56,	 4,
131*0Sstevel@tonic-gate 	FXGPUP0+57,	 4,
132*0Sstevel@tonic-gate 	FXGPUP0+58,	 4,
133*0Sstevel@tonic-gate 	FXGPUP0+59,	 2,
134*0Sstevel@tonic-gate 	FXGPUP0+60,	 2,
135*0Sstevel@tonic-gate };
136*0Sstevel@tonic-gate 
137*0Sstevel@tonic-gate pri_t config_fx_maxumdpri = sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1;
138*0Sstevel@tonic-gate 
139*0Sstevel@tonic-gate /*
140*0Sstevel@tonic-gate  * Return the address of config_fx_dptbl
141*0Sstevel@tonic-gate  */
142*0Sstevel@tonic-gate fxdpent_t *
fx_getdptbl()143*0Sstevel@tonic-gate fx_getdptbl()
144*0Sstevel@tonic-gate {
145*0Sstevel@tonic-gate 	return (config_fx_dptbl);
146*0Sstevel@tonic-gate }
147*0Sstevel@tonic-gate 
148*0Sstevel@tonic-gate 
149*0Sstevel@tonic-gate /*
150*0Sstevel@tonic-gate  * Return the address of fx_maxumdpri
151*0Sstevel@tonic-gate  */
152*0Sstevel@tonic-gate pri_t
fx_getmaxumdpri()153*0Sstevel@tonic-gate fx_getmaxumdpri()
154*0Sstevel@tonic-gate {
155*0Sstevel@tonic-gate 	/*
156*0Sstevel@tonic-gate 	 * the config_fx_dptbl table.
157*0Sstevel@tonic-gate 	 */
158*0Sstevel@tonic-gate 	return (config_fx_maxumdpri);
159*0Sstevel@tonic-gate }
160