Lines Matching refs:shm
184 struct tee_shm *shm; in cmd_alloc_suppl() local
197 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in cmd_alloc_suppl()
199 return shm; in cmd_alloc_suppl()
207 struct tee_shm *shm; in handle_rpc_func_cmd_shm_alloc() local
229 shm = cmd_alloc_suppl(ctx, sz); in handle_rpc_func_cmd_shm_alloc()
232 shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED); in handle_rpc_func_cmd_shm_alloc()
239 if (IS_ERR(shm)) { in handle_rpc_func_cmd_shm_alloc()
244 if (tee_shm_get_pa(shm, 0, &pa)) { in handle_rpc_func_cmd_shm_alloc()
249 sz = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
251 if (tee_shm_is_registered(shm)) { in handle_rpc_func_cmd_shm_alloc()
256 pages = tee_shm_get_pages(shm, &page_num); in handle_rpc_func_cmd_shm_alloc()
278 (tee_shm_get_page_offset(shm) & in handle_rpc_func_cmd_shm_alloc()
280 arg->params[0].u.tmem.size = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
281 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
284 tee_shm_get_page_offset(shm)); in handle_rpc_func_cmd_shm_alloc()
289 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
295 tee_shm_free(shm); in handle_rpc_func_cmd_shm_alloc()
298 static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm) in cmd_free_suppl() argument
304 param.u.value.b = tee_shm_get_id(shm); in cmd_free_suppl()
318 tee_shm_put(shm); in cmd_free_suppl()
326 struct tee_shm *shm; in handle_rpc_func_cmd_shm_free() local
336 shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b; in handle_rpc_func_cmd_shm_free()
339 cmd_free_suppl(ctx, shm); in handle_rpc_func_cmd_shm_free()
342 tee_shm_free(shm); in handle_rpc_func_cmd_shm_free()
366 struct tee_shm *shm, in handle_rpc_func_cmd() argument
371 arg = tee_shm_get_va(shm, 0); in handle_rpc_func_cmd()
373 pr_err("%s: tee_shm_get_va %p failed\n", __func__, shm); in handle_rpc_func_cmd()
412 struct tee_shm *shm; in optee_handle_rpc() local
417 shm = tee_shm_alloc(ctx, param->a1, TEE_SHM_MAPPED); in optee_handle_rpc()
418 if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) { in optee_handle_rpc()
421 (unsigned long)shm); in optee_handle_rpc()
430 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
431 tee_shm_free(shm); in optee_handle_rpc()
442 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
443 handle_rpc_func_cmd(ctx, optee, shm, call_ctx); in optee_handle_rpc()