TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_nspm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __TFM_NSPM_H__
9 #define __TFM_NSPM_H__
10 
11 #include <stdint.h>
12 
13 #if !defined(TFM_MULTI_CORE_TOPOLOGY)
14 /*
15  * The macro cmse_nsfptr_create defined in the gcc library uses the non-standard
16  * gcc C lanuage extension 'typeof'. TF-M is built with '-std=c99' so typeof
17  * cannot be used in the code. As a workaround cmse_nsfptr_create is redefined
18  * here to use only standard language elements.
19  */
20 #undef cmse_nsfptr_create
21 #define cmse_nsfptr_create(p) ((intptr_t) (p) & ~1)
22 
28 #if !defined(__ARMCC_VERSION) && !defined(__ICCARM__)
29 /*
30  * GNUARM requires noclone attribute to protect gateway function symbol from
31  * being renamed and cloned
32  */
33 #define __tfm_nspm_secure_gateway_attributes__ \
34  __attribute__((cmse_nonsecure_entry, noclone))
35 #else
36 #define __tfm_nspm_secure_gateway_attributes__ \
37  __attribute__((cmse_nonsecure_entry))
38 #endif /* !__ARMCC_VERSION */
39 #endif /* __GNUC__ && !TFM_MULTI_CORE_TOPOLOGY */
40 
41 #ifndef TFM_PSA_API
42 
46 #endif
47 
54 int32_t tfm_nspm_get_current_client_id(void);
55 
56 #ifdef TFM_PSA_API
57 
62 void tfm_nspm_thread_entry(void);
63 #endif
64 
65 #ifdef TFM_MULTI_CORE_TOPOLOGY
66 /* Unnecessary to configure Non-secure side code */
67 #define configure_ns_code() do {} while (0)
68 #else
69 /*
70  * \brief Configure Non-secure code, such as vector table, MSP and entry point.
71  */
72 void configure_ns_code(void);
73 #endif
74 
75 #endif /* __TFM_NSPM_H__ */
void configure_ns_code(void)
int32_t tfm_nspm_get_current_client_id(void)
Get the client ID of the current NS client.
Definition: tfm_nspm_func.c:63
void tfm_nspm_thread_entry(void)
void tfm_nspm_configure_clients(void)
initialise the NS context database
Definition: tfm_nspm_func.c:48