find.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _ASM_GENERIC_BITOPS_FIND_H_
  2. #define _ASM_GENERIC_BITOPS_FIND_H_
  3. #ifndef CONFIG_GENERIC_FIND_NEXT_BIT
  4. extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
  5. size, unsigned long offset);
  6. extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
  7. long size, unsigned long offset);
  8. #endif
  9. #ifdef CONFIG_GENERIC_FIND_FIRST_BIT
  10. /**
  11. * find_first_bit - find the first set bit in a memory region
  12. * @addr: The address to start the search at
  13. * @size: The maximum size to search
  14. *
  15. * Returns the bit number of the first set bit.
  16. */
  17. extern unsigned long find_first_bit(const unsigned long *addr,
  18. unsigned long size);
  19. /**
  20. * find_first_zero_bit - find the first cleared bit in a memory region
  21. * @addr: The address to start the search at
  22. * @size: The maximum size to search
  23. *
  24. * Returns the bit number of the first cleared bit.
  25. */
  26. extern unsigned long find_first_zero_bit(const unsigned long *addr,
  27. unsigned long size);
  28. #else /* CONFIG_GENERIC_FIND_FIRST_BIT */
  29. #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
  30. #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
  31. #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
  32. #endif /*_ASM_GENERIC_BITOPS_FIND_H_ */