From 4084242a71d0a93d97a83776b995785bd28ec883 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Wed, 19 May 2021 17:45:25 +0200 Subject: [PATCH] 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 --- arch/Kconfig | 3 +++ arch/arm/core/aarch32/Kconfig | 1 + kernel/Kconfig | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index f5a69bbcbce546..7910fc012f515a 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -464,6 +464,9 @@ endmenu # Architecture Capabilities # +config ARCH_HAS_SINGLE_THREAD_SUPPORT + bool + config ARCH_HAS_TIMING_FUNCTIONS bool diff --git a/arch/arm/core/aarch32/Kconfig b/arch/arm/core/aarch32/Kconfig index dbf0350a9e74f7..9e40d1b6ba6e45 100644 --- a/arch/arm/core/aarch32/Kconfig +++ b/arch/arm/core/aarch32/Kconfig @@ -9,6 +9,7 @@ config CPU_CORTEX_M select ARCH_HAS_CUSTOM_SWAP_TO_MAIN select HAS_CMSIS_CORE select HAS_FLASH_LOAD_OFFSET + select ARCH_HAS_SINGLE_THREAD_SUPPORT select ARCH_HAS_THREAD_ABORT 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 diff --git a/kernel/Kconfig b/kernel/Kconfig index 0f933a60685782..3ac77e71b95f4b 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -10,7 +10,7 @@ module-str = kernel source "subsys/logging/Kconfig.template.log_config" config MULTITHREADING - bool "Multi-threading" + bool "Multi-threading" if ARCH_HAS_SINGLE_THREAD_SUPPORT default y help If disabled, only the main thread is available, so a main() function