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