xref: /onnv-gate/usr/src/uts/common/disp/rt_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 /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
28*0Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
29*0Sstevel@tonic-gate /*	  All Rights Reserved  	*/
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
32*0Sstevel@tonic-gate 
33*0Sstevel@tonic-gate #include <sys/proc.h>
34*0Sstevel@tonic-gate #include <sys/priocntl.h>
35*0Sstevel@tonic-gate #include <sys/class.h>
36*0Sstevel@tonic-gate #include <sys/disp.h>
37*0Sstevel@tonic-gate #include <sys/rt.h>
38*0Sstevel@tonic-gate #include <sys/rtpriocntl.h>
39*0Sstevel@tonic-gate #include <sys/modctl.h>
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate /*
42*0Sstevel@tonic-gate  * The purpose of this file is to allow a user to make their own
43*0Sstevel@tonic-gate  * rt_dptbl. The contents of this file should be included in the
44*0Sstevel@tonic-gate  * rt_dptbl(4) man page with proper instructions for making
45*0Sstevel@tonic-gate  * and replacing the RT_DPTBL.kmod in modules/sched. This was the
46*0Sstevel@tonic-gate  * only way to provide functionality equivalent to the mkboot/cunix
47*0Sstevel@tonic-gate  * method in SVr4 without having the utilities mkboot/cunix in
48*0Sstevel@tonic-gate  * SunOS/Svr4.
49*0Sstevel@tonic-gate  * It is recommended that the system calls be used to change the time
50*0Sstevel@tonic-gate  * quantums instead of re-building the module.
51*0Sstevel@tonic-gate  */
52*0Sstevel@tonic-gate 
53*0Sstevel@tonic-gate static struct modlmisc modlmisc = {
54*0Sstevel@tonic-gate 	&mod_miscops, "realtime dispatch table"
55*0Sstevel@tonic-gate };
56*0Sstevel@tonic-gate 
57*0Sstevel@tonic-gate static struct modlinkage modlinkage = {
58*0Sstevel@tonic-gate 	MODREV_1, &modlmisc, 0
59*0Sstevel@tonic-gate };
60*0Sstevel@tonic-gate 
61*0Sstevel@tonic-gate int
_init()62*0Sstevel@tonic-gate _init()
63*0Sstevel@tonic-gate {
64*0Sstevel@tonic-gate 	return (mod_install(&modlinkage));
65*0Sstevel@tonic-gate }
66*0Sstevel@tonic-gate 
67*0Sstevel@tonic-gate int
_info(struct modinfo * modinfop)68*0Sstevel@tonic-gate _info(struct modinfo *modinfop)
69*0Sstevel@tonic-gate {
70*0Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
71*0Sstevel@tonic-gate }
72*0Sstevel@tonic-gate 
73*0Sstevel@tonic-gate #define	RTGPPRIO0	100	/* Global priority for RT priority 0 */
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate rtdpent_t	config_rt_dptbl[] = {
76*0Sstevel@tonic-gate 
77*0Sstevel@tonic-gate /*   	prilevel    Time quantum */
78*0Sstevel@tonic-gate 
79*0Sstevel@tonic-gate 	RTGPPRIO0,	100,
80*0Sstevel@tonic-gate 	RTGPPRIO0+1,	100,
81*0Sstevel@tonic-gate 	RTGPPRIO0+2,	100,
82*0Sstevel@tonic-gate 	RTGPPRIO0+3,	100,
83*0Sstevel@tonic-gate 	RTGPPRIO0+4,	100,
84*0Sstevel@tonic-gate 	RTGPPRIO0+5,	100,
85*0Sstevel@tonic-gate 	RTGPPRIO0+6,	100,
86*0Sstevel@tonic-gate 	RTGPPRIO0+7,	100,
87*0Sstevel@tonic-gate 	RTGPPRIO0+8,	100,
88*0Sstevel@tonic-gate 	RTGPPRIO0+9,	100,
89*0Sstevel@tonic-gate 	RTGPPRIO0+10,	80,
90*0Sstevel@tonic-gate 	RTGPPRIO0+11,	80,
91*0Sstevel@tonic-gate 	RTGPPRIO0+12,	80,
92*0Sstevel@tonic-gate 	RTGPPRIO0+13,	80,
93*0Sstevel@tonic-gate 	RTGPPRIO0+14,	80,
94*0Sstevel@tonic-gate 	RTGPPRIO0+15,	80,
95*0Sstevel@tonic-gate 	RTGPPRIO0+16,	80,
96*0Sstevel@tonic-gate 	RTGPPRIO0+17,	80,
97*0Sstevel@tonic-gate 	RTGPPRIO0+18,	80,
98*0Sstevel@tonic-gate 	RTGPPRIO0+19,	80,
99*0Sstevel@tonic-gate 	RTGPPRIO0+20,	60,
100*0Sstevel@tonic-gate 	RTGPPRIO0+21,	60,
101*0Sstevel@tonic-gate 	RTGPPRIO0+22,	60,
102*0Sstevel@tonic-gate 	RTGPPRIO0+23,	60,
103*0Sstevel@tonic-gate 	RTGPPRIO0+24,	60,
104*0Sstevel@tonic-gate 	RTGPPRIO0+25,	60,
105*0Sstevel@tonic-gate 	RTGPPRIO0+26,	60,
106*0Sstevel@tonic-gate 	RTGPPRIO0+27,	60,
107*0Sstevel@tonic-gate 	RTGPPRIO0+28,	60,
108*0Sstevel@tonic-gate 	RTGPPRIO0+29,	60,
109*0Sstevel@tonic-gate 	RTGPPRIO0+30,	40,
110*0Sstevel@tonic-gate 	RTGPPRIO0+31,	40,
111*0Sstevel@tonic-gate 	RTGPPRIO0+32,	40,
112*0Sstevel@tonic-gate 	RTGPPRIO0+33,	40,
113*0Sstevel@tonic-gate 	RTGPPRIO0+34,	40,
114*0Sstevel@tonic-gate 	RTGPPRIO0+35,	40,
115*0Sstevel@tonic-gate 	RTGPPRIO0+36,	40,
116*0Sstevel@tonic-gate 	RTGPPRIO0+37,	40,
117*0Sstevel@tonic-gate 	RTGPPRIO0+38,	40,
118*0Sstevel@tonic-gate 	RTGPPRIO0+39,	40,
119*0Sstevel@tonic-gate 	RTGPPRIO0+40,	20,
120*0Sstevel@tonic-gate 	RTGPPRIO0+41,	20,
121*0Sstevel@tonic-gate 	RTGPPRIO0+42,	20,
122*0Sstevel@tonic-gate 	RTGPPRIO0+43,	20,
123*0Sstevel@tonic-gate 	RTGPPRIO0+44,	20,
124*0Sstevel@tonic-gate 	RTGPPRIO0+45,	20,
125*0Sstevel@tonic-gate 	RTGPPRIO0+46,	20,
126*0Sstevel@tonic-gate 	RTGPPRIO0+47,	20,
127*0Sstevel@tonic-gate 	RTGPPRIO0+48,	20,
128*0Sstevel@tonic-gate 	RTGPPRIO0+49,	20,
129*0Sstevel@tonic-gate 	RTGPPRIO0+50,	10,
130*0Sstevel@tonic-gate 	RTGPPRIO0+51,	10,
131*0Sstevel@tonic-gate 	RTGPPRIO0+52,	10,
132*0Sstevel@tonic-gate 	RTGPPRIO0+53,	10,
133*0Sstevel@tonic-gate 	RTGPPRIO0+54,	10,
134*0Sstevel@tonic-gate 	RTGPPRIO0+55,	10,
135*0Sstevel@tonic-gate 	RTGPPRIO0+56,	10,
136*0Sstevel@tonic-gate 	RTGPPRIO0+57,	10,
137*0Sstevel@tonic-gate 	RTGPPRIO0+58,	10,
138*0Sstevel@tonic-gate 	RTGPPRIO0+59,	10
139*0Sstevel@tonic-gate };
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate /*
142*0Sstevel@tonic-gate  * Return the address of config_rt_dptbl
143*0Sstevel@tonic-gate  */
144*0Sstevel@tonic-gate rtdpent_t *
rt_getdptbl()145*0Sstevel@tonic-gate rt_getdptbl()
146*0Sstevel@tonic-gate {
147*0Sstevel@tonic-gate 	return (config_rt_dptbl);
148*0Sstevel@tonic-gate }
149