aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/include/asm')
-rw-r--r--arch/xtensa/include/asm/atomic.h3
-rw-r--r--arch/xtensa/include/asm/bitops.h11
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index b3b23540f14..67ad67bed8c 100644
--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -14,8 +14,7 @@
14#define _XTENSA_ATOMIC_H 14#define _XTENSA_ATOMIC_H
15 15
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17 17#include <linux/types.h>
18typedef struct { volatile int counter; } atomic_t;
19 18
20#ifdef __KERNEL__ 19#ifdef __KERNEL__
21#include <asm/processor.h> 20#include <asm/processor.h>
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 23261e8f2e5..6c3930397bd 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -82,6 +82,16 @@ static inline int fls (unsigned int x)
82 return 32 - __cntlz(x); 82 return 32 - __cntlz(x);
83} 83}
84 84
85/**
86 * __fls - find last (most-significant) set bit in a long word
87 * @word: the word to search
88 *
89 * Undefined if no set bit exists, so code should check against 0 first.
90 */
91static inline unsigned long __fls(unsigned long word)
92{
93 return 31 - __cntlz(word);
94}
85#else 95#else
86 96
87/* Use the generic implementation if we don't have the nsa/nsau instructions. */ 97/* Use the generic implementation if we don't have the nsa/nsau instructions. */
@@ -90,6 +100,7 @@ static inline int fls (unsigned int x)
90# include <asm-generic/bitops/__ffs.h> 100# include <asm-generic/bitops/__ffs.h>
91# include <asm-generic/bitops/ffz.h> 101# include <asm-generic/bitops/ffz.h>
92# include <asm-generic/bitops/fls.h> 102# include <asm-generic/bitops/fls.h>
103# include <asm-generic/bitops/__fls.h>
93 104
94#endif 105#endif
95 106