blob: 0a958c2cf8fd9573d9edd7d243822e2fad6730ee [file] [log] [blame]
Boris Deletic08f48962020-10-28 12:42:58 +00001/*
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
13__attribute__((section("SFN")))
14psa_status_t tfm_example_partition_call(uint32_t arg)
15{
16 psa_status_t status;
17 psa_handle_t handle;
18 psa_invec in_vec[] = {
19 { .base = &arg, .len = sizeof(arg) },
20 };
21
22 handle = psa_connect(TFM_EXAMPLE_SERVICE_SID, TFM_EXAMPLE_SERVICE_VERSION);
23 if (!PSA_HANDLE_IS_VALID(handle)) {
24 return PSA_HANDLE_TO_ERROR(handle);
25 }
26
27 status = psa_call(handle, PSA_IPC_CALL, in_vec, 1, NULL, 0);
28
29 psa_close(handle);
30
31 return status;
32}