src/dpdk/lib/librte_eal/include/rte_bitmap.h
static inline int
rte_bitmap_scan(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab)
{
	/* Return data from current array2 line if available */
	if (__rte_bitmap_scan_read(bmp, pos, slab)) {
		return 1;
	}

	/* Look for non-empty array2 line */
	if (__rte_bitmap_scan_search(bmp)) {
		__rte_bitmap_scan_read_init(bmp);
		__rte_bitmap_scan_read(bmp, pos, slab);
		return 1;
	}

	/* Empty bitmap */
	return 0;
}
/**
 * Bitmap scan (with automatic wrap-around)
 *
 * @param bmp
 *   Handle to bitmap instance
 * @param pos
 *   When function call returns 1, pos contains the position of the next set
 *   bit, otherwise not modified
 * @param slab
 *   When function call returns 1, slab contains the value of the entire 64-bit
 *   slab where the bit indicated by pos is located. Slabs are always 64-bit
 *   aligned, so the position of the first bit of the slab (this bit is not
 *   necessarily set) is pos / 64. Once a slab has been returned by the bitmap
 *   scan operation, the internal pointers of the bitmap are updated to point
 *   after this slab, so the same slab will not be returned again if it
 *   contains more than one bit which is set. When function call returns 0,
 *   slab is not modified.
 * @return
 *   0 if there is no bit set in the bitmap, 1 otherwise
 */
Bitmap scan (with automatic wrap-around)
@param bmp
Handle to bitmap instance
@param pos
When function call returns 1, pos contains the position of the next set
bit, otherwise not modified
@param slab
When function call returns 1, slab contains the value of the entire 64-bit
slab where the bit indicated by pos is located. Slabs are always 64-bit
aligned, so the position of the first bit of the slab (this bit is not
necessarily set) is pos / 64. Once a slab has been returned by the bitmap
scan operation, the internal pointers of the bitmap are updated to point
after this slab, so the same slab will not be returned again if it
contains more than one bit which is set. When function call returns 0,
slab is not modified.
@return
0 if there is no bit set in the bitmap, 1 otherwise
Bitmap scan ( with automatic wrap - around ) @param bmp Handle to bitmap instance @param pos When function call returns 1 pos contains the position of the next set bit otherwise not modified @param slab When function call returns 1 slab contains the value of the entire 64 - bit slab where the bit indicated by pos is located . Slabs are always 64 - bit aligned so the position of the first bit of the slab ( this bit is not necessarily set ) is pos / 64 . Once a slab has been returned by the bitmap scan operation the internal pointers of the bitmap are updated to point after this slab so the same slab will not be returned again if it contains more than one bit which is set . When function call returns 0 slab is not modified . @return 0 if there is no bit set in the bitmap 1 otherwise
static inline int
rte_bitmap_scan(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab)
{
	if (__rte_bitmap_scan_read(bmp, pos, slab)) {
		return 1;
	}
	if (__rte_bitmap_scan_search(bmp)) {
		__rte_bitmap_scan_read_init(bmp);
		__rte_bitmap_scan_read(bmp, pos, slab);
		return 1;
	}
	return 0;
}
static inline int rte_bitmap_scan ( struct rte_bitmap * bmp , uint32_t * pos , uint64_t * slab ) { if ( __rte_bitmap_scan_read ( bmp , pos , slab ) ) { return 1 ; } if ( __rte_bitmap_scan_search ( bmp ) ) { __rte_bitmap_scan_read_init ( bmp ) ; __rte_bitmap_scan_read ( bmp , pos , slab ) ; return 1 ; } return 0 ; }
Bitmap scan (with automatic wrap-around)
 @param bmp
   Handle to bitmap instance
 @param pos
   When function call returns 1, pos contains the position of the next set
   bit, otherwise not modified
 @param slab
   When function call returns 1, slab contains the value of the entire 64-bit
   slab where the bit indicated by pos is located.
Bitmap scan ( with automatic wrap - around ) @param bmp Handle to bitmap instance @param pos When function call returns 1 pos contains the position of the next set bit otherwise not modified @param slab When function call returns 1 slab contains the value of the entire 64 - bit slab where the bit indicated by pos is located .
/* Return data from current array2 line if available */ /* Look for non-empty array2 line */ /* Empty bitmap */