Lines Matching defs:rtp

284 	struct rtprio	*rtp;
291 struct rtprio rtp;
297 cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio));
316 pri_to_rtp(td1, &rtp);
318 return (copyout(&rtp, uap->rtp, sizeof(struct rtprio)));
341 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME ||
342 (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE &&
348 error = rtp_to_pri(&rtp, td1);
365 struct rtprio *rtp;
373 struct rtprio rtp;
378 cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio));
404 pri_to_rtp(td, &rtp);
408 rtp.type = RTP_PRIO_IDLE;
409 rtp.prio = RTP_PRIO_MAX;
412 if (rtp2.type < rtp.type ||
413 (rtp2.type == rtp.type &&
414 rtp2.prio < rtp.prio)) {
415 rtp.type = rtp2.type;
416 rtp.prio = rtp2.prio;
421 return (copyout(&rtp, uap->rtp, sizeof(struct rtprio)));
431 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME ||
432 (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE &&
446 error = rtp_to_pri(&rtp, td);
449 if ((error = rtp_to_pri(&rtp, td)) != 0)
463 rtp_to_pri(struct rtprio *rtp, struct thread *td)
467 switch (RTP_PRIO_BASE(rtp->type)) {
469 if (rtp->prio > RTP_PRIO_MAX)
471 newpri = PRI_MIN_REALTIME + rtp->prio;
474 if (rtp->prio > (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE))
476 newpri = PRI_MIN_TIMESHARE + rtp->prio;
479 if (rtp->prio > RTP_PRIO_MAX)
481 newpri = PRI_MIN_IDLE + rtp->prio;
489 sched_class(td, rtp->type); /* XXX fix */
506 pri_to_rtp(struct thread *td, struct rtprio *rtp)
512 rtp->prio = td->td_base_user_pri - PRI_MIN_REALTIME;
515 rtp->prio = td->td_base_user_pri - PRI_MIN_TIMESHARE;
518 rtp->prio = td->td_base_user_pri - PRI_MIN_IDLE;
523 rtp->type = td->td_pri_class;