summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_switch.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-08-19 16:06:08 +0000
committerpeter <peter@FreeBSD.org>1999-08-19 16:06:08 +0000
commit9ce4e1ab764035c17199595e622237c38cf4b72d (patch)
treebaf0024eb06785f983499ef85c4798785c96d385 /sys/kern/kern_switch.c
parentc6ab32300c68d1bbcbd95264cd44d344e5147c1d (diff)
downloadFreeBSD-src-9ce4e1ab764035c17199595e622237c38cf4b72d.zip
FreeBSD-src-9ce4e1ab764035c17199595e622237c38cf4b72d.tar.gz
Fix a typo and a bug.
- One RTP_PRIO_REALTIME was meant to be RTP_PRIO_IDLE. - RTP_PRIO_FIFO was not handled. - Move the usual case first for setrunqueue() etc.
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r--sys/kern/kern_switch.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index b761ddb..a4b05fe 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -82,14 +82,15 @@ setrunqueue(struct proc *p)
u_int8_t pri;
KASSERT(p->p_stat == SRUN, ("setrunqueue: proc not SRUN"));
- if (p->p_rtprio.type == RTP_PRIO_REALTIME) {
- pri = p->p_rtprio.prio;
- q = &rtqueues[pri];
- rtqueuebits |= 1 << pri;
- } else if (p->p_rtprio.type == RTP_PRIO_NORMAL) {
+ if (p->p_rtprio.type == RTP_PRIO_NORMAL) {
pri = p->p_priority >> 2;
q = &queues[pri];
queuebits |= 1 << pri;
+ } else if (p->p_rtprio.type == RTP_PRIO_REALTIME ||
+ p->p_rtprio.type == RTP_PRIO_FIFO) {
+ pri = p->p_rtprio.prio;
+ q = &rtqueues[pri];
+ rtqueuebits |= 1 << pri;
} else if (p->p_rtprio.type == RTP_PRIO_IDLE) {
pri = p->p_rtprio.prio;
q = &idqueues[pri];
@@ -114,13 +115,14 @@ remrunqueue(struct proc *p)
u_int8_t pri;
pri = p->p_rqindex;
- if (p->p_rtprio.type == RTP_PRIO_REALTIME) {
- q = &rtqueues[pri];
- which = &rtqueuebits;
- } else if (p->p_rtprio.type == RTP_PRIO_NORMAL) {
+ if (p->p_rtprio.type == RTP_PRIO_NORMAL) {
q = &queues[pri];
which = &queuebits;
- } else if (p->p_rtprio.type == RTP_PRIO_REALTIME) {
+ } else if (p->p_rtprio.type == RTP_PRIO_REALTIME ||
+ p->p_rtprio.type == RTP_PRIO_FIFO) {
+ q = &rtqueues[pri];
+ which = &rtqueuebits;
+ } else if (p->p_rtprio.type == RTP_PRIO_IDLE) {
q = &idqueues[pri];
which = &idqueuebits;
} else {
OpenPOWER on IntegriCloud