blob: 75b78ecd816ec34143d086d2069368579c5d06b4 [file] [log] [blame]
Ashutosh Singhf4d88672017-11-29 13:35:43 +00001/*
Jamie Fox5592db02017-12-18 16:48:29 +00002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Ashutosh Singhf4d88672017-11-29 13:35:43 +00003 *
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
15extern "C" {
16#endif
17
18/**
19 * \brief Macro to encode an svc instruction
20 *
21 */
22#define SVC(code) __ASM("svc %0" : : "I" (code))
23
24/**
25 * \brief Numbers associated to each SVC available
26 *
27 * \details Start from 1 as 0 is reserved by RTX
28 */
29enum tfm_svc_num {
30 SVC_INVALID = 0,
31
32/* SVC API for SST */
33 SVC_TFM_SST_GET_HANDLE,
34 SVC_TFM_SST_CREATE,
35 SVC_TFM_SST_GET_ATTRIBUTES,
36 SVC_TFM_SST_READ,
37 SVC_TFM_SST_WRITE,
38 SVC_TFM_SST_DELETE,
39
40#if defined(CORE_TEST_INTERACTIVE)
41 SVC_SECURE_DECREMENT_NS_LOCK_1,
42 SVC_SECURE_DECREMENT_NS_LOCK_2,
43#endif /* CORE_TEST_INTERACTIVE */
44
45#if defined(CORE_TEST_SERVICES)
46 SVC_TFM_CORE_TEST,
47 SVC_TFM_CORE_TEST_MULTIPLE_CALLS,
48#endif /* CORE_TEST_SERVICES */
49
Jamie Fox5592db02017-12-18 16:48:29 +000050#if defined(SST_TEST_SERVICES)
51 SVC_SST_TEST_SERVICE_SETUP,
52 SVC_SST_TEST_SERVICE_DUMMY_ENCRYPT,
53 SVC_SST_TEST_SERVICE_DUMMY_DECRYPT,
54 SVC_SST_TEST_SERVICE_CLEAN,
55#endif /* SST_TEST_SERVICES */
56
Ashutosh Singhf4d88672017-11-29 13:35:43 +000057 /* 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 (SVC_TFM_MAX - 1)
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif /* __TFM_NS_SVC_H__ */