![Akinobu Mita](/assets/img/avatar_default.png)
This patch introduces the C-language equivalents of the functions below: int ext2_set_bit(int nr, volatile unsigned long *addr); int ext2_clear_bit(int nr, volatile unsigned long *addr); int ext2_test_bit(int nr, const volatile unsigned long *addr); unsigned long ext2_find_first_zero_bit(const unsigned long *addr, unsigned long size); unsinged long ext2_find_next_zero_bit(const unsigned long *addr, unsigned long size); In include/asm-generic/bitops/ext2-non-atomic.h This code largely copied from: include/asm-powerpc/bitops.h include/asm-parisc/bitops.h Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 lines
693 B
C
19 lines
693 B
C
#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
|
|
#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
|
|
|
|
#include <asm-generic/bitops/le.h>
|
|
|
|
#define ext2_set_bit(nr,addr) \
|
|
generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
|
|
#define ext2_clear_bit(nr,addr) \
|
|
generic___test_and_clear_le_bit((nr),(unsigned long *)(addr))
|
|
|
|
#define ext2_test_bit(nr,addr) \
|
|
generic_test_le_bit((nr),(unsigned long *)(addr))
|
|
#define ext2_find_first_zero_bit(addr, size) \
|
|
generic_find_first_zero_le_bit((unsigned long *)(addr), (size))
|
|
#define ext2_find_next_zero_bit(addr, size, off) \
|
|
generic_find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
|
|
|
|
#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
|