From ed0e8f2fe9fe332d3d666236c083408a2658e08d Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Thu, 8 Feb 2007 01:52:25 +0000 Subject: - Change types for necent runq additions to u_char rather than int. - Fix these types in ULE as well. This fixes bugs in priority index calculations in certain edge cases. (int)-1 % 64 != (uint)-1 % 64. Reported by: kkenn using pho's stress2. --- sys/kern/kern_switch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/kern/kern_switch.c') diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 13805eec60c9..1ccf64c0804d 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -306,7 +306,7 @@ runq_findbit(struct runq *rq) } static __inline int -runq_findbit_from(struct runq *rq, int start) +runq_findbit_from(struct runq *rq, u_char start) { struct rqbits *rqb; int bit; @@ -388,7 +388,7 @@ runq_add(struct runq *rq, struct td_sched *ts, int flags) } void -runq_add_pri(struct runq *rq, struct td_sched *ts, int pri, int flags) +runq_add_pri(struct runq *rq, struct td_sched *ts, u_char pri, int flags) { struct rqhead *rqh; @@ -478,7 +478,7 @@ runq_choose(struct runq *rq) } struct td_sched * -runq_choose_from(struct runq *rq, int idx) +runq_choose_from(struct runq *rq, u_char idx) { struct rqhead *rqh; struct td_sched *ts; @@ -511,10 +511,10 @@ runq_remove(struct runq *rq, struct td_sched *ts) } void -runq_remove_idx(struct runq *rq, struct td_sched *ts, int *idx) +runq_remove_idx(struct runq *rq, struct td_sched *ts, u_char *idx) { struct rqhead *rqh; - int pri; + u_char pri; KASSERT(ts->ts_thread->td_proc->p_sflag & PS_INMEM, ("runq_remove_idx: process swapped out")); -- cgit v1.2.3