blob: 62d9ad2dde2ea733529653dc1d921793cd649003 [file] [log] [blame]
Ken Liu82e3eac2021-10-14 16:19:13 +08001/*
Xinyu Zhang526bf5f2023-04-18 13:58:15 +08002 * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
Ken Liu82e3eac2021-10-14 16:19:13 +08003 *
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
12psa_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}