Mistake on this page?
Report an issue in GitHub or email us
tfm_ns_svc.h
1 /*
2  * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include <stdio.h>
9 #include <cmsis_compiler.h>
10 
11 #ifndef __TFM_NS_SVC_H__
12 #define __TFM_NS_SVC_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /**
19  * \brief Include all the SVC handler headers
20  */
21 #include "tfm_nspm_svc_handler.h"
22 
23 /**
24  * \brief Macro to encode an svc instruction
25  *
26  */
27 #define SVC(code) __ASM volatile("svc %0" : : "I" (code))
28 
29 /**
30  * \def LIST_SVC_NSPM
31  *
32  * \brief This is an X macro which lists
33  * the SVC interface exposed by TF-M
34  * for the NS OS.
35  *
36  */
37 #define LIST_SVC_NSPM \
38  X(SVC_TFM_NSPM_REGISTER_CLIENT_ID, tfm_nspm_svc_register_client_id) \
39 
40 /**
41  * \brief Numbers associated to each SVC available
42  *
43  * \details Start from 1 as 0 is reserved by RTX
44  */
45 enum tfm_svc_num {
46  SVC_INVALID = 0,
47 
48 #define X(SVC_ENUM, SVC_HANDLER) SVC_ENUM,
49 
50  /* SVC API for Services */
51 #ifdef TFM_NS_CLIENT_IDENTIFICATION
52  LIST_SVC_NSPM
53 #endif
54 
55 #undef X
56 
57  /* add all the new entries above this line */
58  SVC_TFM_MAX,
59 };
60 
61 /* number of user SVC functions */
62 #define USER_SVC_COUNT ((uint32_t)SVC_TFM_MAX - 1)
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* __TFM_NS_SVC_H__ */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.