Skip to content

Commit

Permalink
kernel: make MULTITHREADING promptless if single-thread not supported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ioannisg authored and galak committed May 26, 2021
1 parent 7e7f420 commit 4084242
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ endmenu
# Architecture Capabilities
#

config ARCH_HAS_SINGLE_THREAD_SUPPORT
bool

config ARCH_HAS_TIMING_FUNCTIONS
bool

Expand Down
1 change: 1 addition & 0 deletions arch/arm/core/aarch32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kernel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4084242

Please sign in to comment.