• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _ASM_GENERIC_BITOPS_LE_H_
13 #define _ASM_GENERIC_BITOPS_LE_H_
14 
15 #include <asm/types.h>
16 #include <asm/byteorder.h>
17 
18 #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
19 #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
20 
21 #ifdef __LITTLE_ENDIAN
22 
23 #define generic_test_le_bit(nr, addr) test_bit(nr, addr)
24 #define generic___set_le_bit(nr, addr) __set_bit(nr, addr)
25 #define generic___clear_le_bit(nr, addr) __clear_bit(nr, addr)
26 
27 #define generic_test_and_set_le_bit(nr, addr) test_and_set_bit(nr, addr)
28 #define generic_test_and_clear_le_bit(nr, addr) test_and_clear_bit(nr, addr)
29 
30 #define generic___test_and_set_le_bit(nr, addr) __test_and_set_bit(nr, addr)
31 #define generic___test_and_clear_le_bit(nr, addr) __test_and_clear_bit(nr, addr)
32 
33 #define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset)
34 
35 #elif defined(__BIG_ENDIAN)
36 
37 #define generic_test_le_bit(nr, addr)   test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
38 #define generic___set_le_bit(nr, addr)   __set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
39 #define generic___clear_le_bit(nr, addr)   __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
40 
41 #define generic_test_and_set_le_bit(nr, addr)   test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
42 #define generic_test_and_clear_le_bit(nr, addr)   test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
43 
44 #define generic___test_and_set_le_bit(nr, addr)   __test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
45 #define generic___test_and_clear_le_bit(nr, addr)   __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
46 
47 #else
48 #error "Please fix <asm/byteorder.h>"
49 #endif
50 
51 #define generic_find_first_zero_le_bit(addr, size)   generic_find_next_zero_le_bit((addr), (size), 0)
52 
53 #endif
54