Lines Matching full:shm
42 struct tee_shm *shm; member
62 struct tee_shm *shm = NULL; in optee_shm_from_ffa_handle() local
69 shm = r->shm; in optee_shm_from_ffa_handle()
72 return shm; in optee_shm_from_ffa_handle()
75 static int optee_shm_add_ffa_handle(struct optee *optee, struct tee_shm *shm, in optee_shm_add_ffa_handle() argument
84 r->shm = shm; in optee_shm_add_ffa_handle()
127 struct tee_shm *shm = NULL; in from_msg_param_ffa_mem() local
136 shm = optee_shm_from_ffa_handle(optee, mp->u.fmem.global_id); in from_msg_param_ffa_mem()
137 p->u.memref.shm = shm; in from_msg_param_ffa_mem()
139 if (shm) { in from_msg_param_ffa_mem()
193 struct tee_shm *shm = p->u.memref.shm; in to_msg_param_ffa_mem() local
198 if (shm) { in to_msg_param_ffa_mem()
201 mp->u.fmem.internal_offs = shm->offset; in to_msg_param_ffa_mem()
209 mp->u.fmem.global_id = shm->sec_world_id; in to_msg_param_ffa_mem()
270 static int optee_ffa_shm_register(struct tee_context *ctx, struct tee_shm *shm, in optee_ffa_shm_register() argument
303 rc = optee_shm_add_ffa_handle(optee, shm, args.g_handle); in optee_ffa_shm_register()
309 shm->sec_world_id = args.g_handle; in optee_ffa_shm_register()
315 struct tee_shm *shm) in optee_ffa_shm_unregister() argument
321 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister()
330 shm->sec_world_id = 0; in optee_ffa_shm_unregister()
334 pr_err("Unregister SHM id 0x%llx rc %d\n", global_handle, rc); in optee_ffa_shm_unregister()
344 struct tee_shm *shm) in optee_ffa_shm_unregister_supp() argument
348 u64 global_handle = shm->sec_world_id; in optee_ffa_shm_unregister_supp()
363 shm->sec_world_id = 0; in optee_ffa_shm_unregister_supp()
376 struct tee_shm *shm, size_t size, size_t align) in pool_ffa_op_alloc() argument
378 return tee_dyn_shm_alloc_helper(shm, size, align, in pool_ffa_op_alloc()
383 struct tee_shm *shm) in pool_ffa_op_free() argument
385 tee_dyn_shm_free_helper(shm, optee_ffa_shm_unregister); in pool_ffa_op_free()
431 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_alloc() local
441 shm = optee_rpc_cmd_alloc_suppl(ctx, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_alloc()
444 shm = tee_shm_alloc_priv_buf(optee->ctx, in handle_ffa_rpc_func_cmd_shm_alloc()
452 if (IS_ERR(shm)) { in handle_ffa_rpc_func_cmd_shm_alloc()
459 .u.fmem.size = tee_shm_get_size(shm), in handle_ffa_rpc_func_cmd_shm_alloc()
460 .u.fmem.global_id = shm->sec_world_id, in handle_ffa_rpc_func_cmd_shm_alloc()
461 .u.fmem.internal_offs = shm->offset, in handle_ffa_rpc_func_cmd_shm_alloc()
471 struct tee_shm *shm; in handle_ffa_rpc_func_cmd_shm_free() local
477 shm = optee_shm_from_ffa_handle(optee, arg->params[0].u.value.b); in handle_ffa_rpc_func_cmd_shm_free()
478 if (!shm) in handle_ffa_rpc_func_cmd_shm_free()
482 optee_rpc_cmd_free_suppl(ctx, shm); in handle_ffa_rpc_func_cmd_shm_free()
485 tee_shm_free(shm); in handle_ffa_rpc_func_cmd_shm_free()
607 * @shm: shared memory holding the message to pass to secure world
608 * @offs: offset of the message in @shm
618 struct tee_shm *shm, u_int offs, in optee_ffa_do_call_with_arg() argument
623 .data1 = (u32)shm->sec_world_id, in optee_ffa_do_call_with_arg()
624 .data2 = (u32)(shm->sec_world_id >> 32), in optee_ffa_do_call_with_arg()
633 * an argument struct. This is also what the shm pool allocator in optee_ffa_do_call_with_arg()
637 if (shm->offset) in optee_ffa_do_call_with_arg()
640 arg = tee_shm_get_va(shm, offs); in optee_ffa_do_call_with_arg()
645 rpc_arg = tee_shm_get_va(shm, offs + rpc_arg_offs); in optee_ffa_do_call_with_arg()