Lines Matching refs:shm
41 struct tee_shm *shm; member
61 struct tee_shm *shm = NULL; in optee_shm_from_ffa_handle() local
68 shm = r->shm; in optee_shm_from_ffa_handle()
71 return shm; in optee_shm_from_ffa_handle()
74 static int optee_shm_add_ffa_handle(struct optee *optee, struct tee_shm *shm, in optee_shm_add_ffa_handle() argument
83 r->shm = shm; in optee_shm_add_ffa_handle()
126 struct tee_shm *shm = NULL; in from_msg_param_ffa_mem() local
135 shm = optee_shm_from_ffa_handle(optee, mp->u.fmem.global_id); in from_msg_param_ffa_mem()
136 p->u.memref.shm = shm; in from_msg_param_ffa_mem()
138 if (shm) { in from_msg_param_ffa_mem()
192 struct tee_shm *shm = p->u.memref.shm; in to_msg_param_ffa_mem() local
197 if (shm) { in to_msg_param_ffa_mem()
200 mp->u.fmem.internal_offs = shm->offset; in to_msg_param_ffa_mem()
208 mp->u.fmem.global_id = shm->sec_world_id; in to_msg_param_ffa_mem()
269 static int optee_ffa_shm_register(struct tee_context *ctx, struct tee_shm *shm, in optee_ffa_shm_register() argument
302 rc = optee_shm_add_ffa_handle(optee, shm, args.g_handle); in optee_ffa_shm_register()
308 shm->sec_world_id = args.g_handle; in optee_ffa_shm_register()
314 struct tee_shm *shm) in optee_ffa_shm_unregister() argument
319 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister()
328 shm->sec_world_id = 0; in optee_ffa_shm_unregister()
342 struct tee_shm *shm) in optee_ffa_shm_unregister_supp() argument
346 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister_supp()
360 shm->sec_world_id = 0; in optee_ffa_shm_unregister_supp()
373 struct tee_shm *shm, size_t size) in pool_ffa_op_alloc() argument
375 return optee_pool_op_alloc_helper(poolm, shm, size, in pool_ffa_op_alloc()
380 struct tee_shm *shm) in pool_ffa_op_free() argument
382 optee_ffa_shm_unregister(shm->ctx, shm); in pool_ffa_op_free()
383 free_pages((unsigned long)shm->kaddr, get_order(shm->size)); in pool_ffa_op_free()
384 shm->kaddr = NULL; in pool_ffa_op_free()
429 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_alloc() local
439 shm = optee_rpc_cmd_alloc_suppl(ctx, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_alloc()
442 shm = tee_shm_alloc(ctx, arg->params[0].u.value.b, in handle_ffa_rpc_func_cmd_shm_alloc()
450 if (IS_ERR(shm)) { in handle_ffa_rpc_func_cmd_shm_alloc()
457 .u.fmem.size = tee_shm_get_size(shm), in handle_ffa_rpc_func_cmd_shm_alloc()
458 .u.fmem.global_id = shm->sec_world_id, in handle_ffa_rpc_func_cmd_shm_alloc()
459 .u.fmem.internal_offs = shm->offset, in handle_ffa_rpc_func_cmd_shm_alloc()
469 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_free() local
475 shm = optee_shm_from_ffa_handle(optee, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_free()
476 if (!shm) in handle_ffa_rpc_func_cmd_shm_free()
480 optee_rpc_cmd_free_suppl(ctx, shm); in handle_ffa_rpc_func_cmd_shm_free()
483 tee_shm_free(shm); in handle_ffa_rpc_func_cmd_shm_free()
614 struct tee_shm *shm) in optee_ffa_do_call_with_arg() argument
618 .data1 = (u32)shm->sec_world_id, in optee_ffa_do_call_with_arg()
619 .data2 = (u32)(shm->sec_world_id >> 32), in optee_ffa_do_call_with_arg()
620 .data3 = shm->offset, in optee_ffa_do_call_with_arg()
622 struct optee_msg_arg *arg = tee_shm_get_va(shm, 0); in optee_ffa_do_call_with_arg()
624 struct optee_msg_arg *rpc_arg = tee_shm_get_va(shm, rpc_arg_offs); in optee_ffa_do_call_with_arg()