Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) #ifndef __ASM_SH_BITOPS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #define __ASM_SH_BITOPS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) #ifndef _LINUX_BITOPS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) #error only <linux/bitops.h> can be included directly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) /* For __swab32 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/byteorder.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm/barrier.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifdef CONFIG_GUSA_RB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/bitops-grb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #elif defined(CONFIG_CPU_SH2A)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <asm-generic/bitops/atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <asm/bitops-op32.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #elif defined(CONFIG_CPU_SH4A)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <asm/bitops-llsc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #elif defined(CONFIG_CPU_J2) && defined(CONFIG_SMP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <asm/bitops-cas.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <asm-generic/bitops/atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <asm-generic/bitops/non-atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static inline unsigned long ffz(unsigned long word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	unsigned long result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	__asm__("1:\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 		"shlr	%1\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 		"bt/s	1b\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 		" add	#1, %0"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 		: "=r" (result), "=r" (word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 		: "0" (~0L), "1" (word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 		: "t");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	return result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)  * __ffs - find first bit in word.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)  * @word: The word to search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)  * Undefined if no bit exists, so code should check against 0 first.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) static inline unsigned long __ffs(unsigned long word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	unsigned long result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	__asm__("1:\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 		"shlr	%1\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 		"bf/s	1b\n\t"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 		" add	#1, %0"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 		: "=r" (result), "=r" (word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 		: "0" (~0L), "1" (word)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 		: "t");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	return result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #include <asm-generic/bitops/find.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #include <asm-generic/bitops/ffs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #include <asm-generic/bitops/hweight.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #include <asm-generic/bitops/lock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #include <asm-generic/bitops/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #include <asm-generic/bitops/le.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #include <asm-generic/bitops/ext2-atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #include <asm-generic/bitops/fls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #include <asm-generic/bitops/__fls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #include <asm-generic/bitops/fls64.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #endif /* __ASM_SH_BITOPS_H */