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
320 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister()
329 shm->sec_world_id = 0; in optee_ffa_shm_unregister()
343 struct tee_shm *shm) in optee_ffa_shm_unregister_supp() argument
347 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister_supp()
362 shm->sec_world_id = 0; in optee_ffa_shm_unregister_supp()
375 struct tee_shm *shm, size_t size, size_t align) in pool_ffa_op_alloc() argument
377 return optee_pool_op_alloc_helper(pool, shm, size, align, in pool_ffa_op_alloc()
382 struct tee_shm *shm) in pool_ffa_op_free() argument
384 optee_pool_op_free_helper(pool, shm, optee_ffa_shm_unregister); in pool_ffa_op_free()
430 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_alloc() local
440 shm = optee_rpc_cmd_alloc_suppl(ctx, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_alloc()
443 shm = tee_shm_alloc_priv_buf(optee->ctx, in handle_ffa_rpc_func_cmd_shm_alloc()
451 if (IS_ERR(shm)) { in handle_ffa_rpc_func_cmd_shm_alloc()
458 .u.fmem.size = tee_shm_get_size(shm), in handle_ffa_rpc_func_cmd_shm_alloc()
459 .u.fmem.global_id = shm->sec_world_id, in handle_ffa_rpc_func_cmd_shm_alloc()
460 .u.fmem.internal_offs = shm->offset, in handle_ffa_rpc_func_cmd_shm_alloc()
470 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_free() local
476 shm = optee_shm_from_ffa_handle(optee, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_free()
477 if (!shm) in handle_ffa_rpc_func_cmd_shm_free()
481 optee_rpc_cmd_free_suppl(ctx, shm); in handle_ffa_rpc_func_cmd_shm_free()
484 tee_shm_free(shm); in handle_ffa_rpc_func_cmd_shm_free()
615 struct tee_shm *shm, u_int offs) in optee_ffa_do_call_with_arg() argument
619 .data1 = (u32)shm->sec_world_id, in optee_ffa_do_call_with_arg()
620 .data2 = (u32)(shm->sec_world_id >> 32), in optee_ffa_do_call_with_arg()
633 if (shm->offset) in optee_ffa_do_call_with_arg()
636 arg = tee_shm_get_va(shm, offs); in optee_ffa_do_call_with_arg()
641 rpc_arg = tee_shm_get_va(shm, offs + rpc_arg_offs); in optee_ffa_do_call_with_arg()