X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_bitmap.h;h=6b846f251b303c6bd20e12ab31a513deb97f3284;hb=df3ff6be2b33faea3edf3c112b9bdc5b74d6f684;hp=d2ed6204c03313f6be53ce6764e8858302e4eaea;hpb=816c924e9e26ae82c3d7186d3206f0ee72e78213;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h index d2ed6204c0..6b846f251b 100644 --- a/lib/librte_eal/common/include/rte_bitmap.h +++ b/lib/librte_eal/common/include/rte_bitmap.h @@ -93,16 +93,6 @@ __rte_bitmap_index2_set(struct rte_bitmap *bmp) bmp->index2 = (((bmp->index1 << RTE_BITMAP_SLAB_BIT_SIZE_LOG2) + bmp->offset1) << RTE_BITMAP_CL_SLAB_SIZE_LOG2); } -static inline int -rte_bsf64(uint64_t slab, uint32_t *pos) -{ - if (slab == 0) - return 0; - - *pos = __builtin_ctzll(slab); - return 1; -} - static inline uint32_t __rte_bitmap_get_memory_footprint(uint32_t n_bits, uint32_t *array1_byte_offset, uint32_t *array1_slabs, @@ -408,9 +398,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp) value1 = bmp->array1[bmp->index1]; value1 &= __rte_bitmap_mask1_get(bmp); - if (rte_bsf64(value1, &bmp->offset1)) { + if (rte_bsf64_safe(value1, &bmp->offset1)) return 1; - } __rte_bitmap_index1_inc(bmp); bmp->offset1 = 0; @@ -419,9 +408,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp) for (i = 0; i < bmp->array1_size; i ++, __rte_bitmap_index1_inc(bmp)) { value1 = bmp->array1[bmp->index1]; - if (rte_bsf64(value1, &bmp->offset1)) { + if (rte_bsf64_safe(value1, &bmp->offset1)) return 1; - } } return 0;