]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blob - libc/kernel/common/asm-generic/bitops/le.h
Initial Contribution
[android-sdk/platform-bionic.git] / libc / kernel / common / asm-generic / bitops / le.h
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_
15 #include <asm/types.h>
16 #include <asm/byteorder.h>
18 #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
19 #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
21 #ifdef __LITTLE_ENDIAN
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)
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)
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)
33 #define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset)
35 #elif defined(__BIG_ENDIAN)
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))
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))
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))
47 #else
48 #error "Please fix <asm/byteorder.h>"
49 #endif
51 #define generic_find_first_zero_le_bit(addr, size)   generic_find_next_zero_le_bit((addr), (size), 0)
53 #endif