Lines Matching refs:shm
291 struct tee_shm *shm; in tee_ioctl_shm_alloc() local
300 shm = tee_shm_alloc(ctx, data.size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF); in tee_ioctl_shm_alloc()
301 if (IS_ERR(shm)) in tee_ioctl_shm_alloc()
302 return PTR_ERR(shm); in tee_ioctl_shm_alloc()
304 data.id = shm->id; in tee_ioctl_shm_alloc()
305 data.flags = shm->flags; in tee_ioctl_shm_alloc()
306 data.size = shm->size; in tee_ioctl_shm_alloc()
311 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_alloc()
318 tee_shm_put(shm); in tee_ioctl_shm_alloc()
328 struct tee_shm *shm; in tee_ioctl_shm_register() local
340 shm = tee_shm_register(ctx, data.addr, data.length, in tee_ioctl_shm_register()
342 if (IS_ERR(shm)) in tee_ioctl_shm_register()
343 return PTR_ERR(shm); in tee_ioctl_shm_register()
345 data.id = shm->id; in tee_ioctl_shm_register()
346 data.flags = shm->flags; in tee_ioctl_shm_register()
347 data.length = shm->size; in tee_ioctl_shm_register()
352 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_register()
358 tee_shm_put(shm); in tee_ioctl_shm_register()
369 struct tee_shm *shm; in params_from_user() local
408 shm = tee_shm_get_from_id(ctx, ip.c); in params_from_user()
409 if (IS_ERR(shm)) in params_from_user()
410 return PTR_ERR(shm); in params_from_user()
418 (ip.a + ip.b) > shm->size) { in params_from_user()
419 tee_shm_put(shm); in params_from_user()
424 shm = NULL; in params_from_user()
431 params[n].u.memref.shm = shm; in params_from_user()
541 params[n].u.memref.shm) in tee_ioctl_open_session()
542 tee_shm_put(params[n].u.memref.shm); in tee_ioctl_open_session()
603 params[n].u.memref.shm) in tee_ioctl_invoke()
604 tee_shm_put(params[n].u.memref.shm); in tee_ioctl_invoke()
662 if (!p->u.memref.shm) { in params_to_supp()
668 ip.c = p->u.memref.shm->id; in params_to_supp()
769 p->u.memref.shm = NULL; in params_from_supp()