bitops: introduce the for_each_set_clump8 macro
[linux-2.6-microblaze.git] / lib / find_bit.c
index 5c51eb4..e35a76b 100644 (file)
@@ -214,3 +214,17 @@ EXPORT_SYMBOL(find_next_bit_le);
 #endif
 
 #endif /* __BIG_ENDIAN */
+
+unsigned long find_next_clump8(unsigned long *clump, const unsigned long *addr,
+                              unsigned long size, unsigned long offset)
+{
+       offset = find_next_bit(addr, size, offset);
+       if (offset == size)
+               return size;
+
+       offset = round_down(offset, 8);
+       *clump = bitmap_get_value8(addr, offset);
+
+       return offset;
+}
+EXPORT_SYMBOL(find_next_clump8);