xref: /titanic_41/usr/src/uts/common/disp/fx_dptbl.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include <sys/proc.h>
30 #include <sys/priocntl.h>
31 #include <sys/class.h>
32 #include <sys/disp.h>
33 #include <sys/fx.h>
34 #include <sys/fxpriocntl.h>
35 #include <sys/modctl.h>
36 
37 /*
38  * The purpose of this file is to allow a user to make their own
39  * fx_dptbl. The contents of this file should be included in the
40  * fx_dptbl(4) man page with proper instructions for making
41  * and replacing the FX_DPTBL in usr/kernel/sched.
42  * It is recommended that the system calls be used to change the time
43  * quantums instead of re-building the module.
44  */
45 
46 static struct modlmisc modlmisc = {
47 	&mod_miscops, "Fixed priority dispatch table"
48 };
49 
50 static struct modlinkage modlinkage = {
51 	MODREV_1, &modlmisc, 0
52 };
53 
54 int
_init()55 _init()
56 {
57 	return (mod_install(&modlinkage));
58 }
59 
60 int
_info(struct modinfo * modinfop)61 _info(struct modinfo *modinfop)
62 {
63 	return (mod_info(&modlinkage, modinfop));
64 }
65 
66 #define	FXGPUP0	0	/* Global priority for FX user priority 0 */
67 
68 
69 
70 fxdpent_t	config_fx_dptbl[] = {
71 
72 /*	glbpri		qntm */
73 
74 	FXGPUP0+0,	20,
75 	FXGPUP0+1,	20,
76 	FXGPUP0+2,	20,
77 	FXGPUP0+3,	20,
78 	FXGPUP0+4,	20,
79 	FXGPUP0+5,	20,
80 	FXGPUP0+6,	20,
81 	FXGPUP0+7,	20,
82 	FXGPUP0+8,	20,
83 	FXGPUP0+9,	20,
84 	FXGPUP0+10,	16,
85 	FXGPUP0+11,	16,
86 	FXGPUP0+12,	16,
87 	FXGPUP0+13,	16,
88 	FXGPUP0+14,	16,
89 	FXGPUP0+15,	16,
90 	FXGPUP0+16,	16,
91 	FXGPUP0+17,	16,
92 	FXGPUP0+18,	16,
93 	FXGPUP0+19,	16,
94 	FXGPUP0+20,	12,
95 	FXGPUP0+21,	12,
96 	FXGPUP0+22,	12,
97 	FXGPUP0+23,	12,
98 	FXGPUP0+24,	12,
99 	FXGPUP0+25,	12,
100 	FXGPUP0+26,	12,
101 	FXGPUP0+27,	12,
102 	FXGPUP0+28,	12,
103 	FXGPUP0+29,	12,
104 	FXGPUP0+30,	 8,
105 	FXGPUP0+31,	 8,
106 	FXGPUP0+32,	 8,
107 	FXGPUP0+33,	 8,
108 	FXGPUP0+34,	 8,
109 	FXGPUP0+35,	 8,
110 	FXGPUP0+36,	 8,
111 	FXGPUP0+37,	 8,
112 	FXGPUP0+38,	 8,
113 	FXGPUP0+39,	 8,
114 	FXGPUP0+40,	 4,
115 	FXGPUP0+41,	 4,
116 	FXGPUP0+42,	 4,
117 	FXGPUP0+43,	 4,
118 	FXGPUP0+44,	 4,
119 	FXGPUP0+45,	 4,
120 	FXGPUP0+46,	 4,
121 	FXGPUP0+47,	 4,
122 	FXGPUP0+48,	 4,
123 	FXGPUP0+49,	 4,
124 	FXGPUP0+50,	 4,
125 	FXGPUP0+51,	 4,
126 	FXGPUP0+52,	 4,
127 	FXGPUP0+53,	 4,
128 	FXGPUP0+54,	 4,
129 	FXGPUP0+55,	 4,
130 	FXGPUP0+56,	 4,
131 	FXGPUP0+57,	 4,
132 	FXGPUP0+58,	 4,
133 	FXGPUP0+59,	 2,
134 	FXGPUP0+60,	 2,
135 };
136 
137 pri_t config_fx_maxumdpri = sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1;
138 
139 /*
140  * Return the address of config_fx_dptbl
141  */
142 fxdpent_t *
fx_getdptbl()143 fx_getdptbl()
144 {
145 	return (config_fx_dptbl);
146 }
147 
148 
149 /*
150  * Return the address of fx_maxumdpri
151  */
152 pri_t
fx_getmaxumdpri()153 fx_getmaxumdpri()
154 {
155 	/*
156 	 * the config_fx_dptbl table.
157 	 */
158 	return (config_fx_maxumdpri);
159 }
160