Lines Matching full:shm

105 	msg.buf  = params[2].u.memref.shm->kaddr;  in handle_rpc_func_cmd_i2c_transfer()
269 struct tee_shm *shm; in cmd_alloc_suppl() local
282 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in cmd_alloc_suppl()
284 return shm; in cmd_alloc_suppl()
292 struct tee_shm *shm; in handle_rpc_func_cmd_shm_alloc() local
314 shm = cmd_alloc_suppl(ctx, sz); in handle_rpc_func_cmd_shm_alloc()
317 shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED | TEE_SHM_PRIV); in handle_rpc_func_cmd_shm_alloc()
324 if (IS_ERR(shm)) { in handle_rpc_func_cmd_shm_alloc()
329 if (tee_shm_get_pa(shm, 0, &pa)) { in handle_rpc_func_cmd_shm_alloc()
334 sz = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
336 if (tee_shm_is_registered(shm)) { in handle_rpc_func_cmd_shm_alloc()
341 pages = tee_shm_get_pages(shm, &page_num); in handle_rpc_func_cmd_shm_alloc()
363 (tee_shm_get_page_offset(shm) & in handle_rpc_func_cmd_shm_alloc()
365 arg->params[0].u.tmem.size = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
366 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
369 tee_shm_get_page_offset(shm)); in handle_rpc_func_cmd_shm_alloc()
374 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
380 tee_shm_free(shm); in handle_rpc_func_cmd_shm_alloc()
383 static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm) in cmd_free_suppl() argument
389 param.u.value.b = tee_shm_get_id(shm); in cmd_free_suppl()
403 tee_shm_put(shm); in cmd_free_suppl()
411 struct tee_shm *shm; in handle_rpc_func_cmd_shm_free() local
421 shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b; in handle_rpc_func_cmd_shm_free()
424 cmd_free_suppl(ctx, shm); in handle_rpc_func_cmd_shm_free()
427 tee_shm_free(shm); in handle_rpc_func_cmd_shm_free()
451 struct tee_shm *shm, in handle_rpc_func_cmd() argument
456 arg = tee_shm_get_va(shm, 0); in handle_rpc_func_cmd()
458 pr_err("%s: tee_shm_get_va %p failed\n", __func__, shm); in handle_rpc_func_cmd()
500 struct tee_shm *shm; in optee_handle_rpc() local
505 shm = tee_shm_alloc(ctx, param->a1, in optee_handle_rpc()
507 if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) { in optee_handle_rpc()
510 (unsigned long)shm); in optee_handle_rpc()
519 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
520 tee_shm_free(shm); in optee_handle_rpc()
531 shm = reg_pair_to_ptr(param->a1, param->a2); in optee_handle_rpc()
532 handle_rpc_func_cmd(ctx, optee, shm, call_ctx); in optee_handle_rpc()