diff --git a/arch/arm/src/armv8-m/Kconfig b/arch/arm/src/armv8-m/Kconfig index afa57a4f9a8..d022a4511d6 100644 --- a/arch/arm/src/armv8-m/Kconfig +++ b/arch/arm/src/armv8-m/Kconfig @@ -169,3 +169,8 @@ config ARMV8M_TRUSTZONE_CPU_BITMASK default 0 ---help--- Set Security bitmap for multicore, bit 0 means core 0. + +config ARMV8M_CMSE + bool "ARMv8-M Security Extensions" + ---help--- + Enable ARMv8-M Security Extensions. diff --git a/arch/arm/src/armv8-m/Toolchain.defs b/arch/arm/src/armv8-m/Toolchain.defs index 74f23de0616..7a4d92d7770 100644 --- a/arch/arm/src/armv8-m/Toolchain.defs +++ b/arch/arm/src/armv8-m/Toolchain.defs @@ -188,4 +188,10 @@ ifeq ($(CONFIG_ARMV8M_STACKCHECK),y) ARCHOPTIMIZATION += -finstrument-functions -ffixed-r10 endif +# ARMv8-M Security Extensions + +ifeq ($(CONFIG_ARMV8M_CMSE),y) + ARCHCPUFLAGS += -mcmse +endif + include $(TOPDIR)/arch/arm/src/common/Toolchain.defs diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 7564f1fdb46..fdf0435a717 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -472,6 +472,13 @@ # define no_builtin(n) # endif +/* CMSE extention */ + +# ifdef CONFIG_ARCH_HAVE_TRUSTZONE +# define cmse_nonsecure_entry __attribute__((cmse_nonsecure_entry)) +# define cmse_nonsecure_call __attribute__((cmse_nonsecure_call)) +# endif + /* SDCC-specific definitions ************************************************/ #elif defined(SDCC) || defined(__SDCC)