xref: /illumos-gate/usr/src/uts/common/disp/fx_dptbl.c (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #include <sys/proc.h>
287c478bd9Sstevel@tonic-gate #include <sys/priocntl.h>
297c478bd9Sstevel@tonic-gate #include <sys/class.h>
307c478bd9Sstevel@tonic-gate #include <sys/disp.h>
317c478bd9Sstevel@tonic-gate #include <sys/fx.h>
327c478bd9Sstevel@tonic-gate #include <sys/fxpriocntl.h>
337c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * The purpose of this file is to allow a user to make their own
377c478bd9Sstevel@tonic-gate  * fx_dptbl. The contents of this file should be included in the
38*bbf21555SRichard Lowe  * fx_dptbl(5) man page with proper instructions for making
397c478bd9Sstevel@tonic-gate  * and replacing the FX_DPTBL in usr/kernel/sched.
407c478bd9Sstevel@tonic-gate  * It is recommended that the system calls be used to change the time
417c478bd9Sstevel@tonic-gate  * quantums instead of re-building the module.
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate static struct modlmisc modlmisc = {
457c478bd9Sstevel@tonic-gate 	&mod_miscops, "Fixed priority dispatch table"
467c478bd9Sstevel@tonic-gate };
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate static struct modlinkage modlinkage = {
497c478bd9Sstevel@tonic-gate 	MODREV_1, &modlmisc, 0
507c478bd9Sstevel@tonic-gate };
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate int
_init()537c478bd9Sstevel@tonic-gate _init()
547c478bd9Sstevel@tonic-gate {
557c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
567c478bd9Sstevel@tonic-gate }
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate int
_info(struct modinfo * modinfop)597c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
607c478bd9Sstevel@tonic-gate {
617c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
627c478bd9Sstevel@tonic-gate }
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate #define	FXGPUP0	0	/* Global priority for FX user priority 0 */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate fxdpent_t	config_fx_dptbl[] = {
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*	glbpri		qntm */
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate 	FXGPUP0+0,	20,
737c478bd9Sstevel@tonic-gate 	FXGPUP0+1,	20,
747c478bd9Sstevel@tonic-gate 	FXGPUP0+2,	20,
757c478bd9Sstevel@tonic-gate 	FXGPUP0+3,	20,
767c478bd9Sstevel@tonic-gate 	FXGPUP0+4,	20,
777c478bd9Sstevel@tonic-gate 	FXGPUP0+5,	20,
787c478bd9Sstevel@tonic-gate 	FXGPUP0+6,	20,
797c478bd9Sstevel@tonic-gate 	FXGPUP0+7,	20,
807c478bd9Sstevel@tonic-gate 	FXGPUP0+8,	20,
817c478bd9Sstevel@tonic-gate 	FXGPUP0+9,	20,
827c478bd9Sstevel@tonic-gate 	FXGPUP0+10,	16,
837c478bd9Sstevel@tonic-gate 	FXGPUP0+11,	16,
847c478bd9Sstevel@tonic-gate 	FXGPUP0+12,	16,
857c478bd9Sstevel@tonic-gate 	FXGPUP0+13,	16,
867c478bd9Sstevel@tonic-gate 	FXGPUP0+14,	16,
877c478bd9Sstevel@tonic-gate 	FXGPUP0+15,	16,
887c478bd9Sstevel@tonic-gate 	FXGPUP0+16,	16,
897c478bd9Sstevel@tonic-gate 	FXGPUP0+17,	16,
907c478bd9Sstevel@tonic-gate 	FXGPUP0+18,	16,
917c478bd9Sstevel@tonic-gate 	FXGPUP0+19,	16,
927c478bd9Sstevel@tonic-gate 	FXGPUP0+20,	12,
937c478bd9Sstevel@tonic-gate 	FXGPUP0+21,	12,
947c478bd9Sstevel@tonic-gate 	FXGPUP0+22,	12,
957c478bd9Sstevel@tonic-gate 	FXGPUP0+23,	12,
967c478bd9Sstevel@tonic-gate 	FXGPUP0+24,	12,
977c478bd9Sstevel@tonic-gate 	FXGPUP0+25,	12,
987c478bd9Sstevel@tonic-gate 	FXGPUP0+26,	12,
997c478bd9Sstevel@tonic-gate 	FXGPUP0+27,	12,
1007c478bd9Sstevel@tonic-gate 	FXGPUP0+28,	12,
1017c478bd9Sstevel@tonic-gate 	FXGPUP0+29,	12,
1027c478bd9Sstevel@tonic-gate 	FXGPUP0+30,	 8,
1037c478bd9Sstevel@tonic-gate 	FXGPUP0+31,	 8,
1047c478bd9Sstevel@tonic-gate 	FXGPUP0+32,	 8,
1057c478bd9Sstevel@tonic-gate 	FXGPUP0+33,	 8,
1067c478bd9Sstevel@tonic-gate 	FXGPUP0+34,	 8,
1077c478bd9Sstevel@tonic-gate 	FXGPUP0+35,	 8,
1087c478bd9Sstevel@tonic-gate 	FXGPUP0+36,	 8,
1097c478bd9Sstevel@tonic-gate 	FXGPUP0+37,	 8,
1107c478bd9Sstevel@tonic-gate 	FXGPUP0+38,	 8,
1117c478bd9Sstevel@tonic-gate 	FXGPUP0+39,	 8,
1127c478bd9Sstevel@tonic-gate 	FXGPUP0+40,	 4,
1137c478bd9Sstevel@tonic-gate 	FXGPUP0+41,	 4,
1147c478bd9Sstevel@tonic-gate 	FXGPUP0+42,	 4,
1157c478bd9Sstevel@tonic-gate 	FXGPUP0+43,	 4,
1167c478bd9Sstevel@tonic-gate 	FXGPUP0+44,	 4,
1177c478bd9Sstevel@tonic-gate 	FXGPUP0+45,	 4,
1187c478bd9Sstevel@tonic-gate 	FXGPUP0+46,	 4,
1197c478bd9Sstevel@tonic-gate 	FXGPUP0+47,	 4,
1207c478bd9Sstevel@tonic-gate 	FXGPUP0+48,	 4,
1217c478bd9Sstevel@tonic-gate 	FXGPUP0+49,	 4,
1227c478bd9Sstevel@tonic-gate 	FXGPUP0+50,	 4,
1237c478bd9Sstevel@tonic-gate 	FXGPUP0+51,	 4,
1247c478bd9Sstevel@tonic-gate 	FXGPUP0+52,	 4,
1257c478bd9Sstevel@tonic-gate 	FXGPUP0+53,	 4,
1267c478bd9Sstevel@tonic-gate 	FXGPUP0+54,	 4,
1277c478bd9Sstevel@tonic-gate 	FXGPUP0+55,	 4,
1287c478bd9Sstevel@tonic-gate 	FXGPUP0+56,	 4,
1297c478bd9Sstevel@tonic-gate 	FXGPUP0+57,	 4,
1307c478bd9Sstevel@tonic-gate 	FXGPUP0+58,	 4,
1317c478bd9Sstevel@tonic-gate 	FXGPUP0+59,	 2,
1327c478bd9Sstevel@tonic-gate 	FXGPUP0+60,	 2,
1337c478bd9Sstevel@tonic-gate };
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate pri_t config_fx_maxumdpri = sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1;
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /*
1387c478bd9Sstevel@tonic-gate  * Return the address of config_fx_dptbl
1397c478bd9Sstevel@tonic-gate  */
1407c478bd9Sstevel@tonic-gate fxdpent_t *
fx_getdptbl()1417c478bd9Sstevel@tonic-gate fx_getdptbl()
1427c478bd9Sstevel@tonic-gate {
1437c478bd9Sstevel@tonic-gate 	return (config_fx_dptbl);
1447c478bd9Sstevel@tonic-gate }
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate /*
1487c478bd9Sstevel@tonic-gate  * Return the address of fx_maxumdpri
1497c478bd9Sstevel@tonic-gate  */
1507c478bd9Sstevel@tonic-gate pri_t
fx_getmaxumdpri()1517c478bd9Sstevel@tonic-gate fx_getmaxumdpri()
1527c478bd9Sstevel@tonic-gate {
1537c478bd9Sstevel@tonic-gate 	/*
1547c478bd9Sstevel@tonic-gate 	 * the config_fx_dptbl table.
1557c478bd9Sstevel@tonic-gate 	 */
1567c478bd9Sstevel@tonic-gate 	return (config_fx_maxumdpri);
1577c478bd9Sstevel@tonic-gate }
158