diff options
author | peter <peter@FreeBSD.org> | 2002-06-20 06:21:20 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-06-20 06:21:20 +0000 |
commit | 4830c346487d0f10f6ee751a4b5951e6e6688d03 (patch) | |
tree | bff62bbdcdfc1237d8035660837bdd0327caebd3 /sys/kern/kern_switch.c | |
parent | f49002f4f645a3830346fc6d790ec32a2d43a4c2 (diff) | |
download | FreeBSD-src-4830c346487d0f10f6ee751a4b5951e6e6688d03.zip FreeBSD-src-4830c346487d0f10f6ee751a4b5951e6e6688d03.tar.gz |
Move the "- 1" into the RQB_FFS(mask) macro itself so that
implementations can provide a base zero ffs function if they wish.
This changes
#define RQB_FFS(mask) (ffs64(mask))
foo = RQB_FFS(mask) - 1;
to
#define RQB_FFS(mask) (ffs64(mask) - 1)
foo = RQB_FFS(mask);
On some platforms we can get the "- 1" for free, eg: those that use the
C code for ffs64().
Reviewed by: jake (in principle)
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r-- | sys/kern/kern_switch.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 2c6e6f6..2b531c0 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -129,8 +129,7 @@ runq_findbit(struct runq *rq) rqb = &rq->rq_status; for (i = 0; i < RQB_LEN; i++) if (rqb->rqb_bits[i]) { - pri = (RQB_FFS(rqb->rqb_bits[i]) - 1) + - (i << RQB_L2BPW); + pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW); CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d", rqb->rqb_bits[i], i, pri); return (pri); |