This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 206d339b37 arch/arm: add support for ARMv8-M Security Extensions
206d339b37 is described below

commit 206d339b37664bb8b840ca820e2b1c497a9e5e15
Author: raiden00pl <[email protected]>
AuthorDate: Tue Jul 4 13:08:09 2023 +0200

    arch/arm: add support for ARMv8-M Security Extensions
---
 arch/arm/src/armv8-m/Kconfig        | 5 +++++
 arch/arm/src/armv8-m/Toolchain.defs | 6 ++++++
 include/nuttx/compiler.h            | 7 +++++++
 3 files changed, 18 insertions(+)

diff --git a/arch/arm/src/armv8-m/Kconfig b/arch/arm/src/armv8-m/Kconfig
index afa57a4f9a..d022a4511d 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 74f23de061..7a4d92d777 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 7564f1fdb4..fdf0435a71 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)

Reply via email to