Mistake on this page?
Report an issue in GitHub or email us
pal_client_api_intf.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 #ifndef _PAL_CLIENT_API_H_
19 #define _PAL_CLIENT_API_H_
20 
21 #if PSA_IPC_IMPLEMENTED
22 /* psa/client.h: Contains the Client API elements. Accessible to all applications */
23 #include "psa/client.h"
24 
25 /* psa_manifest/sid.h: Macro definitions derived from manifest files that map from RoT Service
26  * names to Service IDs (SIDs).
27  * Partition manifest parse build tool must provide the implementation of this file.
28 */
29 #include "psa_manifest/sid.h"
30 
31 #else
32 #include "pal_common.h"
33 
34 #define PSA_VERSION_NONE (0)
35 #define PSA_SUCCESS (0)
36 #define PSA_CONNECTION_REFUSED (INT32_MIN + 1)
37 #define PSA_CONNECTION_BUSY (INT32_MIN + 2)
38 #define PSA_DROP_CONNECTION (INT32_MIN)
39 #define PSA_NULL_HANDLE ((psa_handle_t)0)
40 
41 typedef int32_t psa_status_t;
42 typedef int32_t psa_handle_t;
43 
44 typedef struct psa_invec {
45  const void *base;
46  size_t len;
47 } psa_invec;
48 
49 typedef struct psa_outvec {
50  void *base;
51  size_t len;
52 } psa_outvec;
53 
54 uint32_t psa_framework_version(void);
55 uint32_t psa_version(uint32_t sid);
56 psa_handle_t psa_connect(uint32_t sid, uint32_t minor_version);
57 psa_status_t psa_call(psa_handle_t handle,
58  const psa_invec *in_vec,
59  size_t in_len,
60  psa_outvec *out_vec,
61  size_t out_len);
62 void psa_close(psa_handle_t handle);
63 #endif /* PSA_IPC_IMPLEMENTED */
64 
65 uint32_t pal_ipc_framework_version(void);
66 uint32_t pal_ipc_version(uint32_t sid);
67 psa_handle_t pal_ipc_connect(uint32_t sid, uint32_t minor_version);
68 psa_status_t pal_ipc_call(psa_handle_t handle,
69  const psa_invec *in_vec,
70  size_t in_len,
71  psa_outvec *out_vec,
72  size_t out_len);
73 void pal_ipc_close(psa_handle_t handle);
74 #endif /* _PAL_CLIENT_API_H_ */
Copyright (c) 2018, Arm Limited or its affiliates.
uint32_t psa_framework_version(void)
Retrieve the version of the PSA Framework API that is implemented.
psa_status_t psa_call(psa_handle_t handle, const psa_invec *in_vec, size_t in_len, const psa_outvec *out_vec, size_t out_len)
Call a connected Root of Trust Service.
size_t len
Length in bytes of the buffer.
Definition: client.h:50
uint32_t pal_ipc_version(uint32_t sid)
Retrieve the minor version of a Root of Trust Service by its SID.
struct psa_outvec psa_outvec
Structure which describes a scatter-gather output buffer.
psa_handle_t pal_ipc_connect(uint32_t sid, uint32_t minor_version)
Connect to given sid.
const void * base
Starting address of the buffer.
Definition: client.h:49
void pal_ipc_close(psa_handle_t handle)
Close a connection to a Root of Trust Service.
psa_handle_t psa_connect(uint32_t sid, uint32_t minor_version)
Connect to a Root of Trust Service by its SID.
Structure which describes a scatter-gather output buffer.
Definition: client.h:54
Structure that describes a scatter-gather input buffer.
Definition: client.h:48
psa_status_t pal_ipc_call(psa_handle_t handle, const psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len)
Call a connected Root of Trust Service.
void psa_close(psa_handle_t handle)
Close a connection to a Root of Trust Service.
struct psa_invec psa_invec
Structure that describes a scatter-gather input buffer.
uint32_t psa_version(uint32_t sid)
Retrieve the minor version of a Root of Trust Service by its SID.
uint32_t pal_ipc_framework_version(void)
Retrieve the version of the PSA Framework API that is implemented.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.