This source file includes following definitions.
- __ffs
- fls
- ffs
1
2
3
4
5
6
7
8 #ifndef _ASM_C6X_BITOPS_H
9 #define _ASM_C6X_BITOPS_H
10
11 #ifdef __KERNEL__
12
13 #include <linux/bitops.h>
14 #include <asm/byteorder.h>
15 #include <asm/barrier.h>
16
17
18
19
20
21
22
23
24
25
26
27
28
29 static inline unsigned long __ffs(unsigned long x)
30 {
31 asm (" bitr .M1 %0,%0\n"
32 " nop\n"
33 " lmbd .L1 1,%0,%0\n"
34 : "+a"(x));
35
36 return x;
37 }
38
39
40
41
42
43
44
45 #define ffz(x) __ffs(~(x))
46
47
48
49
50
51
52
53
54 static inline int fls(unsigned int x)
55 {
56 if (!x)
57 return 0;
58
59 asm (" lmbd .L1 1,%0,%0\n" : "+a"(x));
60
61 return 32 - x;
62 }
63
64
65
66
67
68
69
70
71
72
73 static inline int ffs(int x)
74 {
75 if (!x)
76 return 0;
77
78 return __ffs(x) + 1;
79 }
80
81 #include <asm-generic/bitops/__fls.h>
82 #include <asm-generic/bitops/fls64.h>
83 #include <asm-generic/bitops/find.h>
84
85 #include <asm-generic/bitops/sched.h>
86 #include <asm-generic/bitops/hweight.h>
87 #include <asm-generic/bitops/lock.h>
88
89 #include <asm-generic/bitops/atomic.h>
90 #include <asm-generic/bitops/non-atomic.h>
91 #include <asm-generic/bitops/le.h>
92 #include <asm-generic/bitops/ext2-atomic.h>
93
94 #endif
95 #endif