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