• Home
  • Raw
  • Download

Lines Matching +full:value +full:- +full:start

1 /* SPDX-License-Identifier: GPL-2.0 */
9 # define aligned_byte_mask(n) ((1UL << 8*(n))-1)
11 # define aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))
36 /* same as for_each_set_bit() but use bit as value to start with */
47 /* same as for_each_clear_bit() but use bit as value to start with */
54 * for_each_set_clump8 - iterate over bitmap for each 8-bit clump with set bits
55 * @start: bit offset to start search and to store the current iteration offset
56 * @clump: location to store copy of current 8-bit clump
60 #define for_each_set_clump8(start, clump, bits, size) \ argument
61 for ((start) = find_first_clump8(&(clump), (bits), (size)); \
62 (start) < (size); \
63 (start) = find_next_clump8(&(clump), (bits), (size), (start) + 8))
70 return order; /* We could be slightly more clever with -1 here... */ in get_bitmask_order()
79 * rol64 - rotate a 64-bit value left
80 * @word: value to rotate
85 return (word << (shift & 63)) | (word >> ((-shift) & 63)); in rol64()
89 * ror64 - rotate a 64-bit value right
90 * @word: value to rotate
95 return (word >> (shift & 63)) | (word << ((-shift) & 63)); in ror64()
99 * rol32 - rotate a 32-bit value left
100 * @word: value to rotate
105 return (word << (shift & 31)) | (word >> ((-shift) & 31)); in rol32()
109 * ror32 - rotate a 32-bit value right
110 * @word: value to rotate
115 return (word >> (shift & 31)) | (word << ((-shift) & 31)); in ror32()
119 * rol16 - rotate a 16-bit value left
120 * @word: value to rotate
125 return (word << (shift & 15)) | (word >> ((-shift) & 15)); in rol16()
129 * ror16 - rotate a 16-bit value right
130 * @word: value to rotate
135 return (word >> (shift & 15)) | (word << ((-shift) & 15)); in ror16()
139 * rol8 - rotate an 8-bit value left
140 * @word: value to rotate
145 return (word << (shift & 7)) | (word >> ((-shift) & 7)); in rol8()
149 * ror8 - rotate an 8-bit value right
150 * @word: value to rotate
155 return (word >> (shift & 7)) | (word << ((-shift) & 7)); in ror8()
159 * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit
160 * @value: value to sign extend
163 * This is safe to use for 16- and 8-bit types as well.
165 static __always_inline __s32 sign_extend32(__u32 value, int index) in sign_extend32() argument
167 __u8 shift = 31 - index; in sign_extend32()
168 return (__s32)(value << shift) >> shift; in sign_extend32()
172 * sign_extend64 - sign extend a 64-bit value using specified bit as sign-bit
173 * @value: value to sign extend
176 static __always_inline __s64 sign_extend64(__u64 value, int index) in sign_extend64() argument
178 __u8 shift = 63 - index; in sign_extend64()
179 return (__s64)(value << shift) >> shift; in sign_extend64()
192 return -1; in get_count_order()
194 return fls(--count); in get_count_order()
198 * get_count_order_long - get order after rounding @l up to power of 2
206 return -1; in get_count_order_long()
207 return (int)fls_long(--l); in get_count_order_long()
211 * __ffs64 - find first set bit in a 64 bit word
216 * is non-zero before calling this.
230 * assign_bit - Assign value to a bit in memory
232 * @addr: the address to start counting from
233 * @value: the value to assign
236 bool value) in assign_bit() argument
238 if (value) in assign_bit()
245 bool value) in __assign_bit() argument
247 if (value) in __assign_bit()
288 * find_last_bit - find the last set bit in a memory region
289 * @addr: The address to start the search at