Ken Liu | 82e3eac | 2021-10-14 16:19:13 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | #include "psa/client.h" |
| 10 | #include "tfm_psa_call_pack.h" |
| 11 | |
| 12 | psa_status_t psa_call(psa_handle_t handle, |
| 13 | int32_t type, |
| 14 | const psa_invec *in_vec, |
| 15 | size_t in_len, |
| 16 | psa_outvec *out_vec, |
| 17 | size_t out_len) |
| 18 | { |
| 19 | if ((type > INT16_MAX) || |
| 20 | (type < INT16_MIN) || |
| 21 | (in_len > UINT8_MAX) || |
| 22 | (out_len > UINT8_MAX)) { |
| 23 | return PSA_ERROR_PROGRAMMER_ERROR; |
| 24 | } |
| 25 | |
| 26 | return tfm_psa_call_pack(handle, PARAM_PACK(type, in_len, out_len), |
| 27 | in_vec, out_vec); |
| 28 | } |