5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2013 Joyent, Inc. All rights reserved.
26 */
27
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30
31 #include <sys/types.h>
32 #include <sys/param.h>
33 #include <sys/sysmacros.h>
34 #include <sys/cred.h>
35 #include <sys/proc.h>
36 #include <sys/pcb.h>
37 #include <sys/signal.h>
38 #include <sys/user.h>
39 #include <sys/priocntl.h>
40 #include <sys/class.h>
41 #include <sys/disp.h>
42 #include <sys/procset.h>
43 #include <sys/cmn_err.h>
44 #include <sys/debug.h>
45 #include <sys/rt.h>
86
87 int
88 _info(struct modinfo *modinfop)
89 {
90 return (mod_info(&modlinkage, modinfop));
91 }
92
93
94 /*
95 * Class specific code for the real-time class
96 */
97
98 /*
99 * Extern declarations for variables defined in the rt master file
100 */
101 #define RTMAXPRI 59
102
103 pri_t rt_maxpri = RTMAXPRI; /* maximum real-time priority */
104 rtdpent_t *rt_dptbl; /* real-time dispatcher parameter table */
105
106 /*
107 * control flags (kparms->rt_cflags).
108 */
109 #define RT_DOPRI 0x01 /* change priority */
110 #define RT_DOTQ 0x02 /* change RT time quantum */
111 #define RT_DOSIG 0x04 /* change RT time quantum signal */
112
113 static int rt_admin(caddr_t, cred_t *);
114 static int rt_enterclass(kthread_t *, id_t, void *, cred_t *, void *);
115 static int rt_fork(kthread_t *, kthread_t *, void *);
116 static int rt_getclinfo(void *);
117 static int rt_getclpri(pcpri_t *);
118 static int rt_parmsin(void *);
119 static int rt_parmsout(void *, pc_vaparms_t *);
120 static int rt_vaparmsin(void *, pc_vaparms_t *);
121 static int rt_vaparmsout(void *, pc_vaparms_t *);
122 static int rt_parmsset(kthread_t *, void *, id_t, cred_t *);
123 static int rt_donice(kthread_t *, cred_t *, int, int *);
124 static int rt_doprio(kthread_t *, cred_t *, int, int *);
125 static void rt_exitclass(void *);
126 static int rt_canexit(kthread_t *, cred_t *);
127 static void rt_forkret(kthread_t *, kthread_t *);
128 static void rt_nullsys();
129 static void rt_parmsget(kthread_t *, void *);
130 static void rt_preempt(kthread_t *);
131 static void rt_setrun(kthread_t *);
132 static void rt_tick(kthread_t *);
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2015 Joyent, Inc.
26 */
27
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30
31 #include <sys/types.h>
32 #include <sys/param.h>
33 #include <sys/sysmacros.h>
34 #include <sys/cred.h>
35 #include <sys/proc.h>
36 #include <sys/pcb.h>
37 #include <sys/signal.h>
38 #include <sys/user.h>
39 #include <sys/priocntl.h>
40 #include <sys/class.h>
41 #include <sys/disp.h>
42 #include <sys/procset.h>
43 #include <sys/cmn_err.h>
44 #include <sys/debug.h>
45 #include <sys/rt.h>
86
87 int
88 _info(struct modinfo *modinfop)
89 {
90 return (mod_info(&modlinkage, modinfop));
91 }
92
93
94 /*
95 * Class specific code for the real-time class
96 */
97
98 /*
99 * Extern declarations for variables defined in the rt master file
100 */
101 #define RTMAXPRI 59
102
103 pri_t rt_maxpri = RTMAXPRI; /* maximum real-time priority */
104 rtdpent_t *rt_dptbl; /* real-time dispatcher parameter table */
105
106 static int rt_admin(caddr_t, cred_t *);
107 static int rt_enterclass(kthread_t *, id_t, void *, cred_t *, void *);
108 static int rt_fork(kthread_t *, kthread_t *, void *);
109 static int rt_getclinfo(void *);
110 static int rt_getclpri(pcpri_t *);
111 static int rt_parmsin(void *);
112 static int rt_parmsout(void *, pc_vaparms_t *);
113 static int rt_vaparmsin(void *, pc_vaparms_t *);
114 static int rt_vaparmsout(void *, pc_vaparms_t *);
115 static int rt_parmsset(kthread_t *, void *, id_t, cred_t *);
116 static int rt_donice(kthread_t *, cred_t *, int, int *);
117 static int rt_doprio(kthread_t *, cred_t *, int, int *);
118 static void rt_exitclass(void *);
119 static int rt_canexit(kthread_t *, cred_t *);
120 static void rt_forkret(kthread_t *, kthread_t *);
121 static void rt_nullsys();
122 static void rt_parmsget(kthread_t *, void *);
123 static void rt_preempt(kthread_t *);
124 static void rt_setrun(kthread_t *);
125 static void rt_tick(kthread_t *);
|