Lines Matching refs:shm
178 struct tee_shm *shm; in get_msg_arg() local
181 shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params), in get_msg_arg()
183 if (IS_ERR(shm)) in get_msg_arg()
184 return shm; in get_msg_arg()
186 ma = tee_shm_get_va(shm, 0); in get_msg_arg()
192 rc = tee_shm_get_pa(shm, 0, msg_parg); in get_msg_arg()
201 tee_shm_free(shm); in get_msg_arg()
205 return shm; in get_msg_arg()
214 struct tee_shm *shm; in optee_open_session() local
220 shm = get_msg_arg(ctx, arg->num_params + 2, &msg_arg, &msg_parg); in optee_open_session()
221 if (IS_ERR(shm)) in optee_open_session()
222 return PTR_ERR(shm); in optee_open_session()
275 tee_shm_free(shm); in optee_open_session()
283 struct tee_shm *shm; in optee_close_session() local
298 shm = get_msg_arg(ctx, 0, &msg_arg, &msg_parg); in optee_close_session()
299 if (IS_ERR(shm)) in optee_close_session()
300 return PTR_ERR(shm); in optee_close_session()
306 tee_shm_free(shm); in optee_close_session()
314 struct tee_shm *shm; in optee_invoke_func() local
327 shm = get_msg_arg(ctx, arg->num_params, &msg_arg, &msg_parg); in optee_invoke_func()
328 if (IS_ERR(shm)) in optee_invoke_func()
329 return PTR_ERR(shm); in optee_invoke_func()
352 tee_shm_free(shm); in optee_invoke_func()
359 struct tee_shm *shm; in optee_cancel_req() local
371 shm = get_msg_arg(ctx, 0, &msg_arg, &msg_parg); in optee_cancel_req()
372 if (IS_ERR(shm)) in optee_cancel_req()
373 return PTR_ERR(shm); in optee_cancel_req()
380 tee_shm_free(shm); in optee_cancel_req()
429 struct tee_shm *shm; in optee_disable_shm_cache() local
431 shm = reg_pair_to_ptr(res.result.shm_upper32, in optee_disable_shm_cache()
433 tee_shm_free(shm); in optee_disable_shm_cache()
565 int optee_shm_register(struct tee_context *ctx, struct tee_shm *shm, in optee_shm_register() argument
593 tee_shm_get_page_offset(shm)); in optee_shm_register()
598 msg_arg->params->u.tmem.shm_ref = (unsigned long)shm; in optee_shm_register()
599 msg_arg->params->u.tmem.size = tee_shm_get_size(shm); in optee_shm_register()
605 (tee_shm_get_page_offset(shm) & (OPTEE_MSG_NONCONTIG_PAGE_SIZE - 1)); in optee_shm_register()
617 int optee_shm_unregister(struct tee_context *ctx, struct tee_shm *shm) in optee_shm_unregister() argument
631 msg_arg->params[0].u.rmem.shm_ref = (unsigned long)shm; in optee_shm_unregister()
640 int optee_shm_register_supp(struct tee_context *ctx, struct tee_shm *shm, in optee_shm_register_supp() argument
651 int optee_shm_unregister_supp(struct tee_context *ctx, struct tee_shm *shm) in optee_shm_unregister_supp() argument