aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-xtensa/bitops.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-xtensa/bitops.h')
-rw-r--r--include/asm-xtensa/bitops.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h
index 96303dff3ee4..1c1e0d933eea 100644
--- a/include/asm-xtensa/bitops.h
+++ b/include/asm-xtensa/bitops.h
@@ -57,9 +57,6 @@ static inline int __ffs(unsigned long x)
57 return 31 - __cntlz(x & -x); 57 return 31 - __cntlz(x & -x);
58} 58}
59 59
60
61#ifdef __KERNEL__
62
63/* 60/*
64 * ffs: Find first bit set in word. This is defined the same way as 61 * ffs: Find first bit set in word. This is defined the same way as
65 * the libc and compiler builtin ffs routines, therefore 62 * the libc and compiler builtin ffs routines, therefore
@@ -97,11 +94,15 @@ static inline int fls (unsigned int x)
97#include <asm-generic/bitops/ext2-non-atomic.h> 94#include <asm-generic/bitops/ext2-non-atomic.h>
98 95
99#ifdef __XTENSA_EL__ 96#ifdef __XTENSA_EL__
100# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr)) 97# define ext2_set_bit_atomic(lock,nr,addr) \
101# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr)) 98 test_and_set_bit((nr), (unsigned long*)(addr))
99# define ext2_clear_bit_atomic(lock,nr,addr) \
100 test_and_clear_bit((nr), (unsigned long*)(addr))
102#elif defined(__XTENSA_EB__) 101#elif defined(__XTENSA_EB__)
103# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr)) 102# define ext2_set_bit_atomic(lock,nr,addr) \
104# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr)) 103 test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr))
104# define ext2_clear_bit_atomic(lock,nr,addr) \
105 test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr))
105#else 106#else
106# error processor byte order undefined! 107# error processor byte order undefined!
107#endif 108#endif