#include <ntifs.h>
#include <linux/types.h>
Go to the source code of this file.
◆ ffz
find_next_bit - find the next set bit in a memory region @addr: The address to base the search on @offset: The bitnumber to start searching at @size: The maximum size to search
Definition at line 109 of file bitops.h.
◆ find_first_zero_bit
find_first_zero_bit - find the first zero bit in a memory region @addr: The address to start the search at @size: The maximum size to search
Returns the bit number of the first zero bit, not the number of the byte containing a bit.
Definition at line 28 of file bitops.h.
◆ for_each_bit
Value:
(bit) = find_next_bit((
addr), (
size), (bit) + 1))
static unsigned find_first_bit(const unsigned long *addr, unsigned size)
GLenum const GLvoid * addr
Definition at line 194 of file bitops.h.
◆ __ffs()
__ffs - find first bit in word. @word: The word to search
Undefined if no bit exists, so code should check against 0 first.
Definition at line 44 of file bitops.h.
45{
47
48#if BITS_PER_LONG == 64
49 if ((
word & 0xffffffff) == 0) {
52 }
53#endif
54 if ((
word & 0xffff) == 0) {
57 }
58 if ((
word & 0xff) == 0) {
61 }
62 if ((
word & 0xf) == 0) {
65 }
66 if ((
word & 0x3) == 0) {
69 }
70 if ((
word & 0x1) == 0)
73}
Referenced by find_first_bit().
◆ ffs()
ffs - find first bit set @x: the word to search
This is defined the same way as the libc and compiler builtin ffs routines, therefore differs in spirit from the above ffz (man ffs).
Definition at line 120 of file bitops.h.
121{
123
125 return 0;
129 }
133 }
137 }
141 }
145 }
147}
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLdouble r
◆ find_first_bit()
find_first_bit - find the first set bit in a memory region @addr: The address to start the search at @size: The maximum size to search
Returns the bit number of the first set bit, not the number of the byte containing a bit.
Definition at line 83 of file bitops.h.
84{
86
91 x += (
sizeof(*addr)<<3);
92 }
94}
static unsigned long __ffs(unsigned long word)
◆ find_next_zero_bit()
find_next_zero_bit - find the first zero bit in a memory region @addr: The address to base the search on @offset: The bit number to start searching at @size: The maximum size to search
◆ fls()
fls - find last (most-significant) bit set @x: the word to search
This is defined the same way as ffs. Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
Definition at line 157 of file bitops.h.
158{
160
162 return 0;
163 if (!(
x & 0xffff0000u)) {
166 }
167 if (!(
x & 0xff000000u)) {
170 }
171 if (!(
x & 0xf0000000u)) {
174 }
175 if (!(
x & 0xc0000000u)) {
178 }
179 if (!(
x & 0x80000000u)) {
182 }
184}
Referenced by __attribute__(), adns__findlabel_next(), adns__findlabel_start(), adns__findrr_anychk(), adns__mkquery_frdgram(), adns__parse_domain(), adns__parse_domain_more(), fls64(), fls_long(), get_bitmask_order(), get_count_order(), pa_ptr(), pap_mailbox822(), test_FiberLocalStorage(), and test_FiberLocalStorageCallback().
◆ fls64()
Definition at line 186 of file bitops.h.
187{
192}
GLfloat GLfloat GLfloat GLfloat h
Referenced by fls_long().
◆ fls_long()
Definition at line 239 of file bitops.h.
240{
244}
static int fls64(__u64 x)
◆ get_bitmask_order()
Definition at line 200 of file bitops.h.
201{
203
206}
GLuint GLuint GLsizei count
GLuint GLdouble GLdouble GLint GLint order
◆ get_count_order()
◆ hweight32()
Definition at line 251 of file bitops.h.
252{
253 unsigned int res = (
w & 0x55555555) + ((
w >> 1) & 0x55555555);
254 res = (
res & 0x33333333) + ((
res >> 2) & 0x33333333);
255 res = (
res & 0x0F0F0F0F) + ((
res >> 4) & 0x0F0F0F0F);
256 res = (
res & 0x00FF00FF) + ((
res >> 8) & 0x00FF00FF);
257 return (
res & 0x0000FFFF) + ((
res >> 16) & 0x0000FFFF);
258}
GLubyte GLubyte GLubyte GLubyte w
Referenced by hweight64(), and hweight_long().
◆ hweight64()
Definition at line 260 of file bitops.h.
261{
262#if BITS_PER_LONG < 64
264#else
266 res = (
w & 0x5555555555555555U) + ((
w >> 1) & 0x5555555555555555U);
267 res = (
res & 0x3333333333333333U) + ((
res >> 2) & 0x3333333333333333U);
268 res = (
res & 0x0F0F0F0F0F0F0F0FU) + ((
res >> 4) & 0x0F0F0F0F0F0F0F0FU);
269 res = (
res & 0x00FF00FF00FF00FFU) + ((
res >> 8) & 0x00FF00FF00FF00FFU);
270 res = (
res & 0x0000FFFF0000FFFFU) + ((
res >> 16) & 0x0000FFFF0000FFFFU);
271 return (
res & 0x00000000FFFFFFFFU) + ((
res >> 32) & 0x00000000FFFFFFFFU);
272#endif
273}
static unsigned long hweight32(unsigned long w)
Referenced by hweight_long().
◆ hweight_long()
Definition at line 275 of file bitops.h.
276{
278}
static unsigned long hweight64(__u64 w)
◆ rol32()
rol32 - rotate a 32-bit value left @word: value to rotate @shift: bits to roll
Definition at line 224 of file bitops.h.
◆ ror32()
ror32 - rotate a 32-bit value right @word: value to rotate @shift: bits to roll
Definition at line 234 of file bitops.h.