xref: /illumos-gate/usr/src/uts/common/disp/rt_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 /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
287c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
297c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/proc.h>
327c478bd9Sstevel@tonic-gate #include <sys/priocntl.h>
337c478bd9Sstevel@tonic-gate #include <sys/class.h>
347c478bd9Sstevel@tonic-gate #include <sys/disp.h>
357c478bd9Sstevel@tonic-gate #include <sys/rt.h>
367c478bd9Sstevel@tonic-gate #include <sys/rtpriocntl.h>
377c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * The purpose of this file is to allow a user to make their own
417c478bd9Sstevel@tonic-gate  * rt_dptbl. The contents of this file should be included in the
42*bbf21555SRichard Lowe  * rt_dptbl(5) man page with proper instructions for making
437c478bd9Sstevel@tonic-gate  * and replacing the RT_DPTBL.kmod in modules/sched. This was the
447c478bd9Sstevel@tonic-gate  * only way to provide functionality equivalent to the mkboot/cunix
457c478bd9Sstevel@tonic-gate  * method in SVr4 without having the utilities mkboot/cunix in
467c478bd9Sstevel@tonic-gate  * SunOS/Svr4.
477c478bd9Sstevel@tonic-gate  * It is recommended that the system calls be used to change the time
487c478bd9Sstevel@tonic-gate  * quantums instead of re-building the module.
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate static struct modlmisc modlmisc = {
527c478bd9Sstevel@tonic-gate 	&mod_miscops, "realtime dispatch table"
537c478bd9Sstevel@tonic-gate };
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate static struct modlinkage modlinkage = {
567c478bd9Sstevel@tonic-gate 	MODREV_1, &modlmisc, 0
577c478bd9Sstevel@tonic-gate };
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate int
_init()607c478bd9Sstevel@tonic-gate _init()
617c478bd9Sstevel@tonic-gate {
627c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
637c478bd9Sstevel@tonic-gate }
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate int
_info(struct modinfo * modinfop)667c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
677c478bd9Sstevel@tonic-gate {
687c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
697c478bd9Sstevel@tonic-gate }
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #define	RTGPPRIO0	100	/* Global priority for RT priority 0 */
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate rtdpent_t	config_rt_dptbl[] = {
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /*   	prilevel    Time quantum */
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate 	RTGPPRIO0,	100,
787c478bd9Sstevel@tonic-gate 	RTGPPRIO0+1,	100,
797c478bd9Sstevel@tonic-gate 	RTGPPRIO0+2,	100,
807c478bd9Sstevel@tonic-gate 	RTGPPRIO0+3,	100,
817c478bd9Sstevel@tonic-gate 	RTGPPRIO0+4,	100,
827c478bd9Sstevel@tonic-gate 	RTGPPRIO0+5,	100,
837c478bd9Sstevel@tonic-gate 	RTGPPRIO0+6,	100,
847c478bd9Sstevel@tonic-gate 	RTGPPRIO0+7,	100,
857c478bd9Sstevel@tonic-gate 	RTGPPRIO0+8,	100,
867c478bd9Sstevel@tonic-gate 	RTGPPRIO0+9,	100,
877c478bd9Sstevel@tonic-gate 	RTGPPRIO0+10,	80,
887c478bd9Sstevel@tonic-gate 	RTGPPRIO0+11,	80,
897c478bd9Sstevel@tonic-gate 	RTGPPRIO0+12,	80,
907c478bd9Sstevel@tonic-gate 	RTGPPRIO0+13,	80,
917c478bd9Sstevel@tonic-gate 	RTGPPRIO0+14,	80,
927c478bd9Sstevel@tonic-gate 	RTGPPRIO0+15,	80,
937c478bd9Sstevel@tonic-gate 	RTGPPRIO0+16,	80,
947c478bd9Sstevel@tonic-gate 	RTGPPRIO0+17,	80,
957c478bd9Sstevel@tonic-gate 	RTGPPRIO0+18,	80,
967c478bd9Sstevel@tonic-gate 	RTGPPRIO0+19,	80,
977c478bd9Sstevel@tonic-gate 	RTGPPRIO0+20,	60,
987c478bd9Sstevel@tonic-gate 	RTGPPRIO0+21,	60,
997c478bd9Sstevel@tonic-gate 	RTGPPRIO0+22,	60,
1007c478bd9Sstevel@tonic-gate 	RTGPPRIO0+23,	60,
1017c478bd9Sstevel@tonic-gate 	RTGPPRIO0+24,	60,
1027c478bd9Sstevel@tonic-gate 	RTGPPRIO0+25,	60,
1037c478bd9Sstevel@tonic-gate 	RTGPPRIO0+26,	60,
1047c478bd9Sstevel@tonic-gate 	RTGPPRIO0+27,	60,
1057c478bd9Sstevel@tonic-gate 	RTGPPRIO0+28,	60,
1067c478bd9Sstevel@tonic-gate 	RTGPPRIO0+29,	60,
1077c478bd9Sstevel@tonic-gate 	RTGPPRIO0+30,	40,
1087c478bd9Sstevel@tonic-gate 	RTGPPRIO0+31,	40,
1097c478bd9Sstevel@tonic-gate 	RTGPPRIO0+32,	40,
1107c478bd9Sstevel@tonic-gate 	RTGPPRIO0+33,	40,
1117c478bd9Sstevel@tonic-gate 	RTGPPRIO0+34,	40,
1127c478bd9Sstevel@tonic-gate 	RTGPPRIO0+35,	40,
1137c478bd9Sstevel@tonic-gate 	RTGPPRIO0+36,	40,
1147c478bd9Sstevel@tonic-gate 	RTGPPRIO0+37,	40,
1157c478bd9Sstevel@tonic-gate 	RTGPPRIO0+38,	40,
1167c478bd9Sstevel@tonic-gate 	RTGPPRIO0+39,	40,
1177c478bd9Sstevel@tonic-gate 	RTGPPRIO0+40,	20,
1187c478bd9Sstevel@tonic-gate 	RTGPPRIO0+41,	20,
1197c478bd9Sstevel@tonic-gate 	RTGPPRIO0+42,	20,
1207c478bd9Sstevel@tonic-gate 	RTGPPRIO0+43,	20,
1217c478bd9Sstevel@tonic-gate 	RTGPPRIO0+44,	20,
1227c478bd9Sstevel@tonic-gate 	RTGPPRIO0+45,	20,
1237c478bd9Sstevel@tonic-gate 	RTGPPRIO0+46,	20,
1247c478bd9Sstevel@tonic-gate 	RTGPPRIO0+47,	20,
1257c478bd9Sstevel@tonic-gate 	RTGPPRIO0+48,	20,
1267c478bd9Sstevel@tonic-gate 	RTGPPRIO0+49,	20,
1277c478bd9Sstevel@tonic-gate 	RTGPPRIO0+50,	10,
1287c478bd9Sstevel@tonic-gate 	RTGPPRIO0+51,	10,
1297c478bd9Sstevel@tonic-gate 	RTGPPRIO0+52,	10,
1307c478bd9Sstevel@tonic-gate 	RTGPPRIO0+53,	10,
1317c478bd9Sstevel@tonic-gate 	RTGPPRIO0+54,	10,
1327c478bd9Sstevel@tonic-gate 	RTGPPRIO0+55,	10,
1337c478bd9Sstevel@tonic-gate 	RTGPPRIO0+56,	10,
1347c478bd9Sstevel@tonic-gate 	RTGPPRIO0+57,	10,
1357c478bd9Sstevel@tonic-gate 	RTGPPRIO0+58,	10,
1367c478bd9Sstevel@tonic-gate 	RTGPPRIO0+59,	10
1377c478bd9Sstevel@tonic-gate };
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /*
1407c478bd9Sstevel@tonic-gate  * Return the address of config_rt_dptbl
1417c478bd9Sstevel@tonic-gate  */
1427c478bd9Sstevel@tonic-gate rtdpent_t *
rt_getdptbl()1437c478bd9Sstevel@tonic-gate rt_getdptbl()
1447c478bd9Sstevel@tonic-gate {
1457c478bd9Sstevel@tonic-gate 	return (config_rt_dptbl);
1467c478bd9Sstevel@tonic-gate }
147