find.h 1.6 KB

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