blob: e83b07661db530ef0478dd6f3674cedeb5829ba5 [file] [log] [blame]
Ashutosh Singhf4d88672017-11-29 13:35:43 +00001/*
2 * Copyright (c) 2017, 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
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
50 /* add all the new entries above this line */
51 SVC_TFM_MAX,
52};
53
54/* number of user SVC functions */
55#define USER_SVC_COUNT (SVC_TFM_MAX - 1)
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* __TFM_NS_SVC_H__ */