* Bitmap bit set * * @param bmp * Handle to bitmap instance * @param pos * Bit position */
| 362 | * Bit position |
| 363 | */ |
| 364 | static inline void |
| 365 | rte_bitmap_set(struct rte_bitmap *bmp, uint32_t pos) |
| 366 | { |
| 367 | uint64_t *slab1, *slab2; |
| 368 | uint32_t index1, index2, offset1, offset2; |
| 369 | |
| 370 | /* Set bit in array2 slab and set bit in array1 slab */ |
| 371 | index2 = pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2; |
| 372 | offset2 = pos & RTE_BITMAP_SLAB_BIT_MASK; |
| 373 | index1 = pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + RTE_BITMAP_CL_BIT_SIZE_LOG2); |
| 374 | offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK; |
| 375 | slab2 = bmp->array2 + index2; |
| 376 | slab1 = bmp->array1 + index1; |
| 377 | |
| 378 | *slab2 |= 1llu << offset2; |
| 379 | *slab1 |= 1llu << offset1; |
| 380 | } |
| 381 | |
| 382 | /** |
| 383 | * Bitmap slab set |
no outgoing calls