13 static void default_handle_req(
void)
17 static void default_mailbox_reply(
const void *owner, int32_t ret)
23 static const void *default_get_caller_data(int32_t client_id)
30 static struct tfm_rpc_ops_t rpc_ops = {
31 .handle_req = default_handle_req,
32 .reply = default_mailbox_reply,
33 .get_caller_data = default_get_caller_data,
63 params->in_vec, params->in_len,
64 params->out_vec, params->out_len, ns_caller,
79 return TFM_RPC_INVAL_PARAM;
82 if (!ops_ptr->handle_req || !ops_ptr->reply || !ops_ptr->get_caller_data) {
83 return TFM_RPC_INVAL_PARAM;
87 if ((rpc_ops.handle_req != default_handle_req) ||
88 (rpc_ops.reply != default_mailbox_reply) || \
89 (rpc_ops.get_caller_data != default_get_caller_data)) {
90 return TFM_RPC_CONFLICT_CALLBACK;
93 rpc_ops.handle_req = ops_ptr->handle_req;
94 rpc_ops.reply = ops_ptr->reply;
95 rpc_ops.get_caller_data = ops_ptr->get_caller_data;
97 return TFM_RPC_SUCCESS;
102 rpc_ops.handle_req = default_handle_req;
103 rpc_ops.reply = default_mailbox_reply;
104 rpc_ops.get_caller_data = default_get_caller_data;
109 rpc_ops.handle_req();
116 rpc_ops.reply(msg->caller_data, ret);
121 msg->caller_data = rpc_ops.get_caller_data(client_id);
#define TFM_PARTITION_UNPRIVILEGED_MODE
psa_status_t tfm_rpc_psa_connect(const struct client_call_params_t *params, bool ns_caller)
psa_status_t tfm_rpc_psa_call(const struct client_call_params_t *params, bool ns_caller)
uint32_t tfm_spm_client_psa_framework_version(void)
handler for psa_framework_version.
void tfm_rpc_psa_close(const struct client_call_params_t *params, bool ns_caller)
psa_status_t tfm_spm_client_psa_call(psa_handle_t handle, int32_t type, const psa_invec *inptr, size_t in_num, psa_outvec *outptr, size_t out_num, bool ns_caller, uint32_t privileged)
handler for psa_call.
void tfm_spm_client_psa_close(psa_handle_t handle, bool ns_caller)
handler for psa_close.
uint32_t tfm_rpc_psa_framework_version(void)
#define tfm_rpc_client_call_handler()
#define TFM_CORE_ASSERT(cond)
void tfm_rpc_unregister_ops(void)
int32_t tfm_rpc_register_ops(const struct tfm_rpc_ops_t *ops_ptr)
#define tfm_rpc_set_caller_data(msg, client_id)
uint32_t tfm_rpc_psa_version(const struct client_call_params_t *params, bool ns_caller)
psa_status_t tfm_spm_client_psa_connect(uint32_t sid, uint32_t version, bool ns_caller)
handler for psa_connect.
uint32_t tfm_spm_client_psa_version(uint32_t sid, bool ns_caller)
handler for psa_version.
int32_t psa_status_t
Function return status.
#define tfm_rpc_client_call_reply(owner, ret)