1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef __ASM_CSKY_BITOPS_H
5 #define __ASM_CSKY_BITOPS_H
7 #include <linux/compiler.h>
8 #include <asm/barrier.h>
11 * asm-generic/bitops/ffs.h
13 static inline int ffs(int x
)
28 * asm-generic/bitops/__ffs.h
30 static __always_inline
unsigned long __ffs(unsigned long x
)
41 * asm-generic/bitops/fls.h
43 static __always_inline
int fls(unsigned int x
)
54 * asm-generic/bitops/__fls.h
56 static __always_inline
unsigned long __fls(unsigned long x
)
61 #include <asm-generic/bitops/ffz.h>
62 #include <asm-generic/bitops/fls64.h>
63 #include <asm-generic/bitops/find.h>
65 #ifndef _LINUX_BITOPS_H
66 #error only <linux/bitops.h> can be included directly
69 #include <asm-generic/bitops/sched.h>
70 #include <asm-generic/bitops/hweight.h>
71 #include <asm-generic/bitops/lock.h>
72 #include <asm-generic/bitops/atomic.h>
75 * bug fix, why only could use atomic!!!!
77 #include <asm-generic/bitops/non-atomic.h>
78 #define __clear_bit(nr, vaddr) clear_bit(nr, vaddr)
80 #include <asm-generic/bitops/le.h>
81 #include <asm-generic/bitops/ext2-atomic.h>
82 #endif /* __ASM_CSKY_BITOPS_H */