diff --git a/include/bitops.h b/include/bitops.h index 32d2d65f8..092f67403 100644 --- a/include/bitops.h +++ b/include/bitops.h @@ -106,6 +106,11 @@ found_middle: return result + __ffs(tmp); } +#define for_each_bit(i, bitmask) \ + for (i = find_next_bit(bitmask, sizeof(bitmask), 0); \ + i < sizeof(bitmask); \ + i = find_next_bit(bitmask, sizeof(bitmask), i + 1)) + #else /* CONFIG_X86_64 */ # error x86-32 is not implemented yet #endif /* CONFIG_X86_64 */