blob: e1af4b6043eb2487e33dedf9fe540d13a219ed36 [file] [log] [blame]
Anton Komlev4bfd6c52022-06-29 17:10:26 +01001/*
2 * Copyright (c) 2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include "tfm_example_partition_api.h"
9
10#include "psa/client.h"
11#include "psa_manifest/sid.h"
12
Kevin Penga9ec66f2022-07-05 15:21:16 +080013psa_status_t tfm_example_service(uint32_t arg)
Anton Komlev4bfd6c52022-06-29 17:10:26 +010014{
15 psa_status_t status;
16 psa_handle_t handle;
17 psa_invec in_vec[] = {
18 { .base = &arg, .len = sizeof(arg) },
19 };
20
21 handle = psa_connect(TFM_EXAMPLE_SERVICE_SID, TFM_EXAMPLE_SERVICE_VERSION);
22 if (!PSA_HANDLE_IS_VALID(handle)) {
23 return PSA_HANDLE_TO_ERROR(handle);
24 }
25
Kevin Penga9ec66f2022-07-05 15:21:16 +080026 status = psa_call(handle, PSA_IPC_CALL, in_vec, IOVEC_LEN(in_vec), NULL, 0);
Anton Komlev4bfd6c52022-06-29 17:10:26 +010027
28 psa_close(handle);
29
30 return status;
31}