/openbmc/qemu/tests/unit/ |
H A D | test-bitmap.c | 28 total = BITS_PER_LONG * 4; in check_bitmap_copy_with_offset() 37 g_assert_cmpmem(bmap1, total / BITS_PER_LONG, in check_bitmap_copy_with_offset() 38 bmap2, total / BITS_PER_LONG); in check_bitmap_copy_with_offset() 70 for (offset = 0; offset <= BITS_PER_LONG; offset++) { in bitmap_set_case() 72 set_func(bmap, BITS_PER_LONG + offset, 1); in bitmap_set_case() 73 g_assert_cmpint(find_first_bit(bmap, 2 * BITS_PER_LONG), in bitmap_set_case() 74 ==, BITS_PER_LONG + offset); in bitmap_set_case() 76 3 * BITS_PER_LONG, in bitmap_set_case() 77 BITS_PER_LONG + offset), in bitmap_set_case() 78 ==, BITS_PER_LONG + offset + 1); in bitmap_set_case() [all …]
|
/openbmc/qemu/util/ |
H A D | bitops.c | 24 unsigned long result = offset & ~(BITS_PER_LONG-1); in find_next_bit() 31 offset %= BITS_PER_LONG; in find_next_bit() 35 if (size < BITS_PER_LONG) { in find_next_bit() 41 size -= BITS_PER_LONG; in find_next_bit() 42 result += BITS_PER_LONG; in find_next_bit() 44 while (size >= 4*BITS_PER_LONG) { in find_next_bit() 57 result += 4*BITS_PER_LONG; in find_next_bit() 58 size -= 4*BITS_PER_LONG; in find_next_bit() 60 while (size >= BITS_PER_LONG) { in find_next_bit() 64 result += BITS_PER_LONG; in find_next_bit() [all …]
|
H A D | bitmap.c | 43 long k, lim = bits/BITS_PER_LONG; in slow_bitmap_empty() 50 if (bits % BITS_PER_LONG) { in slow_bitmap_empty() 61 long k, lim = bits/BITS_PER_LONG; in slow_bitmap_full() 69 if (bits % BITS_PER_LONG) { in slow_bitmap_full() 81 long k, lim = bits/BITS_PER_LONG; in slow_bitmap_equal() 89 if (bits % BITS_PER_LONG) { in slow_bitmap_equal() 101 long k, lim = bits/BITS_PER_LONG; in slow_bitmap_complement() 107 if (bits % BITS_PER_LONG) { in slow_bitmap_complement() 164 int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); in bitmap_set() 172 bits_to_set = BITS_PER_LONG; in bitmap_set() [all …]
|
/openbmc/linux/arch/s390/lib/ |
H A D | find.c | 23 while (size & ~(BITS_PER_LONG - 1)) { in find_first_bit_inv() 26 result += BITS_PER_LONG; in find_first_bit_inv() 27 size -= BITS_PER_LONG; in find_first_bit_inv() 31 tmp = (*p) & (~0UL << (BITS_PER_LONG - size)); in find_first_bit_inv() 35 return result + (__fls(tmp) ^ (BITS_PER_LONG - 1)); in find_first_bit_inv() 42 const unsigned long *p = addr + (offset / BITS_PER_LONG); in find_next_bit_inv() 43 unsigned long result = offset & ~(BITS_PER_LONG - 1); in find_next_bit_inv() 49 offset %= BITS_PER_LONG; in find_next_bit_inv() 53 if (size < BITS_PER_LONG) in find_next_bit_inv() 57 size -= BITS_PER_LONG; in find_next_bit_inv() [all …]
|
/openbmc/linux/lib/ |
H A D | bitmap.c | 51 unsigned int k, lim = bits/BITS_PER_LONG; in __bitmap_equal() 56 if (bits % BITS_PER_LONG) in __bitmap_equal() 69 unsigned int k, lim = bits / BITS_PER_LONG; in __bitmap_or_equal() 77 if (!(bits % BITS_PER_LONG)) in __bitmap_or_equal() 107 unsigned off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG; in __bitmap_shift_right() 122 upper <<= (BITS_PER_LONG - rem); in __bitmap_shift_right() 153 unsigned int off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG; in __bitmap_shift_left() 162 lower = src[k - 1] >> (BITS_PER_LONG - rem); in __bitmap_shift_left() 217 if (first % BITS_PER_LONG) { in bitmap_cut() 218 keep = src[first / BITS_PER_LONG] & in bitmap_cut() [all …]
|
H A D | find_bit.c | 32 for (idx = 0; idx * BITS_PER_LONG < sz; idx++) { \ 35 sz = min(idx * BITS_PER_LONG + __ffs(MUNGE(val)), sz); \ 58 idx = __start / BITS_PER_LONG; \ 61 if ((idx + 1) * BITS_PER_LONG >= sz) \ 66 sz = min(idx * BITS_PER_LONG + __ffs(MUNGE(tmp)), sz); \ 75 for (idx = 0; (idx + 1) * BITS_PER_LONG <= sz; idx++) { \ 76 if (idx * BITS_PER_LONG + nr >= sz) \ 87 if (sz % BITS_PER_LONG) \ 90 sz = min(idx * BITS_PER_LONG + fns(tmp, nr), sz); \ 208 unsigned long idx = (size-1) / BITS_PER_LONG; in _find_last_bit() [all …]
|
/openbmc/linux/arch/s390/include/asm/ |
H A D | bitops.h | 42 #define __BITOPS_WORDS(bits) (((bits) + BITS_PER_LONG - 1) / BITS_PER_LONG) 49 addr = (unsigned long)ptr + ((nr ^ (nr & (BITS_PER_LONG - 1))) >> 3); in __bitops_word() 55 return 1UL << (nr & (BITS_PER_LONG - 1)); in __bitops_mask() 224 return set_bit(nr ^ (BITS_PER_LONG - 1), ptr); in set_bit_inv() 229 return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in clear_bit_inv() 235 return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in test_and_clear_bit_inv() 240 return __set_bit(nr ^ (BITS_PER_LONG - 1), ptr); in __set_bit_inv() 245 return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in __clear_bit_inv() 251 return test_bit(nr ^ (BITS_PER_LONG - 1), ptr); in test_bit_inv() 313 return __flogr(-word & word) ^ (BITS_PER_LONG - 1); in __ffs() [all …]
|
/openbmc/linux/arch/mips/include/asm/ |
H A D | bitops.h | 91 int bit = nr % BITS_PER_LONG; in set_bit() 119 int bit = nr % BITS_PER_LONG; in clear_bit() 160 int bit = nr % BITS_PER_LONG; in change_bit() 182 int bit = nr % BITS_PER_LONG; in test_and_set_bit_lock() 226 int bit = nr % BITS_PER_LONG; in test_and_clear_bit() 263 int bit = nr % BITS_PER_LONG; in test_and_change_bit() 311 if (BITS_PER_LONG == 32 && !__builtin_constant_p(word) && in __fls() 324 if (BITS_PER_LONG == 64 && !__builtin_constant_p(word) && in __fls() 337 num = BITS_PER_LONG - 1; in __fls() 339 #if BITS_PER_LONG == 64 in __fls() [all …]
|
/openbmc/linux/include/asm-generic/bitops/ |
H A D | __fls.h | 15 int num = BITS_PER_LONG - 1; in __fls() 17 #if BITS_PER_LONG == 64 in __fls() 23 if (!(word & (~0ul << (BITS_PER_LONG-16)))) { in __fls() 27 if (!(word & (~0ul << (BITS_PER_LONG-8)))) { in __fls() 31 if (!(word & (~0ul << (BITS_PER_LONG-4)))) { in __fls() 35 if (!(word & (~0ul << (BITS_PER_LONG-2)))) { in __fls() 39 if (!(word & (~0ul << (BITS_PER_LONG-1)))) in __fls()
|
/openbmc/u-boot/include/asm-generic/bitops/ |
H A D | __fls.h | 14 int num = BITS_PER_LONG - 1; in __fls() 16 #if BITS_PER_LONG == 64 in __fls() 22 if (!(word & (~0ul << (BITS_PER_LONG-16)))) { in __fls() 26 if (!(word & (~0ul << (BITS_PER_LONG-8)))) { in __fls() 30 if (!(word & (~0ul << (BITS_PER_LONG-4)))) { in __fls() 34 if (!(word & (~0ul << (BITS_PER_LONG-2)))) { in __fls() 38 if (!(word & (~0ul << (BITS_PER_LONG-1)))) in __fls()
|
/openbmc/linux/tools/include/asm-generic/bitops/ |
H A D | __fls.h | 15 int num = BITS_PER_LONG - 1; in __fls() 17 #if BITS_PER_LONG == 64 in __fls() 23 if (!(word & (~0ul << (BITS_PER_LONG-16)))) { in __fls() 27 if (!(word & (~0ul << (BITS_PER_LONG-8)))) { in __fls() 31 if (!(word & (~0ul << (BITS_PER_LONG-4)))) { in __fls() 35 if (!(word & (~0ul << (BITS_PER_LONG-2)))) { in __fls() 39 if (!(word & (~0ul << (BITS_PER_LONG-1)))) in __fls()
|
/openbmc/u-boot/drivers/mtd/nand/ |
H A D | bbt.c | 30 BITS_PER_LONG); in nanddev_bbt_init() 80 ((entry * bits_per_block) / BITS_PER_LONG); in nanddev_bbt_get_block_status() 81 unsigned int offs = (entry * bits_per_block) % BITS_PER_LONG; in nanddev_bbt_get_block_status() 88 if (bits_per_block + offs > BITS_PER_LONG) in nanddev_bbt_get_block_status() 89 status |= pos[1] << (BITS_PER_LONG - offs); in nanddev_bbt_get_block_status() 113 ((entry * bits_per_block) / BITS_PER_LONG); in nanddev_bbt_set_block_status() 114 unsigned int offs = (entry * bits_per_block) % BITS_PER_LONG; in nanddev_bbt_set_block_status() 123 if (bits_per_block + offs > BITS_PER_LONG) { in nanddev_bbt_set_block_status() 124 unsigned int rbits = bits_per_block + offs - BITS_PER_LONG; in nanddev_bbt_set_block_status()
|
/openbmc/linux/drivers/mtd/nand/ |
H A D | bbt.c | 76 ((entry * bits_per_block) / BITS_PER_LONG); in nanddev_bbt_get_block_status() 77 unsigned int offs = (entry * bits_per_block) % BITS_PER_LONG; in nanddev_bbt_get_block_status() 84 if (bits_per_block + offs > BITS_PER_LONG) in nanddev_bbt_get_block_status() 85 status |= pos[1] << (BITS_PER_LONG - offs); in nanddev_bbt_get_block_status() 109 ((entry * bits_per_block) / BITS_PER_LONG); in nanddev_bbt_set_block_status() 110 unsigned int offs = (entry * bits_per_block) % BITS_PER_LONG; in nanddev_bbt_set_block_status() 119 if (bits_per_block + offs > BITS_PER_LONG) { in nanddev_bbt_set_block_status() 120 unsigned int rbits = bits_per_block + offs - BITS_PER_LONG; in nanddev_bbt_set_block_status()
|
/openbmc/u-boot/arch/arm/include/asm/ |
H A D | bitops.h | 117 unsigned long *p = ((unsigned long *)addr) + (offset / BITS_PER_LONG); in find_next_zero_bit() 118 unsigned long result = offset & ~(BITS_PER_LONG - 1); in find_next_zero_bit() 124 offset &= (BITS_PER_LONG - 1); in find_next_zero_bit() 127 tmp |= ~0UL >> (BITS_PER_LONG - offset); in find_next_zero_bit() 128 if (size < BITS_PER_LONG) in find_next_zero_bit() 132 size -= BITS_PER_LONG; in find_next_zero_bit() 133 result += BITS_PER_LONG; in find_next_zero_bit() 135 while (size & ~(BITS_PER_LONG - 1)) { in find_next_zero_bit() 139 result += BITS_PER_LONG; in find_next_zero_bit() 140 size -= BITS_PER_LONG; in find_next_zero_bit()
|
/openbmc/linux/tools/lib/ |
H A D | bitmap.c | 10 unsigned int k, w = 0, lim = bits/BITS_PER_LONG; in __bitmap_weight() 15 if (bits % BITS_PER_LONG) in __bitmap_weight() 64 unsigned int lim = bits/BITS_PER_LONG; in __bitmap_and() 69 if (bits % BITS_PER_LONG) in __bitmap_and() 78 unsigned int k, lim = bits/BITS_PER_LONG; in __bitmap_equal() 83 if (bits % BITS_PER_LONG) in __bitmap_equal() 93 unsigned int k, lim = bits/BITS_PER_LONG; in __bitmap_intersects() 98 if (bits % BITS_PER_LONG) in __bitmap_intersects()
|
H A D | find_bit.c | 31 for (idx = 0; idx * BITS_PER_LONG < sz; idx++) { \ 34 sz = min(idx * BITS_PER_LONG + __ffs(MUNGE(val)), sz); \ 57 idx = __start / BITS_PER_LONG; \ 60 if ((idx + 1) * BITS_PER_LONG >= sz) \ 65 sz = min(idx * BITS_PER_LONG + __ffs(MUNGE(tmp)), sz); \
|
/openbmc/linux/drivers/firmware/efi/libstub/ |
H A D | bitmap.c | 7 int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); in __bitmap_set() 13 bits_to_set = BITS_PER_LONG; in __bitmap_set() 27 int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); in __bitmap_clear() 33 bits_to_clear = BITS_PER_LONG; in __bitmap_clear()
|
/openbmc/linux/drivers/reset/ |
H A D | reset-zynq.c | 34 int bank = id / BITS_PER_LONG; in zynq_reset_assert() 35 int offset = id % BITS_PER_LONG; in zynq_reset_assert() 51 int bank = id / BITS_PER_LONG; in zynq_reset_deassert() 52 int offset = id % BITS_PER_LONG; in zynq_reset_deassert() 68 int bank = id / BITS_PER_LONG; in zynq_reset_status() 69 int offset = id % BITS_PER_LONG; in zynq_reset_status() 114 priv->rcdev.nr_resets = resource_size(res) / 4 * BITS_PER_LONG; in zynq_reset_probe()
|
/openbmc/linux/arch/mips/lib/ |
H A D | bitops.c | 24 unsigned int bit = nr % BITS_PER_LONG; in __mips_set_bit() 45 unsigned int bit = nr % BITS_PER_LONG; in __mips_clear_bit() 66 unsigned int bit = nr % BITS_PER_LONG; in __mips_change_bit() 88 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_set_bit_lock() 112 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_clear_bit() 136 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_change_bit()
|
/openbmc/linux/include/asm-generic/ |
H A D | bitsperlong.h | 9 #define BITS_PER_LONG 64 macro 11 #define BITS_PER_LONG 32 macro 18 #if 0 && BITS_PER_LONG != __BITS_PER_LONG 36 (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)
|
/openbmc/linux/tools/include/asm-generic/ |
H A D | bitsperlong.h | 8 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__) macro 10 #define BITS_PER_LONG __WORDSIZE macro 13 #if BITS_PER_LONG != __BITS_PER_LONG 22 (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)
|
/openbmc/linux/include/linux/ |
H A D | bitmap.h | 241 #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) 242 #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) 244 #define bitmap_size(nbits) (ALIGN(nbits, BITS_PER_LONG) / BITS_PER_BYTE) 284 if (nbits % BITS_PER_LONG) in bitmap_copy_clear_tail() 285 dst[nbits / BITS_PER_LONG] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_copy_clear_tail() 295 if (count % BITS_PER_LONG) in bitmap_copy_and_extend() 308 #if BITS_PER_LONG == 64 326 #if BITS_PER_LONG == 32 599 const unsigned long offset = start % BITS_PER_LONG; in bitmap_get_value8() 614 const unsigned long offset = start % BITS_PER_LONG; in bitmap_set_value8() [all …]
|
H A D | hmm.h | 36 HMM_PFN_VALID = 1UL << (BITS_PER_LONG - 1), 37 HMM_PFN_WRITE = 1UL << (BITS_PER_LONG - 2), 38 HMM_PFN_ERROR = 1UL << (BITS_PER_LONG - 3), 39 HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG - 8),
|
/openbmc/u-boot/include/linux/ |
H A D | bitops.h | 11 #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) 12 #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) 29 (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) 173 #if BITS_PER_LONG == 32 in __ffs64() 176 #elif BITS_PER_LONG != 64 in __ffs64() 177 #error BITS_PER_LONG not 32 or 64 in __ffs64()
|
/openbmc/linux/drivers/scsi/megaraid/ |
H A D | megaraid_mm.h | 71 #if BITS_PER_LONG == 32 75 #if BITS_PER_LONG == 64 85 #if BITS_PER_LONG == 32 89 #if BITS_PER_LONG == 64
|