diff options
Diffstat (limited to 'sys/posix4')
-rw-r--r-- | sys/posix4/ksched.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/posix4/ksched.c b/sys/posix4/ksched.c index 0c1fb72..27a0899 100644 --- a/sys/posix4/ksched.c +++ b/sys/posix4/ksched.c @@ -96,9 +96,11 @@ int ksched_detach(struct ksched *p) static __inline int getscheduler(register_t *ret, struct ksched *ksched, struct proc *p) { + struct rtprio rtp; int e = 0; - switch (p->p_rtprio.type) + pri_to_rtp(&p->p_pri, &rtp); + switch (rtp.type) { case RTP_PRIO_FIFO: *ret = SCHED_FIFO; @@ -138,8 +140,11 @@ int ksched_setparam(register_t *ret, struct ksched *ksched, int ksched_getparam(register_t *ret, struct ksched *ksched, struct proc *p, struct sched_param *param) { - if (RTP_PRIO_IS_REALTIME(p->p_rtprio.type)) - param->sched_priority = rtpprio_to_p4prio(p->p_rtprio.prio); + struct rtprio rtp; + + pri_to_rtp(&p->p_pri, &rtp); + if (RTP_PRIO_IS_REALTIME(rtp.type)) + param->sched_priority = rtpprio_to_p4prio(rtp.prio); return 0; } @@ -169,7 +174,7 @@ int ksched_setscheduler(register_t *ret, struct ksched *ksched, rtp.type = (policy == SCHED_FIFO) ? RTP_PRIO_FIFO : RTP_PRIO_REALTIME; - p->p_rtprio = rtp; + rtp_to_pri(&rtp, &p->p_pri); need_resched(); } else @@ -182,7 +187,7 @@ int ksched_setscheduler(register_t *ret, struct ksched *ksched, { rtp.type = RTP_PRIO_NORMAL; rtp.prio = p4prio_to_rtpprio(param->sched_priority); - p->p_rtprio = rtp; + rtp_to_pri(&rtp, &p->p_pri); /* XXX Simply revert to whatever we had for last * normal scheduler priorities. |