From 9c1da0dfa6d2ca2c4432ca390b520ae2f77716eb Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 23 Nov 2017 17:43:54 -0500 Subject: [PATCH] kconfig: clean CPU features and define only once Signed-off-by: Anas Nashif --- arch/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++ arch/arc/Kconfig | 40 ---------------------------------------- arch/arm/core/Kconfig | 37 +------------------------------------ arch/x86/Kconfig | 41 +---------------------------------------- 4 files changed, 45 insertions(+), 116 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 8ce5394e599..6fe71b6de98 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -191,6 +191,49 @@ config BOOTLOADER_CONTEXT_RESTORE_SUPPORTED This option signifies that the target has options of bootloaders that support context restore upon resume from deep sleep + +# End hidden CPU family configs +# + +config CPU_HAS_FPU + bool + default n + help + This option is enabled when the CPU has hardware floating point + unit. + +config CPU_HAS_MPU + bool + # Omit prompt to signify "hidden" option + default n + help + This option is enabled when the CPU has a Memory Protection Unit (MPU). + +menu "Floating Point Options" +depends on CPU_HAS_FPU + +config FLOAT + bool + prompt "Floating point registers" + default n + help + This option allows threads to use the floating point registers. + By default, only a single thread may use the registers. + + Disabling this option means that any thread that uses a + floating point register will get a fatal exception. + +config FP_SHARING + bool + prompt "Floating point register sharing" + depends on FLOAT + default n + help + This option allows multiple threads to use the floating point + registers. + +endmenu + # # End hidden PM feature configs # diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 08568796a07..f098239e881 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -24,21 +24,6 @@ config ARCH_DEFCONFIG string default "arch/arc/defconfig" -config CPU_HAS_MPU - bool - # Omit prompt to signify "hidden" option - default n - help - This option is enabled when the CPU has a Memory Protection Unit (MPU). - -config CPU_HAS_FPU - # Hidden config selected by CPU family - bool - default n - help - This option is enabled when the CPU has hardware floating point - unit. - menu "ARC EM4 processor options" config CPU_ARCEM4 @@ -153,31 +138,6 @@ config CODE_DENSITY help Enable code density option to get better code density -menu "Floating Point Options" -depends on CPU_HAS_FPU - -config FLOAT - bool - prompt "Floating point registers" - default n - help - This option allows threads to use the floating point registers. - By default, only a single thread may use the registers. - - Disabling this option means that any thread that uses a - floating point register will get a fatal exception. - -config FP_SHARING - bool - prompt "Floating point register sharing" - depends on FLOAT - default n - help - This option allows multiple threads to use the floating point - registers. - -endmenu - menu "ARC MPU Options" depends on CPU_HAS_MPU diff --git a/arch/arm/core/Kconfig b/arch/arm/core/Kconfig index 9c944f224bc..eaccaf0fde1 100644 --- a/arch/arm/core/Kconfig +++ b/arch/arm/core/Kconfig @@ -34,21 +34,6 @@ config CPU_HAS_SYSTICK help This option is enabled when the CPU has systick timer implemented. -config CPU_HAS_MPU - bool - # Omit prompt to signify "hidden" option - default n - help - This option is enabled when the CPU has a Memory Protection Unit (MPU). - -config CPU_HAS_FPU - # Hidden config selected by CPU family - bool - default n - help - This option is enabled when the CPU has a hardware floating point - unit. - config ARM_STACK_PROTECTION bool default y if HW_STACK_PROTECTION @@ -65,29 +50,9 @@ config ARM_USERSPACE user-level threads that are protected from each other and from crashing the kernel. -menu "Floating Point Options" +menu "Architectue Floating Point Options" depends on CPU_HAS_FPU -config FLOAT - bool - prompt "Floating point registers" - default n - help - This option allows threads to use the floating point registers. - By default, only a single thread may use the registers. - - Disabling this option means that any thread that uses a - floating point register will get a fatal exception. - -config FP_SHARING - bool - prompt "Floating point register sharing" - depends on FLOAT - default n - help - This option allows multiple threads to use the floating point - registers. - choice prompt "Floating point ABI" default FP_HARDABI diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 83d63cf7cd6..7797ae8387d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -46,17 +46,6 @@ config CPU_MINUTEIA bool help This option signifies the use of a CPU from the Minute IA family. -# -# End hidden CPU family configs -# - -config CPU_HAS_FPU - # Hidden config selected by CPU family - bool - default n - help - This option is enabled when the CPU has hardware floating point - unit. menu "Processor Capabilities" @@ -128,37 +117,9 @@ config X86_USERSPACE supporting user-level threads that are protected from each other and from crashing the kernel. -menu "Floating Point Options" +menu "Architecture Floating Point Options" depends on CPU_HAS_FPU -config FLOAT - bool - prompt "Floating point registers" - default n - help - This option allows threads to use the x87 FPU/MMX registers. The - registers may be used by any number of cooperative threads or by - a single preemptible thread, but not both, since the kernel does not - preserve FPU context information when switching between threads. - Additional options must be enabled to permit the use of SSE registers or - to permit floating point register use by multiple preemptible threads. - - Disabling this option means that any thread that uses the floating - point registers will get a fatal exception. - -config FP_SHARING - bool - prompt "Floating point register sharing" - depends on FLOAT - default n - help - This option allows multiple preemptible threads to use the floating - point registers. Any preemptible thread that uses the registers must - provide stack space where the kernel can save FPU context info during - a preemptive context switch. A thread that uses only the x87 FPU/MMX - registers must provide 108 bytes of added stack space, while a thread - the uses the SSE registers must provide 464 bytes of added stack space. - config SSE bool prompt "SSE registers"