* Find the index of the first non-empty run queue. This is done by * scanning the status bits, a set bit indicates a non-empty queue. */
| 294 | * scanning the status bits, a set bit indicates a non-empty queue. |
| 295 | */ |
| 296 | static __inline int |
| 297 | runq_findbit(struct runq *rq) |
| 298 | { |
| 299 | struct rqbits *rqb; |
| 300 | int pri; |
| 301 | int i; |
| 302 | |
| 303 | rqb = &rq->rq_status; |
| 304 | for (i = 0; i < RQB_LEN; i++) |
| 305 | if (rqb->rqb_bits[i]) { |
| 306 | pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW); |
| 307 | CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d", |
| 308 | rqb->rqb_bits[i], i, pri); |
| 309 | return (pri); |
| 310 | } |
| 311 | |
| 312 | return (-1); |
| 313 | } |
| 314 | |
| 315 | static __inline int |
| 316 | runq_findbit_from(struct runq *rq, u_char pri) |
no outgoing calls
no test coverage detected