SPM: Use dedicated instrutions to clear context
There are dedicated context clearing instructions since v8.1m, use
them could save quite a few instructions.
Also, apply extra FP context clearing actions for v8.0m NS jump.
Still doing the jump in assembly code, this could control the context
accurately. As the NSPE launch is not a standard NS call, it has less
significance to apply the CMSE NS call feature.
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
Change-Id: I22d56ea93b8318585eee511f9a66ce632961de13
diff --git a/secure_fw/include/security_defs.h b/secure_fw/include/security_defs.h
index 99a88d2..a776d8d 100644
--- a/secure_fw/include/security_defs.h
+++ b/secure_fw/include/security_defs.h
@@ -16,6 +16,8 @@
*/
#define STACK_SEAL_PATTERN 0xFEF5EDA5
+#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
+
/* Attributes for psa api secure gateway functions */
#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
/*
@@ -26,11 +28,16 @@
__attribute__((cmse_nonsecure_entry, noclone, section("SFN")))
#define __tz_naked_veneer \
__attribute__((cmse_nonsecure_entry, noclone, naked, section("SFN")))
+
#else /* __GNUC__ && !__ARMCC_VERSION */
+
#define __tz_c_veneer \
__attribute__((cmse_nonsecure_entry, section("SFN")))
#define __tz_naked_veneer \
__attribute__((cmse_nonsecure_entry, naked, section("SFN")))
+
#endif /* __GNUC__ && !__ARMCC_VERSION */
+#endif /* __ARM_FEATURE_CMSE */
+
#endif /* __SECURITY_DEFS_H__ */