* 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,
| 564 | * 0 if there is no bit set in the bitmap, 1 otherwise |
| 565 | */ |
| 566 | static inline int |
| 567 | rte_bitmap_scan(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab) |
| 568 | { |
| 569 | /* Return data from current array2 line if available */ |
| 570 | if (__rte_bitmap_scan_read(bmp, pos, slab)) { |
| 571 | return 1; |
| 572 | } |
| 573 | |
| 574 | /* Look for non-empty array2 line */ |
| 575 | if (__rte_bitmap_scan_search(bmp)) { |
| 576 | __rte_bitmap_scan_read_init(bmp); |
| 577 | __rte_bitmap_scan_read(bmp, pos, slab); |
| 578 | return 1; |
| 579 | } |
| 580 | |
| 581 | /* Empty bitmap */ |
| 582 | return 0; |
| 583 | } |
| 584 | |
| 585 | #ifdef __cplusplus |
| 586 | } |