summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2019-05-03 17:53:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-06 08:36:41 +0200
commit40b60e89130c36a83449285674d0004fe38ccd50 (patch)
tree737fdfea3ac732fe169e20714b9c32d7226bafc1
parent8bd1b36e484699fcd762e88db5c60efb056dc6e9 (diff)
downloadbarebox-40b60e89130c36a83449285674d0004fe38ccd50.tar.gz
ARM: aarch64: do not use 32bit optimized find bit functions
The optimized find bit functions are only implemented for 32 bit and are not built on aarch64 systems. Therefore, for example bootchooser cannot be build for aarch64. Select the generic find_bit implementations on aarch64. As the decision, if lib64 or lib32 is build or not, directly depends on CPU_V8, the generic implementation also should be used if CPU_V8 is selected. Reported-by: Thomas Hämmerle <Thomas.Haemmerle@wolfvision.net> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/cpu/Kconfig1
-rw-r--r--arch/arm/include/asm/bitops.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index 2577103..f8abbcc 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -86,6 +86,7 @@ config CPU_V8
select CPU_64v8
select CPU_SUPPORTS_64BIT_KERNEL
select ARM_EXCEPTIONS
+ select GENERIC_FIND_NEXT_BIT
config CPU_XSC3
bool
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 348a76b..d8a4d9b 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -82,6 +82,12 @@ static inline int test_bit(int nr, const void * addr)
#define test_and_clear_bit(x, y) __test_and_clear_bit(x, y)
#define test_and_change_bit(x, y) __test_and_change_bit(x, y)
+#ifdef CONFIG_CPU_V8
+
+#include <asm-generic/bitops/find.h>
+
+#else /* CONFIG_CPU_V8 */
+
#ifndef __ARMEB__
/*
* These are the little endian definitions.
@@ -115,6 +121,8 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
#endif /* __ARMEB__ */
+#endif /* CONFIG_CPU_V8 */
+
#if defined (CONFIG_CPU_32) && defined(__LINUX_ARM_ARCH__) && (__LINUX_ARM_ARCH__ >= 5)
static inline int constant_fls(int x)
{