Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 1 | /* |
| 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 Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame^] | 13 | psa_status_t tfm_example_service(uint32_t arg) |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 14 | { |
| 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 Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame^] | 26 | status = psa_call(handle, PSA_IPC_CALL, in_vec, IOVEC_LEN(in_vec), NULL, 0); |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 27 | |
| 28 | psa_close(handle); |
| 29 | |
| 30 | return status; |
| 31 | } |