lib: dimlib: fix help text typos
[linux-2.6-microblaze.git] / lib / bitmap.c
index bbe2589..f9e8348 100644 (file)
@@ -59,6 +59,26 @@ int __bitmap_equal(const unsigned long *bitmap1,
 }
 EXPORT_SYMBOL(__bitmap_equal);
 
+bool __bitmap_or_equal(const unsigned long *bitmap1,
+                      const unsigned long *bitmap2,
+                      const unsigned long *bitmap3,
+                      unsigned int bits)
+{
+       unsigned int k, lim = bits / BITS_PER_LONG;
+       unsigned long tmp;
+
+       for (k = 0; k < lim; ++k) {
+               if ((bitmap1[k] | bitmap2[k]) != bitmap3[k])
+                       return false;
+       }
+
+       if (!(bits % BITS_PER_LONG))
+               return true;
+
+       tmp = (bitmap1[k] | bitmap2[k]) ^ bitmap3[k];
+       return (tmp & BITMAP_LAST_WORD_MASK(bits)) == 0;
+}
+
 void __bitmap_complement(unsigned long *dst, const unsigned long *src, unsigned int bits)
 {
        unsigned int k, lim = BITS_TO_LONGS(bits);