TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __TFM_API_H__
9 #define __TFM_API_H__
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #include <stdint.h>
16 #include "psa/client.h"
17 
18 #define TFM_INVALID_CLIENT_ID 0
19 
28 #define TFM_CLIENT_ID_IS_S(client_id) ((client_id)>0)
29 
38 #define TFM_CLIENT_ID_IS_NS(client_id) ((client_id)<0)
39 
40 /* The mask used for timeout values */
41 #define PSA_TIMEOUT_MASK PSA_BLOCK
42 
43 /* FixMe: sort out DEBUG compile option and limit return value options
44  * on external interfaces */
46 {
59 };
60 
61 /*
62  * Structure to package type, in_len and out_len, it is mainly used for
63  * psa_call.
64  */
66  int32_t type;
67  size_t in_len;
68  size_t out_len;
69 };
70 
71 /********************* Secure function declarations ***************************/
72 
83 enum tfm_status_e tfm_register_client_id (int32_t ns_client_id);
84 
91 
99 uint32_t tfm_psa_version_veneer(uint32_t sid);
100 
109 psa_handle_t tfm_psa_connect_veneer(uint32_t sid, uint32_t version);
110 
123  const struct tfm_control_parameter_t *ctrl_param,
124  const psa_invec *in_vec,
125  psa_outvec *out_vec);
126 
135 
136 /***************** End Secure function declarations ***************************/
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* __TFM_API_H__ */
uint32_t tfm_psa_version_veneer(uint32_t sid)
Return version of secure function provided by secure binary.
tfm_status_e
Definition: tfm_api.h:45
void tfm_psa_close_veneer(psa_handle_t handle)
Close connection to secure function referenced by a connection handle.
psa_status_t tfm_psa_call_veneer(psa_handle_t handle, const struct tfm_control_parameter_t *ctrl_param, const psa_invec *in_vec, psa_outvec *out_vec)
Call a secure function referenced by a connection handle.
psa_handle_t tfm_psa_connect_veneer(uint32_t sid, uint32_t version)
Connect to secure function.
uint32_t tfm_psa_framework_version_veneer(void)
Retrieve the version of the PSA Framework API that is implemented.
int32_t psa_handle_t
Definition: client.h:61
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:43
enum tfm_status_e tfm_register_client_id(int32_t ns_client_id)
Assign client ID to the current TZ context.