| 523 | } |
| 524 | |
| 525 | static inline int |
| 526 | __rte_bitmap_scan_read(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab) |
| 527 | { |
| 528 | uint64_t *slab2; |
| 529 | |
| 530 | slab2 = bmp->array2 + bmp->index2; |
| 531 | for ( ; bmp->go2 ; bmp->index2 ++, slab2 ++, bmp->go2 = bmp->index2 & RTE_BITMAP_CL_SLAB_MASK) { |
| 532 | if (*slab2) { |
| 533 | *pos = bmp->index2 << RTE_BITMAP_SLAB_BIT_SIZE_LOG2; |
| 534 | *slab = *slab2; |
| 535 | |
| 536 | bmp->index2 ++; |
| 537 | slab2 ++; |
| 538 | bmp->go2 = bmp->index2 & RTE_BITMAP_CL_SLAB_MASK; |
| 539 | return 1; |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | return 0; |
| 544 | } |
| 545 | |
| 546 | /** |
| 547 | * Bitmap scan (with automatic wrap-around) |