diff options
author | jeff <jeff@FreeBSD.org> | 2007-01-04 12:10:58 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-01-04 12:10:58 +0000 |
commit | 60a15a9f22590ef52b2b2ed230ce5c44a07a947a (patch) | |
tree | e49e49b5201f14ef73e1a0835a46f048d5b3cd68 | |
parent | 876ba7f8b04721e26633ef431f176bf959397328 (diff) | |
download | FreeBSD-src-60a15a9f22590ef52b2b2ed230ce5c44a07a947a.zip FreeBSD-src-60a15a9f22590ef52b2b2ed230ce5c44a07a947a.tar.gz |
- Don't pass a pointer into runq_choose_from(). The caller can adjust the
index if it chooses to.
-rw-r--r-- | sys/kern/kern_switch.c | 5 | ||||
-rw-r--r-- | sys/sys/runq.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 16a69f4..48c1e0a 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -556,21 +556,20 @@ runq_choose(struct runq *rq) } struct td_sched * -runq_choose_from(struct runq *rq, int *idx) +runq_choose_from(struct runq *rq, int idx) { struct rqhead *rqh; struct td_sched *ts; int pri; mtx_assert(&sched_lock, MA_OWNED); - if ((pri = runq_findbit_from(rq, *idx)) != -1) { + if ((pri = runq_findbit_from(rq, idx)) != -1) { rqh = &rq->rq_queues[pri]; ts = TAILQ_FIRST(rqh); KASSERT(ts != NULL, ("runq_choose: no proc on busy queue")); CTR4(KTR_RUNQ, "runq_choose_from: pri=%d kse=%p idx=%d rqh=%p", pri, ts, ts->ts_rqindex, rqh); - *idx = ts->ts_rqindex; return (ts); } CTR1(KTR_RUNQ, "runq_choose_from: idleproc pri=%d", pri); diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 56eec26..6e7e5d9 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -66,7 +66,7 @@ void runq_add(struct runq *, struct td_sched *, int); void runq_add_pri(struct runq *, struct td_sched *, int, int); int runq_check(struct runq *); struct td_sched *runq_choose(struct runq *); -struct td_sched *runq_choose_from(struct runq *, int *); +struct td_sched *runq_choose_from(struct runq *, int); void runq_init(struct runq *); void runq_remove(struct runq *, struct td_sched *); void runq_remove_idx(struct runq *, struct td_sched *, int *); |