diff options
author | Tom Rini <trini@konsulko.com> | 2023-08-18 13:45:58 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-18 13:45:58 -0400 |
commit | 3881c9fbb7fdd98f6eae5cd33f7e9abe9455a585 (patch) | |
tree | 3522dea6d6e5bff9c2d9bcae8354e16223c5b518 /arch/arm/include/asm/bitops.h | |
parent | 14ba0a8bbc342a677982acc787ae542b84ed7993 (diff) | |
parent | 48f792e31b88343bfccbaf73808e3d02a2be90dc (diff) |
Merge branch '2023-08-18-assorted-updates' into next
- Use built-in ffs/fls on ARM, fix a PIE issue in SPL on ARMv8, bcm283x
and mediatek updates, whitespace fix in UFS uclass, make CI use
"tools-only" defconfig for more tests, add TI TCA9554 GPIO support,
cache alignment fix for SCSI, and fix a problem with
SYS_MMCSD_RAW_MODE_ARGS_SECTOR in SPL.
Diffstat (limited to 'arch/arm/include/asm/bitops.h')
-rw-r--r-- | arch/arm/include/asm/bitops.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h index fa8548624a..8e897833bb 100644 --- a/arch/arm/include/asm/bitops.h +++ b/arch/arm/include/asm/bitops.h @@ -15,9 +15,34 @@ #ifndef __ASM_ARM_BITOPS_H #define __ASM_ARM_BITOPS_H +#if __LINUX_ARM_ARCH__ < 5 + #include <asm-generic/bitops/__ffs.h> #include <asm-generic/bitops/__fls.h> #include <asm-generic/bitops/fls.h> + +#else + +#define PLATFORM_FFS +#define PLATFORM_FLS + +#if !IS_ENABLED(CONFIG_HAS_THUMB2) && CONFIG_IS_ENABLED(SYS_THUMB_BUILD) + +unsigned long __fls(unsigned long word); +unsigned long __ffs(unsigned long word); +int fls(unsigned int x); +int ffs(int x); + +#else + +#include <asm-generic/bitops/builtin-__fls.h> +#include <asm-generic/bitops/builtin-__ffs.h> +#include <asm-generic/bitops/builtin-fls.h> +#include <asm-generic/bitops/builtin-ffs.h> + +#endif +#endif + #include <asm-generic/bitops/fls64.h> #ifdef __KERNEL__ @@ -113,7 +138,7 @@ static inline int test_bit(int nr, const void * addr) static inline int __ilog2(unsigned int x) { - return generic_fls(x) - 1; + return fls(x) - 1; } #define ffz(x) __ffs(~(x)) |