drm/ast: Only warn about unsupported TX chips on Gen4 and later
[drm/drm-misc.git] / arch / csky / include / asm / bitops.h
blob72e1b2aa29a07d1c913e6951d25784b69008e307
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_CSKY_BITOPS_H
4 #define __ASM_CSKY_BITOPS_H
6 #include <linux/compiler.h>
7 #include <asm/barrier.h>
9 /*
10 * asm-generic/bitops/ffs.h
12 static inline int ffs(int x)
14 if (!x)
15 return 0;
17 asm volatile (
18 "brev %0\n"
19 "ff1 %0\n"
20 "addi %0, 1\n"
21 : "=&r"(x)
22 : "0"(x));
23 return x;
27 * asm-generic/bitops/__ffs.h
29 static __always_inline unsigned long __ffs(unsigned long x)
31 asm volatile (
32 "brev %0\n"
33 "ff1 %0\n"
34 : "=&r"(x)
35 : "0"(x));
36 return x;
40 * asm-generic/bitops/fls.h
42 static __always_inline int fls(unsigned int x)
44 asm volatile(
45 "ff1 %0\n"
46 : "=&r"(x)
47 : "0"(x));
49 return (32 - x);
53 * asm-generic/bitops/__fls.h
55 static __always_inline unsigned long __fls(unsigned long x)
57 return fls(x) - 1;
60 #include <asm-generic/bitops/ffz.h>
61 #include <asm-generic/bitops/fls64.h>
63 #ifndef _LINUX_BITOPS_H
64 #error only <linux/bitops.h> can be included directly
65 #endif
67 #include <asm-generic/bitops/sched.h>
68 #include <asm-generic/bitops/hweight.h>
69 #include <asm-generic/bitops/lock.h>
70 #include <asm-generic/bitops/atomic.h>
73 * bug fix, why only could use atomic!!!!
75 #include <asm-generic/bitops/non-atomic.h>
77 #include <asm-generic/bitops/le.h>
78 #include <asm-generic/bitops/ext2-atomic.h>
79 #endif /* __ASM_CSKY_BITOPS_H */