1 /*
2  * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __SECURITY_DEFS_H__
9 #define __SECURITY_DEFS_H__
10 
11 /* Generic security-related definitions */
12 
13 /*
14  * Stack SEAL is involved since Security Extension exists, it becomes
15  * a generic security defs used by both SPM and Partitions.
16  */
17 #define STACK_SEAL_PATTERN    0xFEF5EDA5
18 
19 #if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
20 
21 /* Attributes for psa api secure gateway functions */
22 #if defined(__GNUC__) && !defined(__ARMCC_VERSION)
23 /*
24  * GNUARM requires noclone attribute to protect gateway function symbol from
25  * being renamed and cloned
26  */
27 #define __tz_c_veneer \
28         __attribute__((cmse_nonsecure_entry, noclone, section("SFN")))
29 #define __tz_naked_veneer \
30         __attribute__((cmse_nonsecure_entry, noclone, naked, section("SFN")))
31 
32 #else /* __GNUC__ && !__ARMCC_VERSION */
33 
34 #define __tz_c_veneer \
35         __attribute__((cmse_nonsecure_entry, section("SFN")))
36 #define __tz_naked_veneer \
37         __attribute__((cmse_nonsecure_entry, naked, section("SFN")))
38 
39 #endif /* __GNUC__ && !__ARMCC_VERSION */
40 
41 #endif /* __ARM_FEATURE_CMSE */
42 
43 #endif /* __SECURITY_DEFS_H__ */
44