MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_bsf64_safe

Function rte_bsf64_safe

dpdk/lib/eal/include/rte_bitops.h:547–555  ·  view source on GitHub ↗

* Searches the input parameter for the least significant set bit * (starting from zero). Safe version (checks for input parameter being zero). * * @warning ``pos`` must be a valid pointer. It is not checked! * * @param v * The input parameter. * @param pos * If ``v`` was not 0, this value will contain position of least significant * bit within the input parameter. * @return

Source from the content-addressed store, hash-verified

545 * Returns 0 if ``v`` was 0, otherwise returns 1.
546 */
547static inline int
548rte_bsf64_safe(uint64_t v, uint32_t *pos)
549{
550 if (v == 0)
551 return 0;
552
553 *pos = rte_bsf64(v);
554 return 1;
555}
556
557/**
558 * Return the last (most-significant) bit set.

Callers 2

__rte_bitmap_scan_searchFunction · 0.70
test_bsfFunction · 0.50

Calls 1

rte_bsf64Function · 0.70

Tested by 1

test_bsfFunction · 0.40