Mate Toth-Pal | 3956a8a | 2018-08-03 17:18:47 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2017-2018, 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("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 | LIST_SVC_NSPM |
| 52 | |
| 53 | #undef X |
| 54 | |
| 55 | /* add all the new entries above this line */ |
| 56 | SVC_TFM_MAX, |
| 57 | }; |
| 58 | |
| 59 | /* number of user SVC functions */ |
| 60 | #define USER_SVC_COUNT (SVC_TFM_MAX - 1) |
| 61 | |
| 62 | #ifdef __cplusplus |
| 63 | } |
| 64 | #endif |
| 65 | |
| 66 | #endif /* __TFM_NS_SVC_H__ */ |