Lines Matching defs:rtp

294 	struct rtprio	*rtp;
301 struct rtprio rtp;
307 cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio));
326 pri_to_rtp(td1, &rtp);
328 return (copyout(&rtp, uap->rtp, sizeof(struct rtprio)));
351 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME &&
354 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE &&
358 error = rtp_to_pri(&rtp, td1);
375 struct rtprio *rtp;
383 struct rtprio rtp;
388 cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio));
414 pri_to_rtp(td, &rtp);
418 rtp.type = RTP_PRIO_IDLE;
419 rtp.prio = RTP_PRIO_MAX;
422 if (rtp2.type < rtp.type ||
423 (rtp2.type == rtp.type &&
424 rtp2.prio < rtp.prio)) {
425 rtp.type = rtp2.type;
426 rtp.prio = rtp2.prio;
431 return (copyout(&rtp, uap->rtp, sizeof(struct rtprio)));
441 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME &&
444 if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE &&
456 error = rtp_to_pri(&rtp, td);
459 if ((error = rtp_to_pri(&rtp, td)) != 0)
473 rtp_to_pri(struct rtprio *rtp, struct thread *td)
477 switch (RTP_PRIO_BASE(rtp->type)) {
479 if (rtp->prio > RTP_PRIO_MAX)
481 newpri = PRI_MIN_REALTIME + rtp->prio;
484 if (rtp->prio > (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE))
486 newpri = PRI_MIN_TIMESHARE + rtp->prio;
489 if (rtp->prio > RTP_PRIO_MAX)
491 newpri = PRI_MIN_IDLE + rtp->prio;
499 sched_class(td, rtp->type); /* XXX fix */
516 pri_to_rtp(struct thread *td, struct rtprio *rtp)
522 rtp->prio = td->td_base_user_pri - PRI_MIN_REALTIME;
525 rtp->prio = td->td_base_user_pri - PRI_MIN_TIMESHARE;
528 rtp->prio = td->td_base_user_pri - PRI_MIN_IDLE;
533 rtp->type = td->td_pri_class;