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_CONNECTION_REFUSED (INT32_MIN + 1)
36 #define PSA_CONNECTION_BUSY (INT32_MIN + 2)
37 #define PSA_DROP_CONNECTION (INT32_MIN)
38 #define PSA_NULL_HANDLE ((psa_handle_t)0)
39 
40 typedef int32_t psa_status_t;
41 typedef int32_t psa_handle_t;
42 
43 typedef struct psa_invec {
44  const void *base;
45  size_t len;
46 } psa_invec;
47 
48 typedef struct psa_outvec {
49  void *base;
50  size_t len;
51 } psa_outvec;
52 
53 uint32_t psa_framework_version(void);
54 uint32_t psa_version(uint32_t sid);
55 psa_handle_t psa_connect(uint32_t sid, uint32_t minor_version);
56 psa_status_t psa_call(psa_handle_t handle,
57  const psa_invec *in_vec,
58  size_t in_len,
59  psa_outvec *out_vec,
60  size_t out_len);
61 void psa_close(psa_handle_t handle);
62 #endif /* PSA_IPC_IMPLEMENTED */
63 
64 uint32_t pal_ipc_framework_version(void);
65 uint32_t pal_ipc_version(uint32_t sid);
66 psa_handle_t pal_ipc_connect(uint32_t sid, uint32_t minor_version);
67 psa_status_t pal_ipc_call(psa_handle_t handle,
68  const psa_invec *in_vec,
69  size_t in_len,
70  psa_outvec *out_vec,
71  size_t out_len);
72 void pal_ipc_close(psa_handle_t handle);
73 #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.