Lines Matching refs:optee
135 void optee_shm_arg_cache_init(struct optee *optee, u32 flags) in optee_shm_arg_cache_init() argument
137 INIT_LIST_HEAD(&optee->shm_arg_cache.shm_args); in optee_shm_arg_cache_init()
138 mutex_init(&optee->shm_arg_cache.mutex); in optee_shm_arg_cache_init()
139 optee->shm_arg_cache.flags = flags; in optee_shm_arg_cache_init()
142 void optee_shm_arg_cache_uninit(struct optee *optee) in optee_shm_arg_cache_uninit() argument
144 struct list_head *head = &optee->shm_arg_cache.shm_args; in optee_shm_arg_cache_uninit()
147 mutex_destroy(&optee->shm_arg_cache.mutex); in optee_shm_arg_cache_uninit()
187 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_get_msg_arg() local
188 size_t sz = optee_msg_arg_size(optee->rpc_param_count); in optee_get_msg_arg()
199 if (optee->shm_arg_cache.flags & OPTEE_SHM_ARG_SHARED) in optee_get_msg_arg()
204 mutex_lock(&optee->shm_arg_cache.mutex); in optee_get_msg_arg()
205 list_for_each_entry(entry, &optee->shm_arg_cache.shm_args, list_node) { in optee_get_msg_arg()
220 if (optee->shm_arg_cache.flags & OPTEE_SHM_ARG_ALLOC_PRIV) in optee_get_msg_arg()
230 list_add(&entry->list_node, &optee->shm_arg_cache.shm_args); in optee_get_msg_arg()
246 mutex_unlock(&optee->shm_arg_cache.mutex); in optee_get_msg_arg()
261 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_free_msg_arg() local
262 size_t sz = optee_msg_arg_size(optee->rpc_param_count); in optee_free_msg_arg()
271 mutex_lock(&optee->shm_arg_cache.mutex); in optee_free_msg_arg()
277 mutex_unlock(&optee->shm_arg_cache.mutex); in optee_free_msg_arg()
284 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_open_session() local
320 rc = optee->ops->to_msg_param(optee, msg_arg->params + 2, in optee_open_session()
331 if (optee->ops->do_call_with_arg(ctx, shm, offs)) { in optee_open_session()
346 if (optee->ops->from_msg_param(optee, param, arg->num_params, in optee_open_session()
365 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_close_session_helper() local
377 optee->ops->do_call_with_arg(ctx, shm, offs); in optee_close_session_helper()
405 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_invoke_func() local
430 rc = optee->ops->to_msg_param(optee, msg_arg->params, arg->num_params, in optee_invoke_func()
435 if (optee->ops->do_call_with_arg(ctx, shm, offs)) { in optee_invoke_func()
440 if (optee->ops->from_msg_param(optee, param, arg->num_params, in optee_invoke_func()
455 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_cancel_req() local
477 optee->ops->do_call_with_arg(ctx, shm, offs); in optee_cancel_req()