TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_ps_test_service_api.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
9 
10 #ifdef TFM_PSA_API
11 #include "psa/client.h"
12 #include "psa_manifest/sid.h"
13 #else
14 #include "tfm_veneers.h"
15 #endif
16 
17 __attribute__((section("SFN")))
19 {
20 #ifdef TFM_PSA_API
21  psa_handle_t handle;
22  psa_status_t status;
23 
26  if (!PSA_HANDLE_IS_VALID(handle)) {
28  }
29 
30  status = psa_call(handle, PSA_IPC_CALL, NULL, 0, NULL, 0);
31  psa_close(handle);
32 
33  return status;
34 #else
35  return tfm_tfm_ps_test_prepare_veneer(NULL, 0, NULL, 0);
36 #endif
37 }
#define TFM_PS_TEST_PREPARE_VERSION
Definition: sid.h:131
void psa_close(psa_handle_t handle)
Close a connection to an RoT Service.
Definition: psa_client.c:63
#define PSA_ERROR_GENERIC_ERROR
Definition: crypto_values.h:43
psa_handle_t psa_connect(uint32_t sid, uint32_t version)
Connect to an RoT Service by its SID.
Definition: psa_client.c:30
#define PSA_HANDLE_IS_VALID(handle)
Definition: client.h:43
psa_status_t tfm_ps_test_system_prepare(void)
Requests the PS Test Service to call ps_system_prepare().
int32_t psa_handle_t
Definition: client.h:61
#define TFM_PS_TEST_PREPARE_SID
Definition: sid.h:130
#define PSA_IPC_CALL
Definition: client.h:59
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:43
psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len)
Call an RoT Service on an established connection.
Definition: psa_client.c:47