Lines Matching refs:shm
175 struct tee_shm *shm; in cmd_alloc_suppl() local
188 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in cmd_alloc_suppl()
190 return shm; in cmd_alloc_suppl()
198 struct tee_shm *shm; in handle_rpc_func_cmd_shm_alloc() local
220 shm = cmd_alloc_suppl(ctx, sz); in handle_rpc_func_cmd_shm_alloc()
223 shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED); in handle_rpc_func_cmd_shm_alloc()
230 if (IS_ERR(shm)) { in handle_rpc_func_cmd_shm_alloc()
235 if (tee_shm_get_pa(shm, 0, &pa)) { in handle_rpc_func_cmd_shm_alloc()
240 sz = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
242 if (tee_shm_is_registered(shm)) { in handle_rpc_func_cmd_shm_alloc()
247 pages = tee_shm_get_pages(shm, &page_num); in handle_rpc_func_cmd_shm_alloc()
269 (tee_shm_get_page_offset(shm) & in handle_rpc_func_cmd_shm_alloc()
271 arg->params[0].u.tmem.size = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
272 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
275 tee_shm_get_page_offset(shm)); in handle_rpc_func_cmd_shm_alloc()
280 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
286 tee_shm_free(shm); in handle_rpc_func_cmd_shm_alloc()
289 static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm) in cmd_free_suppl() argument
295 param.u.value.b = tee_shm_get_id(shm); in cmd_free_suppl()
309 tee_shm_put(shm); in cmd_free_suppl()
317 struct tee_shm *shm; in handle_rpc_func_cmd_shm_free() local
327 shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b; in handle_rpc_func_cmd_shm_free()
330 cmd_free_suppl(ctx, shm); in handle_rpc_func_cmd_shm_free()
333 tee_shm_free(shm); in handle_rpc_func_cmd_shm_free()
357 struct tee_shm *shm, in handle_rpc_func_cmd() argument
362 arg = tee_shm_get_va(shm, 0); in handle_rpc_func_cmd()
364 pr_err("%s: tee_shm_get_va %p failed\n", __func__, shm); in handle_rpc_func_cmd()
403 struct tee_shm *shm; in optee_handle_rpc() local
408 shm = tee_shm_alloc(ctx, param->a1, TEE_SHM_MAPPED); in optee_handle_rpc()
409 if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) { in optee_handle_rpc()
412 (unsigned long)shm); in optee_handle_rpc()
421 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
422 tee_shm_free(shm); in optee_handle_rpc()
433 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
434 handle_rpc_func_cmd(ctx, optee, shm, call_ctx); in optee_handle_rpc()