diff --git a/cpu/cortexm_common/Kconfig b/cpu/cortexm_common/Kconfig index 08a66f263337..43aae181e89f 100644 --- a/cpu/cortexm_common/Kconfig +++ b/cpu/cortexm_common/Kconfig @@ -13,11 +13,13 @@ config CPU_ARCH_ARMV7_M bool select HAS_ARCH_ARM select HAS_ARCH_32BIT + select HAS_NO_IDLE_THREAD config CPU_ARCH_ARMV8_M bool select HAS_ARCH_ARM select HAS_ARCH_32BIT + select HAS_NO_IDLE_THREAD config CPU_ARCH default "armv6_m" if CPU_ARCH_ARMV6_M @@ -100,3 +102,8 @@ config HAS_CORTEXM_SVC bool help Indicates that ARM Cortex-M Supervisor Calls are available. + +config HAS_NO_IDLE_THREAD + bool + help + Indicates that this MCU doesn't need the idle thread diff --git a/cpu/cortexm_common/Makefile.features b/cpu/cortexm_common/Makefile.features index 9d1d3d8f4072..5739bddbe78c 100644 --- a/cpu/cortexm_common/Makefile.features +++ b/cpu/cortexm_common/Makefile.features @@ -11,3 +11,8 @@ FEATURES_PROVIDED += ssp ifneq (,$(filter $(CPU_ARCH),cortex-m4f cortex-m7)) FEATURES_PROVIDED += cortexm_fpu endif + +# cortex-m3 and higher don't need the idle thread +ifneq (,$(filter cortex-m2% cortex-m4% cortex-m3% cortex-m7%,$(CPU_ARCH))) + FEATURES_PROVIDED += no_idle_thread +endif diff --git a/cpu/cortexm_common/Makefile.include b/cpu/cortexm_common/Makefile.include index fc181b053010..2d220a8f7938 100644 --- a/cpu/cortexm_common/Makefile.include +++ b/cpu/cortexm_common/Makefile.include @@ -31,11 +31,6 @@ LINKFLAGS += $(if $(ROM_OFFSET),$(LINKFLAGPREFIX)--defsym=_rom_offset=$(ROM_OFFS # FW_ROM_LEN: rom length to use for firmware linking. Allows linking only in a section of the rom. LINKFLAGS += $(if $(FW_ROM_LEN),$(LINKFLAGPREFIX)--defsym=_fw_rom_length=$(FW_ROM_LEN)) -# Cortex-M3+ doesn't need the idle thread -ifneq (,$(filter cortex-m2% cortex-m4% cortex-m3% cortex-m7%,$(CPU_ARCH))) - DISABLE_MODULE += core_idle_thread -endif - # Cortex-M0+/1/3/4/7 riotboot settings # From ARMv7-M (M4, M3, M7) architecture reference manual, section B1.5.3