aboutsummaryrefslogtreecommitdiff
path: root/stand/efi/loader
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-09-21 15:32:23 +0000
committerMark Johnston <markj@FreeBSD.org>2021-09-21 16:07:39 +0000
commitdfd3bde5775ecf88851d5dffd6a8ed6076b53566 (patch)
tree4219e2f0c3525e4b86e6080e64ad9f621f736754 /stand/efi/loader
parent8678140127296c15894094087b81f71fe79a21d9 (diff)
downloadsrc-dfd3bde5775ecf88851d5dffd6a8ed6076b53566.tar.gz
src-dfd3bde5775ecf88851d5dffd6a8ed6076b53566.zip
bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR
These allow one to non-destructively iterate over the set or clear bits in a bitset. The motivation is that we have several code fragments which iterate over a CPU set like this: while ((cpu = CPU_FFS(&cpus)) != 0) { cpu--; CPU_CLR(cpu, &cpus); <do something>; } This is slow since CPU_FFS begins the search at the beginning of the bitset each time. On amd64 and arm64, CPU sets have size 256, so there are four limbs in the bitset and we do a lot of unnecessary scanning. A second problem is that this is destructive, so code which needs to preserve the original set has to make a copy. In particular, we have quite a few functions which take a cpuset_t parameter by value, meaning that each call has to copy the 32 byte cpuset_t. The new macros address both problems. Reviewed by: cem, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32028
Diffstat (limited to 'stand/efi/loader')
0 files changed, 0 insertions, 0 deletions