VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / include / asm-sparc / bitops.h
index a0e09a7..c1009b3 100644 (file)
@@ -366,9 +366,9 @@ found_middle:
  *
  * Scheduler induced bitop, do not use.
  */
-static inline int find_next_bit(unsigned long *addr, int size, int offset)
+static inline int find_next_bit(const unsigned long *addr, int size, int offset)
 {
-       unsigned long *p = addr + (offset >> 5);
+       const unsigned long *p = addr + (offset >> 5);
        int num = offset & ~0x1f;
        unsigned long word;
 
@@ -384,6 +384,17 @@ static inline int find_next_bit(unsigned long *addr, int size, int offset)
        return num;
 }
 
+/**
+ * find_first_bit - find the first set bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The maximum size to search
+ *
+ * Returns the bit-number of the first set bit, not the number of the byte
+ * containing a bit.
+ */
+#define find_first_bit(addr, size) \
+       find_next_bit((addr), (size), 0)
+
 /*
  */
 static inline int test_le_bit(int nr, __const__ unsigned long * addr)