p1003_1b.c (90361) | p1003_1b.c (96886) |
---|---|
1/* 2 * Copyright (c) 1996, 1997, 1998 3 * HD Associates, Inc. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1996, 1997, 1998 3 * HD Associates, Inc. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/kern/p1003_1b.c 90361 2002-02-07 20:58:47Z julian $ | 32 * $FreeBSD: head/sys/kern/p1003_1b.c 96886 2002-05-19 00:14:50Z jhb $ |
33 */ 34 35/* p1003_1b: Real Time common code. 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> --- 85 unchanged lines hidden (view full) --- 126 targetp = pfind(uap->pid); 127 if (targetp == NULL) { 128 e = ESRCH; 129 goto done2; 130 } 131 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 132 } 133 | 33 */ 34 35/* p1003_1b: Real Time common code. 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> --- 85 unchanged lines hidden (view full) --- 126 targetp = pfind(uap->pid); 127 if (targetp == NULL) { 128 e = ESRCH; 129 goto done2; 130 } 131 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 132 } 133 |
134 e = p_cansched(td->td_proc, targetp); | 134 e = p_cansched(td, targetp); |
135 PROC_UNLOCK(targetp); 136 if (e == 0) { 137 e = ksched_setparam(&td->td_retval[0], ksched, targettd, 138 (const struct sched_param *)&sched_param); 139 } 140done2: 141 mtx_unlock(&Giant); 142 return (e); --- 19 unchanged lines hidden (view full) --- 162 targetp = pfind(uap->pid); 163 if (targetp == NULL) { 164 e = ESRCH; 165 goto done2; 166 } 167 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 168 } 169 | 135 PROC_UNLOCK(targetp); 136 if (e == 0) { 137 e = ksched_setparam(&td->td_retval[0], ksched, targettd, 138 (const struct sched_param *)&sched_param); 139 } 140done2: 141 mtx_unlock(&Giant); 142 return (e); --- 19 unchanged lines hidden (view full) --- 162 targetp = pfind(uap->pid); 163 if (targetp == NULL) { 164 e = ESRCH; 165 goto done2; 166 } 167 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 168 } 169 |
170 e = p_cansee(td->td_proc, targetp); | 170 e = p_cansee(td, targetp); |
171 PROC_UNLOCK(targetp); 172 if (e) 173 goto done2; 174 175 e = ksched_getparam(&td->td_retval[0], ksched, targettd, &sched_param); 176 if (e == 0) 177 e = copyout(&sched_param, uap->param, sizeof(sched_param)); 178done2: --- 25 unchanged lines hidden (view full) --- 204 targetp = pfind(uap->pid); 205 if (targetp == NULL) { 206 e = ESRCH; 207 goto done2; 208 } 209 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 210 } 211 | 171 PROC_UNLOCK(targetp); 172 if (e) 173 goto done2; 174 175 e = ksched_getparam(&td->td_retval[0], ksched, targettd, &sched_param); 176 if (e == 0) 177 e = copyout(&sched_param, uap->param, sizeof(sched_param)); 178done2: --- 25 unchanged lines hidden (view full) --- 204 targetp = pfind(uap->pid); 205 if (targetp == NULL) { 206 e = ESRCH; 207 goto done2; 208 } 209 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 210 } 211 |
212 e = p_cansched(td->td_proc, targetp); | 212 e = p_cansched(td, targetp); |
213 PROC_UNLOCK(targetp); 214 if (e == 0) { 215 e = ksched_setscheduler(&td->td_retval[0], ksched, targettd, 216 uap->policy, (const struct sched_param *)&sched_param); 217 } 218done2: 219 mtx_unlock(&Giant); 220 return (e); --- 18 unchanged lines hidden (view full) --- 239 targetp = pfind(uap->pid); 240 if (targetp == NULL) { 241 e = ESRCH; 242 goto done2; 243 } 244 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 245 } 246 | 213 PROC_UNLOCK(targetp); 214 if (e == 0) { 215 e = ksched_setscheduler(&td->td_retval[0], ksched, targettd, 216 uap->policy, (const struct sched_param *)&sched_param); 217 } 218done2: 219 mtx_unlock(&Giant); 220 return (e); --- 18 unchanged lines hidden (view full) --- 239 targetp = pfind(uap->pid); 240 if (targetp == NULL) { 241 e = ESRCH; 242 goto done2; 243 } 244 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 245 } 246 |
247 e = p_cansee(td->td_proc, targetp); | 247 e = p_cansee(td, targetp); |
248 PROC_UNLOCK(targetp); 249 if (e == 0) 250 e = ksched_getscheduler(&td->td_retval[0], ksched, targettd); 251 252done2: 253 mtx_unlock(&Giant); 254 return (e); 255} --- 59 unchanged lines hidden (view full) --- 315 targetp = pfind(uap->pid); 316 if (targetp == NULL) { 317 e = ESRCH; 318 goto done2; 319 } 320 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 321 } 322 | 248 PROC_UNLOCK(targetp); 249 if (e == 0) 250 e = ksched_getscheduler(&td->td_retval[0], ksched, targettd); 251 252done2: 253 mtx_unlock(&Giant); 254 return (e); 255} --- 59 unchanged lines hidden (view full) --- 315 targetp = pfind(uap->pid); 316 if (targetp == NULL) { 317 e = ESRCH; 318 goto done2; 319 } 320 targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ 321 } 322 |
323 e = p_cansee(td->td_proc, targetp); | 323 e = p_cansee(td, targetp); |
324 PROC_UNLOCK(targetp); 325 if (e == 0) { 326 e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd, 327 uap->interval); 328 } 329done2: 330 mtx_unlock(&Giant); 331 return (e); 332} 333 334#endif 335 336static void p31binit(void *notused) 337{ 338 (void) sched_attach(); 339 p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); 340} 341 342SYSINIT(p31b, SI_SUB_P1003_1B, SI_ORDER_FIRST, p31binit, NULL); | 324 PROC_UNLOCK(targetp); 325 if (e == 0) { 326 e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd, 327 uap->interval); 328 } 329done2: 330 mtx_unlock(&Giant); 331 return (e); 332} 333 334#endif 335 336static void p31binit(void *notused) 337{ 338 (void) sched_attach(); 339 p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); 340} 341 342SYSINIT(p31b, SI_SUB_P1003_1B, SI_ORDER_FIRST, p31binit, NULL); |