| .. | .. |
|---|
| 2 | 2 | #ifndef __ASM_SH_BITOPS_H |
|---|
| 3 | 3 | #define __ASM_SH_BITOPS_H |
|---|
| 4 | 4 | |
|---|
| 5 | | -#ifdef __KERNEL__ |
|---|
| 6 | | - |
|---|
| 7 | 5 | #ifndef _LINUX_BITOPS_H |
|---|
| 8 | 6 | #error only <linux/bitops.h> can be included directly |
|---|
| 9 | 7 | #endif |
|---|
| .. | .. |
|---|
| 26 | 24 | #include <asm-generic/bitops/non-atomic.h> |
|---|
| 27 | 25 | #endif |
|---|
| 28 | 26 | |
|---|
| 29 | | -#ifdef CONFIG_SUPERH32 |
|---|
| 30 | 27 | static inline unsigned long ffz(unsigned long word) |
|---|
| 31 | 28 | { |
|---|
| 32 | 29 | unsigned long result; |
|---|
| .. | .. |
|---|
| 60 | 57 | : "t"); |
|---|
| 61 | 58 | return result; |
|---|
| 62 | 59 | } |
|---|
| 63 | | -#else |
|---|
| 64 | | -static inline unsigned long ffz(unsigned long word) |
|---|
| 65 | | -{ |
|---|
| 66 | | - unsigned long result, __d2, __d3; |
|---|
| 67 | | - |
|---|
| 68 | | - __asm__("gettr tr0, %2\n\t" |
|---|
| 69 | | - "pta $+32, tr0\n\t" |
|---|
| 70 | | - "andi %1, 1, %3\n\t" |
|---|
| 71 | | - "beq %3, r63, tr0\n\t" |
|---|
| 72 | | - "pta $+4, tr0\n" |
|---|
| 73 | | - "0:\n\t" |
|---|
| 74 | | - "shlri.l %1, 1, %1\n\t" |
|---|
| 75 | | - "addi %0, 1, %0\n\t" |
|---|
| 76 | | - "andi %1, 1, %3\n\t" |
|---|
| 77 | | - "beqi %3, 1, tr0\n" |
|---|
| 78 | | - "1:\n\t" |
|---|
| 79 | | - "ptabs %2, tr0\n\t" |
|---|
| 80 | | - : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3) |
|---|
| 81 | | - : "0" (0L), "1" (word)); |
|---|
| 82 | | - |
|---|
| 83 | | - return result; |
|---|
| 84 | | -} |
|---|
| 85 | | - |
|---|
| 86 | | -#include <asm-generic/bitops/__ffs.h> |
|---|
| 87 | | -#endif |
|---|
| 88 | 60 | |
|---|
| 89 | 61 | #include <asm-generic/bitops/find.h> |
|---|
| 90 | 62 | #include <asm-generic/bitops/ffs.h> |
|---|
| .. | .. |
|---|
| 96 | 68 | #include <asm-generic/bitops/fls.h> |
|---|
| 97 | 69 | #include <asm-generic/bitops/__fls.h> |
|---|
| 98 | 70 | #include <asm-generic/bitops/fls64.h> |
|---|
| 99 | | - |
|---|
| 100 | | -#endif /* __KERNEL__ */ |
|---|
| 101 | 71 | |
|---|
| 102 | 72 | #endif /* __ASM_SH_BITOPS_H */ |
|---|