* 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
| 545 | * Returns 0 if ``v`` was 0, otherwise returns 1. |
| 546 | */ |
| 547 | static inline int |
| 548 | rte_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. |