find.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_
  2. #define _TOOLS_LINUX_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. * Returns the bit number for the next set bit
  11. * If no bits are set, returns @size.
  12. */
  13. extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
  14. size, unsigned long offset);
  15. #endif
  16. #ifndef find_next_zero_bit
  17. /**
  18. * find_next_zero_bit - find the next cleared bit in a memory region
  19. * @addr: The address to base the search on
  20. * @offset: The bitnumber to start searching at
  21. * @size: The bitmap size in bits
  22. *
  23. * Returns the bit number of the next zero bit
  24. * If no bits are zero, returns @size.
  25. */
  26. unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
  27. unsigned long offset);
  28. #endif
  29. #ifndef find_first_bit
  30. /**
  31. * find_first_bit - find the first set bit in a memory region
  32. * @addr: The address to start the search at
  33. * @size: The maximum number of bits to search
  34. *
  35. * Returns the bit number of the first set bit.
  36. * If no bits are set, returns @size.
  37. */
  38. extern unsigned long find_first_bit(const unsigned long *addr,
  39. unsigned long size);
  40. #endif /* find_first_bit */
  41. #ifndef find_first_zero_bit
  42. /**
  43. * find_first_zero_bit - find the first cleared bit in a memory region
  44. * @addr: The address to start the search at
  45. * @size: The maximum number of bits to search
  46. *
  47. * Returns the bit number of the first cleared bit.
  48. * If no bits are zero, returns @size.
  49. */
  50. unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size);
  51. #endif
  52. #endif /*_TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_ */