From 949ef7c660624b61c9f3e3e2c7a286f4f1581f9a Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 7 Apr 2021 21:41:06 -0400 Subject: [PATCH] Kconfig: clean up FPU and FPU_SHARING entries CONFIG_FPU: The architecture dependency list is redundant. Having CPU_HAS_FPU being selected by those archs as a dependency is sufficient and cleaner. CONFIG_FPU_SHARING: The default should always be y to be on the safe side here, but as a compromise for not affecting existing config, let's move the default selection local to those configs that care, again to avoid a growing list of conditionals here. Adjust the help text which applies to more than just Cortex-M. Signed-off-by: Nicolas Pitre --- arch/Kconfig | 18 ++++++++---------- arch/arm/core/aarch32/cortex_m/Kconfig | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 3061d82cdbe..f61c284f9e2 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -830,7 +830,6 @@ menu "Floating Point Options" config FPU bool "Enable floating point unit (FPU)" depends on CPU_HAS_FPU - depends on ARC || ARM || RISCV || SPARC || X86 help This option enables the hardware Floating Point Unit (FPU), in order to support using the floating point registers and instructions. @@ -851,20 +850,19 @@ config FPU config FPU_SHARING bool "FPU register sharing" depends on FPU && MULTITHREADING - default y if ARM && ARMV7_M_ARMV8_M_FP help This option enables preservation of the hardware floating point registers across context switches to allow multiple threads to perform concurrent floating point operations. - Note that on Cortex-M processors with the floating point extension we - enable by default the FPU register sharing mode, as some GCC compilers - may activate a floating point context by generating FP instructions for - any thread, and that context must be preserved when switching such - threads in and out. The developers can still disable the FP sharing - mode in their application projects, and switch to Unshared FP registers - mode, if it is guaranteed that the image code does not generate FP - instructions outside the single thread context that is allowed to do so. + Note that some compiler configurations may activate a floating point + context by generating FP instructions for any thread, and that + context must be preserved when switching such threads in and out. + The developers can still disable the FP sharing mode in their + application projects, and switch to Unshared FP registers mode, + if it is guaranteed that the image code does not generate FP + instructions outside the single thread context that is allowed + to do so. endmenu diff --git a/arch/arm/core/aarch32/cortex_m/Kconfig b/arch/arm/core/aarch32/cortex_m/Kconfig index e8c6db4a884..2e8927c0765 100644 --- a/arch/arm/core/aarch32/cortex_m/Kconfig +++ b/arch/arm/core/aarch32/cortex_m/Kconfig @@ -244,6 +244,7 @@ config ARMV8_M_SE config ARMV7_M_ARMV8_M_FP bool depends on ARMV7_M_ARMV8_M_MAINLINE && !CPU_CORTEX_M3 + imply FPU_SHARING help This option signifies the use of an ARMv7-M processor implementation, or the use of an ARMv8-M processor