bitops.h (e5451c8f8330e03ad3cfa16048b4daf961af434f) bitops.h (12c8007dafbb7a9719d7beb04b79c9406c265f47)
1/*
2 * include/asm-xtensa/bitops.h
3 *
4 * Atomic operations that C can't guarantee us.Useful for resource counting etc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.

--- 34 unchanged lines hidden (view full) ---

43{
44 return 31 - __cntlz(~x & -~x);
45}
46
47/*
48 * __ffs: Find first bit set in word. Return 0 for bit 0
49 */
50
1/*
2 * include/asm-xtensa/bitops.h
3 *
4 * Atomic operations that C can't guarantee us.Useful for resource counting etc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.

--- 34 unchanged lines hidden (view full) ---

43{
44 return 31 - __cntlz(~x & -~x);
45}
46
47/*
48 * __ffs: Find first bit set in word. Return 0 for bit 0
49 */
50
51static inline int __ffs(unsigned long x)
51static inline unsigned long __ffs(unsigned long x)
52{
53 return 31 - __cntlz(x & -x);
54}
55
56/*
57 * ffs: Find first bit set in word. This is defined the same way as
58 * the libc and compiler builtin ffs routines, therefore
59 * differs in spirit from the above ffz (man ffs).

--- 178 unchanged lines hidden ---
52{
53 return 31 - __cntlz(x & -x);
54}
55
56/*
57 * ffs: Find first bit set in word. This is defined the same way as
58 * the libc and compiler builtin ffs routines, therefore
59 * differs in spirit from the above ffz (man ffs).

--- 178 unchanged lines hidden ---