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 <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2021-04-07 21:41:06 -04:00 committed by Carles Cufí
commit 949ef7c660
2 changed files with 9 additions and 10 deletions

View file

@ -830,7 +830,6 @@ menu "Floating Point Options"
config FPU config FPU
bool "Enable floating point unit (FPU)" bool "Enable floating point unit (FPU)"
depends on CPU_HAS_FPU depends on CPU_HAS_FPU
depends on ARC || ARM || RISCV || SPARC || X86
help help
This option enables the hardware Floating Point Unit (FPU), in order to This option enables the hardware Floating Point Unit (FPU), in order to
support using the floating point registers and instructions. support using the floating point registers and instructions.
@ -851,20 +850,19 @@ config FPU
config FPU_SHARING config FPU_SHARING
bool "FPU register sharing" bool "FPU register sharing"
depends on FPU && MULTITHREADING depends on FPU && MULTITHREADING
default y if ARM && ARMV7_M_ARMV8_M_FP
help help
This option enables preservation of the hardware floating point registers This option enables preservation of the hardware floating point registers
across context switches to allow multiple threads to perform concurrent across context switches to allow multiple threads to perform concurrent
floating point operations. floating point operations.
Note that on Cortex-M processors with the floating point extension we Note that some compiler configurations may activate a floating point
enable by default the FPU register sharing mode, as some GCC compilers context by generating FP instructions for any thread, and that
may activate a floating point context by generating FP instructions for context must be preserved when switching such threads in and out.
any thread, and that context must be preserved when switching such The developers can still disable the FP sharing mode in their
threads in and out. The developers can still disable the FP sharing application projects, and switch to Unshared FP registers mode,
mode in their application projects, and switch to Unshared FP registers if it is guaranteed that the image code does not generate FP
mode, if it is guaranteed that the image code does not generate FP instructions outside the single thread context that is allowed
instructions outside the single thread context that is allowed to do so. to do so.
endmenu endmenu

View file

@ -244,6 +244,7 @@ config ARMV8_M_SE
config ARMV7_M_ARMV8_M_FP config ARMV7_M_ARMV8_M_FP
bool bool
depends on ARMV7_M_ARMV8_M_MAINLINE && !CPU_CORTEX_M3 depends on ARMV7_M_ARMV8_M_MAINLINE && !CPU_CORTEX_M3
imply FPU_SHARING
help help
This option signifies the use of an ARMv7-M processor This option signifies the use of an ARMv7-M processor
implementation, or the use of an ARMv8-M processor implementation, or the use of an ARMv8-M processor