NS Agent: Update veneer codes
Adds a new C version veneers for Armv8.1-M as it has hardware
re-entry detection so that the assembly one can be removed.
And then all the rests can be C codes.
The old assembly one are for Armv8-M only now.
Change-Id: I5ac0328dcf55acaef10dbb12c449418e8982b73c
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/include/security_defs.h b/secure_fw/include/security_defs.h
index 5d752d4..99a88d2 100644
--- a/secure_fw/include/security_defs.h
+++ b/secure_fw/include/security_defs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -16,4 +16,21 @@
*/
#define STACK_SEAL_PATTERN 0xFEF5EDA5
+/* Attributes for psa api secure gateway functions */
+#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
+/*
+ * GNUARM requires noclone attribute to protect gateway function symbol from
+ * being renamed and cloned
+ */
+#define __tz_c_veneer \
+ __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 /* __SECURITY_DEFS_H__ */