aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_switch.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-08-19 16:06:08 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-08-19 16:06:08 +0000
commit42cef09ba221d75569f2b95dd6baa1112c46a5b9 (patch)
treebf6539fb071387942a4467992506b07b5f622e4d /sys/kern/kern_switch.c
parente9fc0b372f5ad56e1d1c08df2e1a0e0d4d157b20 (diff)
downloadsrc-42cef09ba221d75569f2b95dd6baa1112c46a5b9.tar.gz
src-42cef09ba221d75569f2b95dd6baa1112c46a5b9.zip
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.
Notes
Notes: svn path=/head/; revision=50056
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 b761ddb2c21a..a4b05fe76a45 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 {