| /freebsd/sys/contrib/ck/include/ |
| H A D | ck_bitmap.h | 60 struct ck_bitmap bitmap; \ 64 ck_bitmap_iterator_init((a), &(b)->bitmap) 67 ck_bitmap_init(&(a)->bitmap, (b), (c)) 70 ck_bitmap_next(&(a)->bitmap, (b), (c)) 73 ck_bitmap_set(&(a)->bitmap, (b)) 76 ck_bitmap_bts(&(a)->bitmap, (b)) 79 ck_bitmap_reset(&(a)->bitmap, (b)) 82 ck_bitmap_test(&(a)->bitmap, (b)) 85 ck_bitmap_union(&(a)->bitmap, &(b)->bitmap) 88 ck_bitmap_intersection(&(a)->bitmap, &(b)->bitmap) [all …]
|
| /freebsd/contrib/ofed/libmlx5/ |
| H A D | buf.c | 45 static int mlx5_bitmap_init(struct mlx5_bitmap *bitmap, uint32_t num, in mlx5_bitmap_init() argument 48 bitmap->last = 0; in mlx5_bitmap_init() 49 bitmap->top = 0; in mlx5_bitmap_init() 50 bitmap->max = num; in mlx5_bitmap_init() 51 bitmap->avail = num; in mlx5_bitmap_init() 52 bitmap->mask = mask; in mlx5_bitmap_init() 53 bitmap->avail = bitmap->max; in mlx5_bitmap_init() 54 bitmap->table = calloc(BITS_TO_LONGS(bitmap->max), sizeof(uint32_t)); in mlx5_bitmap_init() 55 if (!bitmap->table) in mlx5_bitmap_init() 61 static void bitmap_free_range(struct mlx5_bitmap *bitmap, uint32_t obj, in bitmap_free_range() argument [all …]
|
| /freebsd/sys/dev/mlx4/mlx4_core/ |
| H A D | mlx4_alloc.c | 43 u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap) in mlx4_bitmap_alloc() argument 47 spin_lock(&bitmap->lock); in mlx4_bitmap_alloc() 49 obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last); in mlx4_bitmap_alloc() 50 if (obj >= bitmap->max) { in mlx4_bitmap_alloc() 51 bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) in mlx4_bitmap_alloc() 52 & bitmap->mask; in mlx4_bitmap_alloc() 53 obj = find_first_zero_bit(bitmap->table, bitmap->max); in mlx4_bitmap_alloc() 56 if (obj < bitmap->max) { in mlx4_bitmap_alloc() 57 set_bit(obj, bitmap->table); in mlx4_bitmap_alloc() 58 bitmap->last = (obj + 1); in mlx4_bitmap_alloc() [all …]
|
| H A D | mlx4_qp.c | 530 struct mlx4_bitmap (*bitmap)[MLX4_QP_TABLE_ZONE_NUM] = NULL; in mlx4_create_zones() local 541 bitmap = kmalloc(sizeof(*bitmap), GFP_KERNEL); in mlx4_create_zones() 543 if (NULL == bitmap) { in mlx4_create_zones() 548 err = mlx4_bitmap_init(*bitmap + MLX4_QP_TABLE_ZONE_GENERAL, dev->caps.num_qps, in mlx4_create_zones() 557 err = mlx4_zone_add_one(qp_table->zones, *bitmap + MLX4_QP_TABLE_ZONE_GENERAL, in mlx4_create_zones() 565 err = mlx4_bitmap_init(*bitmap + MLX4_QP_TABLE_ZONE_RSS, in mlx4_create_zones() 576 err = mlx4_zone_add_one(qp_table->zones, *bitmap + MLX4_QP_TABLE_ZONE_RSS, in mlx4_create_zones() 594 for (k = MLX4_QP_TABLE_ZONE_RSS + 1; k < sizeof(*bitmap)/sizeof((*bitmap)[0]); in mlx4_create_zones() 657 *bitmap + MLX4_QP_TABLE_ZONE_RSS, in mlx4_create_zones() 668 err = mlx4_bitmap_init(*bitmap + k, roundup_pow_of_two(size), in mlx4_create_zones() [all …]
|
| /freebsd/sys/cddl/contrib/opensolaris/uts/common/sys/ |
| H A D | bitmap.h | 84 #define BT_WIM(bitmap, bitindex) \ argument 85 ((bitmap)[(bitindex) >> BT_ULSHIFT]) 93 #define BT_WIM32(bitmap, bitindex) \ argument 94 ((bitmap)[(bitindex) >> BT_ULSHIFT32]) 109 #define BT_TEST(bitmap, bitindex) \ argument 110 ((BT_WIM((bitmap), (bitindex)) & BT_BIW(bitindex)) ? 1 : 0) 111 #define BT_SET(bitmap, bitindex) \ argument 112 { BT_WIM((bitmap), (bitindex)) |= BT_BIW(bitindex); } 113 #define BT_CLEAR(bitmap, bitindex) \ argument 114 { BT_WIM((bitmap), (bitindex)) &= ~BT_BIW(bitindex); } [all …]
|
| /freebsd/sys/cddl/compat/opensolaris/sys/ |
| H A D | bitmap.h | 71 #define BT_WIM(bitmap, bitindex) \ argument 72 ((bitmap)[(bitindex) >> BT_ULSHIFT]) 80 #define BT_WIM32(bitmap, bitindex) \ argument 81 ((bitmap)[(bitindex) >> BT_ULSHIFT32]) 96 #define BT_TEST(bitmap, bitindex) \ argument 97 ((BT_WIM((bitmap), (bitindex)) & BT_BIW(bitindex)) ? 1 : 0) 98 #define BT_SET(bitmap, bitindex) \ argument 99 { BT_WIM((bitmap), (bitindex)) |= BT_BIW(bitindex); } 100 #define BT_CLEAR(bitmap, bitindex) \ argument 101 { BT_WIM((bitmap), (bitindex)) &= ~BT_BIW(bitindex); } [all …]
|
| /freebsd/sys/dev/ice/ |
| H A D | ice_bitops.h | 65 static inline bool ice_is_bit_set_internal(u16 nr, const ice_bitmap_t *bitmap) in ice_is_bit_set_internal() argument 67 return !!(*bitmap & BIT(nr)); in ice_is_bit_set_internal() 83 static inline void ice_clear_bit_internal(u16 nr, ice_bitmap_t *bitmap) in ice_clear_bit_internal() argument 85 *bitmap &= ~BIT(nr); in ice_clear_bit_internal() 88 static inline void ice_set_bit_internal(u16 nr, ice_bitmap_t *bitmap) in ice_set_bit_internal() argument 90 *bitmap |= BIT(nr); in ice_set_bit_internal() 94 ice_bitmap_t *bitmap) in ice_test_and_clear_bit_internal() argument 96 if (ice_is_bit_set_internal(nr, bitmap)) { in ice_test_and_clear_bit_internal() 97 ice_clear_bit_internal(nr, bitmap); in ice_test_and_clear_bit_internal() 103 static inline bool ice_test_and_set_bit_internal(u16 nr, ice_bitmap_t *bitmap) in ice_test_and_set_bit_internal() argument [all …]
|
| /freebsd/contrib/jemalloc/include/jemalloc/internal/ |
| H A D | bit_util.h | 231 popcount_u_slow(unsigned bitmap) { 232 DO_POPCOUNT(bitmap, unsigned); 236 popcount_lu_slow(unsigned long bitmap) { 237 DO_POPCOUNT(bitmap, unsigned long); 241 popcount_llu_slow(unsigned long long bitmap) { 242 DO_POPCOUNT(bitmap, unsigned long long); 248 popcount_u(unsigned bitmap) { 250 return JEMALLOC_INTERNAL_POPCOUNT(bitmap); 252 return popcount_u_slow(bitmap); 257 popcount_lu(unsigned long bitmap) { 16 ffs_llu(unsigned long long bitmap) ffs_llu() argument 21 ffs_lu(unsigned long bitmap) ffs_lu() argument 26 ffs_u(unsigned bitmap) ffs_u() argument 32 popcount_lu(unsigned long bitmap) popcount_lu() argument 43 cfs_lu(unsigned long * bitmap) cfs_lu() argument 50 ffs_zu(size_t bitmap) ffs_zu() argument 63 ffs_u64(uint64_t bitmap) ffs_u64() argument 74 ffs_u32(uint32_t bitmap) ffs_u32() argument [all...] |
| H A D | bitmap.h | 10 /* Maximum bitmap bit count is 2^LG_BITMAP_MAXBITS. */ 12 /* Maximum bitmap bit count is determined by maximum regions per slab. */ 15 /* Maximum bitmap bit count is determined by number of extent size classes. */ 26 * Do some analysis on how big the bitmap is before we use a tree. For a brute 90 # error "Unsupported bitmap size" 152 /* Logical number of bits in bitmap (stored at bottom level). */ 171 void bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo, bool fill); 175 bitmap_full(bitmap_t *bitmap, const bitmap_info_t *binfo) { 178 bitmap_t rg = bitmap[rgoff]; in bitmap_full() 179 /* The bitmap i in bitmap_full() 176 bitmap_full(bitmap_t * bitmap,const bitmap_info_t * binfo) bitmap_full() argument 195 bitmap_get(bitmap_t * bitmap,const bitmap_info_t * binfo,size_t bit) bitmap_get() argument 206 bitmap_set(bitmap_t * bitmap,const bitmap_info_t * binfo,size_t bit) bitmap_set() argument 242 bitmap_ffu(const bitmap_t * bitmap,const bitmap_info_t * binfo,size_t min_bit) bitmap_ffu() argument 301 bitmap_sfu(bitmap_t * bitmap,const bitmap_info_t * binfo) bitmap_sfu() argument 331 bitmap_unset(bitmap_t * bitmap,const bitmap_info_t * binfo,size_t bit) bitmap_unset() argument [all...] |
| /freebsd/crypto/openssh/ |
| H A D | bitmap.h | 25 struct bitmap; 28 struct bitmap *bitmap_new(void); 31 void bitmap_free(struct bitmap *b); 34 void bitmap_zero(struct bitmap *b); 37 int bitmap_test_bit(struct bitmap *b, u_int n); 40 int bitmap_set_bit(struct bitmap *b, u_int n); 43 void bitmap_clear_bit(struct bitmap *b, u_int n); 46 size_t bitmap_nbits(struct bitmap *b); 49 size_t bitmap_nbytes(struct bitmap *b); 52 int bitmap_to_string(struct bitmap *b, void *p, size_t l); [all …]
|
| H A D | bitmap.c | 31 struct bitmap { struct 37 struct bitmap * argument 40 struct bitmap *ret; in bitmap_new() 54 bitmap_free(struct bitmap *b) in bitmap_free() 65 bitmap_zero(struct bitmap *b) in bitmap_zero() 72 bitmap_test_bit(struct bitmap *b, u_int n) in bitmap_test_bit() 82 reserve(struct bitmap *b, u_int n) in reserve() 101 bitmap_set_bit(struct bitmap *b, u_int n) in bitmap_set_bit() 117 retop(struct bitmap *b) in retop() 126 bitmap_clear_bit(struct bitmap *b, u_int n) in bitmap_clear_bit() [all …]
|
| /freebsd/usr.sbin/pw/ |
| H A D | bitmap.h | 34 struct bitmap struct 41 struct bitmap bm_alloc(int size); argument 42 void bm_dealloc(struct bitmap * bm); 43 void bm_setbit(struct bitmap * bm, int pos); 44 void bm_clrbit(struct bitmap * bm, int pos); 45 int bm_isset(struct bitmap * bm, int pos); 46 int bm_firstunset(struct bitmap * bm); 47 int bm_lastset(struct bitmap * bm);
|
| H A D | bitmap.c | 34 struct bitmap 37 struct bitmap bm; in bm_alloc() 48 bm_dealloc(struct bitmap * bm) in bm_dealloc() 61 bm_setbit(struct bitmap * bm, int pos) in bm_setbit() 70 bm_clrbit(struct bitmap * bm, int pos) in bm_clrbit() 79 bm_isset(struct bitmap * bm, int pos) in bm_isset() 88 bm_firstunset(struct bitmap * bm) in bm_firstunset() 109 bm_lastset(struct bitmap * bm) in bm_lastset()
|
| /freebsd/sys/contrib/openzfs/include/sys/ |
| H A D | bitmap.h | 66 #define BT_WIM(bitmap, bitindex) \ argument 67 ((bitmap)[(bitindex) >> BT_ULSHIFT]) 83 #define BT_TEST(bitmap, bitindex) \ argument 84 ((BT_WIM((bitmap), (bitindex)) & BT_BIW(bitindex)) ? 1 : 0) 85 #define BT_SET(bitmap, bitindex) \ argument 86 { BT_WIM((bitmap), (bitindex)) |= BT_BIW(bitindex); } 87 #define BT_CLEAR(bitmap, bitindex) \ argument 88 { BT_WIM((bitmap), (bitindex)) &= ~BT_BIW(bitindex); }
|
| /freebsd/contrib/unbound/testcode/ |
| H A D | unitverify.c | 379 unitest_nsec_has_type_rdata(char* bitmap, size_t len, uint16_t type) in unitest_nsec_has_type_rdata() argument 381 return nsecbitmap_has_type_rdata((uint8_t*)bitmap, len, type); in unitest_nsec_has_type_rdata() 390 char* bitmap = "\000\006\100\001\000\000\000\003" in nsectest() local 397 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 0)); in nsectest() 398 unit_assert(unitest_nsec_has_type_rdata(bitmap, len, LDNS_RR_TYPE_A)); in nsectest() 399 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 2)); in nsectest() 400 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 3)); in nsectest() 401 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 4)); in nsectest() 402 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 5)); in nsectest() 403 unit_assert(!unitest_nsec_has_type_rdata(bitmap, len, 6)); in nsectest() [all …]
|
| /freebsd/contrib/jemalloc/src/ |
| H A D | bitmap.c | 44 bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo, bool fill) { 49 * Bits are actually inverted with regard to the external bitmap in bitmap_init() 54 /* The "filled" bitmap starts out with all 0 bits. */ in bitmap_init() 55 memset(bitmap, 0, bitmap_size(binfo)); in bitmap_init() 60 * The "empty" bitmap starts out with all 1 bits, except for trailing in bitmap_init() 65 memset(bitmap, 0xffU, bitmap_size(binfo)); in bitmap_init() 69 bitmap[binfo->levels[1].group_offset - 1] >>= extra; in bitmap_init() 77 bitmap[binfo->levels[i+1].group_offset - 1] >>= extra; in bitmap_init() 99 bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo, bool fill) { 103 memset(bitmap, in bitmap_init() 45 bitmap_init(bitmap_t * bitmap,const bitmap_info_t * binfo,bool fill) bitmap_init() argument 100 bitmap_init(bitmap_t * bitmap,const bitmap_info_t * binfo,bool fill) bitmap_init() argument [all...] |
| /freebsd/sys/netpfil/ipfw/ |
| H A D | dn_sched_prio.c | 77 BITMAP_T bitmap; /* array bitmap */ member 91 if (test_bit(prio, &si->bitmap) == 0) { in prio_enqueue() 93 __set_bit(prio, &si->bitmap); in prio_enqueue() 122 if (si->bitmap == 0) /* scheduler idle */ in prio_dequeue() 125 prio = ffs(si->bitmap) - 1; in prio_dequeue() 137 __clear_bit(prio, &si->bitmap); in prio_dequeue() 148 si->bitmap = 0; in prio_new_sched() 176 if (test_bit(prio, &si->bitmap) == 0) { in prio_new_queue() 178 __set_bit(prio, &si->bitmap); in prio_new_queue() 204 __clear_bit(prio, &si->bitmap); in prio_free_queue()
|
| /freebsd/crypto/openssl/ssl/record/methods/ |
| H A D | dtls_meth.c | 40 static int dtls_record_replay_check(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap) in dtls_record_replay_check() argument 46 cmp = satsub64be(seq, bitmap->max_seq_num); in dtls_record_replay_check() 52 if (shift >= sizeof(bitmap->map) * 8) in dtls_record_replay_check() 54 else if (bitmap->map & ((uint64_t)1 << shift)) in dtls_record_replay_check() 62 DTLS_BITMAP *bitmap) in dtls_record_bitmap_update() argument 68 cmp = satsub64be(seq, bitmap->max_seq_num); in dtls_record_bitmap_update() 71 if (shift < sizeof(bitmap->map) * 8) in dtls_record_bitmap_update() 72 bitmap->map <<= shift, bitmap->map |= 1UL; in dtls_record_bitmap_update() 74 bitmap->map = 1UL; in dtls_record_bitmap_update() 75 memcpy(bitmap->max_seq_num, seq, SEQ_NUM_SIZE); in dtls_record_bitmap_update() [all …]
|
| /freebsd/contrib/wpa/src/common/ |
| H A D | hw_features_common.c | 384 static void punct_update_legacy_bw_80(u8 bitmap, u8 pri_chan, u8 *seg0) in punct_update_legacy_bw_80() argument 388 switch (bitmap) { in punct_update_legacy_bw_80() 410 if (bitmap & BIT((sec_chan - first_chan) / 4)) in punct_update_legacy_bw_80() 415 static void punct_update_legacy_bw_160(u8 bitmap, u8 pri, in punct_update_legacy_bw_160() argument 420 if (bitmap & 0x0F) { in punct_update_legacy_bw_160() 422 punct_update_legacy_bw_80(bitmap & 0xF, pri, seg0); in punct_update_legacy_bw_160() 426 if (bitmap & 0xF0) { in punct_update_legacy_bw_160() 428 punct_update_legacy_bw_80((bitmap & 0xF0) >> 4, pri, in punct_update_legacy_bw_160() 435 void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width, in punct_update_legacy_bw() argument 438 if (*width == CONF_OPER_CHWIDTH_80MHZ && (bitmap & 0xF)) { in punct_update_legacy_bw() [all …]
|
| /freebsd/sys/compat/linuxkpi/common/src/ |
| H A D | linux_idr.c | 244 il->bitmap |= 1 << idx; in idr_remove_locked() 254 if (il == NULL || (il->bitmap & (1 << idx)) != 0) in idr_remove_locked() 259 il->bitmap |= 1 << idx; in idr_remove_locked() 306 if (il == NULL || (il->bitmap & (1 << idx))) { in idr_replace() 379 bitmap_fill(&iln->bitmap, IDR_SIZE); in idr_pre_get() 413 MPASS(il->bitmap != 0); in idr_get() 415 bitmap_fill(&il->bitmap, IDR_SIZE); in idr_get() 417 bitmap_fill(&il->bitmap, IDR_SIZE); in idr_get() 444 if (idr->top == NULL || idr->top->bitmap == 0) { in idr_get_new_locked() 454 il->bitmap &= ~1; in idr_get_new_locked() [all …]
|
| /freebsd/sys/dev/mlx5/mlx5_core/ |
| H A D | mlx5_mpfs.c | 60 index = find_first_zero_bit(dev->mpfs.bitmap, l2table_size); in mlx5_mpfs_add_mac() 62 set_bit(index, dev->mpfs.bitmap); in mlx5_mpfs_add_mac() 79 clear_bit(index, dev->mpfs.bitmap); in mlx5_mpfs_add_mac() 106 clear_bit(index, dev->mpfs.bitmap); in mlx5_mpfs_del_mac() 117 bitmap_zero(dev->mpfs.bitmap, MLX5_MPFS_TABLE_MAX); in mlx5_mpfs_init() 126 num = bitmap_weight(dev->mpfs.bitmap, MLX5_MPFS_TABLE_MAX); in mlx5_mpfs_destroy()
|
| /freebsd/contrib/wpa/src/ap/ |
| H A D | p2p_hostapd.c | 96 u8 bitmap; in hostapd_eid_p2p_manage() local 105 bitmap = P2P_MAN_DEVICE_MANAGEMENT; in hostapd_eid_p2p_manage() 107 bitmap |= P2P_MAN_CROSS_CONNECTION_PERMITTED; in hostapd_eid_p2p_manage() 108 bitmap |= P2P_MAN_COEXISTENCE_OPTIONAL; in hostapd_eid_p2p_manage() 109 *eid++ = bitmap; in hostapd_eid_p2p_manage()
|
| /freebsd/contrib/file/magic/Magdir/ |
| H A D | jpeg | 108 # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-hsi1.trid.xml 109 # Note: called by TrID "HSI JPEG bitmap" 125 # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-jpeg2k.trid.xml 126 # Note: called by TrID "JPEG 2000 bitmap" 132 # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-jpx.trid.xml 133 # Note: called by TrID "JPEG 2000 eXtended bitmap" 138 # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-jpm.trid.xml 139 # Note: called by TrID "JPEG 2000 eXtended bitmap" 154 # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-jpc.trid.xml 155 # Note: called by TrID "JPEG-2000 Code Stream bitmap" [all …]
|
| /freebsd/sys/compat/linuxkpi/common/include/linux/ |
| H A D | bitmap.h | 175 bitmap_find_free_region(unsigned long *bitmap, int bits, int order) in bitmap_find_free_region() argument 181 if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE)) in bitmap_find_free_region() 183 linux_reg_op(bitmap, pos, order, REG_OP_ALLOC); in bitmap_find_free_region() 190 bitmap_allocate_region(unsigned long *bitmap, int pos, int order) in bitmap_allocate_region() argument 192 if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE)) in bitmap_allocate_region() 194 linux_reg_op(bitmap, pos, order, REG_OP_ALLOC); in bitmap_allocate_region() 199 bitmap_release_region(unsigned long *bitmap, int pos, int order) in bitmap_release_region() argument 201 linux_reg_op(bitmap, pos, order, REG_OP_RELEASE); in bitmap_release_region() 445 bitmap_free(const unsigned long *bitmap) in bitmap_free() argument 447 kfree(bitmap); in bitmap_free()
|
| /freebsd/sys/compat/linux/ |
| H A D | linux.c | 460 bsd_to_linux_bits_(int value, struct bsd_to_linux_bitmap *bitmap, in bsd_to_linux_bits_() argument 471 bsd_mask = bitmap[i].bsd_mask; in bsd_to_linux_bits_() 472 bsd_value = bitmap[i].bsd_value; in bsd_to_linux_bits_() 476 linux_mask = bitmap[i].linux_mask; in bsd_to_linux_bits_() 477 linux_value = bitmap[i].linux_value; in bsd_to_linux_bits_() 498 linux_to_bsd_bits_(int value, struct bsd_to_linux_bitmap *bitmap, in linux_to_bsd_bits_() argument 509 bsd_mask = bitmap[i].bsd_mask; in linux_to_bsd_bits_() 510 bsd_value = bitmap[i].bsd_value; in linux_to_bsd_bits_() 514 linux_mask = bitmap[i].linux_mask; in linux_to_bsd_bits_() 515 linux_value = bitmap[i].linux_value; in linux_to_bsd_bits_()
|