kernel: make MULTITHREADING promptless if single-thread not supported

If single thread builds are not supported by the
architecture, the MULTITHREADING option should be
prompt-less to block any modifications to it. We
also introduce an explicit ARCH-level Kconfig that
reflects whether the ARCH is capable of single-thread
Zephyr builds.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2021-05-19 17:45:25 +02:00 committed by Kumar Gala
parent 7e7f4201df
commit 4084242a71
3 changed files with 5 additions and 1 deletions

View file

@ -464,6 +464,9 @@ endmenu
# Architecture Capabilities # Architecture Capabilities
# #
config ARCH_HAS_SINGLE_THREAD_SUPPORT
bool
config ARCH_HAS_TIMING_FUNCTIONS config ARCH_HAS_TIMING_FUNCTIONS
bool bool

View file

@ -9,6 +9,7 @@ config CPU_CORTEX_M
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
select HAS_CMSIS_CORE select HAS_CMSIS_CORE
select HAS_FLASH_LOAD_OFFSET select HAS_FLASH_LOAD_OFFSET
select ARCH_HAS_SINGLE_THREAD_SUPPORT
select ARCH_HAS_THREAD_ABORT select ARCH_HAS_THREAD_ABORT
select ARCH_HAS_TRUSTED_EXECUTION if ARM_TRUSTZONE_M select ARCH_HAS_TRUSTED_EXECUTION if ARM_TRUSTZONE_M
select ARCH_HAS_STACK_PROTECTION if (ARM_MPU && !ARMV6_M_ARMV8_M_BASELINE) || CPU_CORTEX_M_HAS_SPLIM select ARCH_HAS_STACK_PROTECTION if (ARM_MPU && !ARMV6_M_ARMV8_M_BASELINE) || CPU_CORTEX_M_HAS_SPLIM

View file

@ -10,7 +10,7 @@ module-str = kernel
source "subsys/logging/Kconfig.template.log_config" source "subsys/logging/Kconfig.template.log_config"
config MULTITHREADING config MULTITHREADING
bool "Multi-threading" bool "Multi-threading" if ARCH_HAS_SINGLE_THREAD_SUPPORT
default y default y
help help
If disabled, only the main thread is available, so a main() function If disabled, only the main thread is available, so a main() function