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