find.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _ASM_GENERIC_BITOPS_FIND_H_
  2. #define _ASM_GENERIC_BITOPS_FIND_H_
  3. #ifndef find_next_bit
  4. /**
  5. * find_next_bit - find the next set bit in a memory region
  6. * @addr: The address to base the search on
  7. * @offset: The bitnumber to start searching at
  8. * @size: The bitmap size in bits
  9. */
  10. extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
  11. size, unsigned long offset);
  12. #endif
  13. #ifndef find_next_zero_bit
  14. /**
  15. * find_next_zero_bit - find the next cleared bit in a memory region
  16. * @addr: The address to base the search on
  17. * @offset: The bitnumber to start searching at
  18. * @size: The bitmap size in bits
  19. */
  20. extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
  21. long size, unsigned long offset);
  22. #endif
  23. #ifdef CONFIG_GENERIC_FIND_FIRST_BIT
  24. /**
  25. * find_first_bit - find the first set bit in a memory region
  26. * @addr: The address to start the search at
  27. * @size: The maximum size to search
  28. *
  29. * Returns the bit number of the first set bit.
  30. */
  31. extern unsigned long find_first_bit(const unsigned long *addr,
  32. unsigned long size);
  33. /**
  34. * find_first_zero_bit - find the first cleared bit in a memory region
  35. * @addr: The address to start the search at
  36. * @size: The maximum size to search
  37. *
  38. * Returns the bit number of the first cleared bit.
  39. */
  40. extern unsigned long find_first_zero_bit(const unsigned long *addr,
  41. unsigned long size);
  42. #else /* CONFIG_GENERIC_FIND_FIRST_BIT */
  43. #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
  44. #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
  45. #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
  46. #endif /*_ASM_GENERIC_BITOPS_FIND_H_ */