Home
last modified time | relevance | path

Searched full:shm (Results 1 – 25 of 149) sorted by relevance

123456

/Linux-v5.15/drivers/tee/
Dtee_shm.c15 static void release_registered_pages(struct tee_shm *shm) in release_registered_pages() argument
17 if (shm->pages) { in release_registered_pages()
18 if (shm->flags & TEE_SHM_USER_MAPPED) { in release_registered_pages()
19 unpin_user_pages(shm->pages, shm->num_pages); in release_registered_pages()
23 for (n = 0; n < shm->num_pages; n++) in release_registered_pages()
24 put_page(shm->pages[n]); in release_registered_pages()
27 kfree(shm->pages); in release_registered_pages()
31 static void tee_shm_release(struct tee_shm *shm) in tee_shm_release() argument
33 struct tee_device *teedev = shm->ctx->teedev; in tee_shm_release()
35 if (shm->flags & TEE_SHM_DMA_BUF) { in tee_shm_release()
[all …]
Dtee_core.c287 struct tee_shm *shm; in tee_ioctl_shm_alloc() local
296 shm = tee_shm_alloc(ctx, data.size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF); in tee_ioctl_shm_alloc()
297 if (IS_ERR(shm)) in tee_ioctl_shm_alloc()
298 return PTR_ERR(shm); in tee_ioctl_shm_alloc()
300 data.id = shm->id; in tee_ioctl_shm_alloc()
301 data.flags = shm->flags; in tee_ioctl_shm_alloc()
302 data.size = shm->size; in tee_ioctl_shm_alloc()
307 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_alloc()
314 tee_shm_put(shm); in tee_ioctl_shm_alloc()
324 struct tee_shm *shm; in tee_ioctl_shm_register() local
[all …]
Dtee_shm_pool.c13 struct tee_shm *shm, size_t size) in pool_op_gen_alloc() argument
24 shm->kaddr = (void *)va; in pool_op_gen_alloc()
25 shm->paddr = gen_pool_virt_to_phys(genpool, va); in pool_op_gen_alloc()
26 shm->size = s; in pool_op_gen_alloc()
31 struct tee_shm *shm) in pool_op_gen_free() argument
33 gen_pool_free(poolm->private_data, (unsigned long)shm->kaddr, in pool_op_gen_free()
34 shm->size); in pool_op_gen_free()
35 shm->kaddr = NULL; in pool_op_gen_free()
/Linux-v5.15/drivers/tee/optee/
Dshm_pool.c16 struct tee_shm *shm, size_t size) in pool_op_alloc() argument
26 shm->kaddr = page_address(page); in pool_op_alloc()
27 shm->paddr = page_to_phys(page); in pool_op_alloc()
28 shm->size = PAGE_SIZE << order; in pool_op_alloc()
34 if (!(shm->flags & TEE_SHM_PRIV)) { in pool_op_alloc()
49 shm->flags |= TEE_SHM_REGISTER; in pool_op_alloc()
50 rc = optee_shm_register(shm->ctx, shm, pages, nr_pages, in pool_op_alloc()
51 (unsigned long)shm->kaddr); in pool_op_alloc()
65 struct tee_shm *shm) in pool_op_free() argument
67 if (!(shm->flags & TEE_SHM_PRIV)) in pool_op_free()
[all …]
Drpc.c105 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()
[all …]
Dcall.c183 struct tee_shm *shm; in get_msg_arg() local
186 shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params), in get_msg_arg()
188 if (IS_ERR(shm)) in get_msg_arg()
189 return shm; in get_msg_arg()
191 ma = tee_shm_get_va(shm, 0); in get_msg_arg()
197 rc = tee_shm_get_pa(shm, 0, msg_parg); in get_msg_arg()
206 tee_shm_free(shm); in get_msg_arg()
210 return shm; in get_msg_arg()
219 struct tee_shm *shm; in optee_open_session() local
226 shm = get_msg_arg(ctx, arg->num_params + 2, &msg_arg, &msg_parg); in optee_open_session()
[all …]
Dcore.c43 struct tee_shm *shm; in optee_from_msg_param() local
71 shm = (struct tee_shm *)(unsigned long) in optee_from_msg_param()
73 if (!shm) { in optee_from_msg_param()
75 p->u.memref.shm = NULL; in optee_from_msg_param()
78 rc = tee_shm_get_pa(shm, 0, &pa); in optee_from_msg_param()
82 p->u.memref.shm = shm; in optee_from_msg_param()
90 shm = (struct tee_shm *)(unsigned long) in optee_from_msg_param()
93 if (!shm) { in optee_from_msg_param()
95 p->u.memref.shm = NULL; in optee_from_msg_param()
99 p->u.memref.shm = shm; in optee_from_msg_param()
[all …]
Doptee_private.h164 int optee_shm_register(struct tee_context *ctx, struct tee_shm *shm,
167 int optee_shm_unregister(struct tee_context *ctx, struct tee_shm *shm);
169 int optee_shm_register_supp(struct tee_context *ctx, struct tee_shm *shm,
172 int optee_shm_unregister_supp(struct tee_context *ctx, struct tee_shm *shm);
/Linux-v5.15/drivers/tee/amdtee/
Dshm_pool.c11 static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, struct tee_shm *shm, in pool_op_alloc() argument
22 shm->kaddr = (void *)va; in pool_op_alloc()
23 shm->paddr = __psp_pa((void *)va); in pool_op_alloc()
24 shm->size = PAGE_SIZE << order; in pool_op_alloc()
27 rc = amdtee_map_shmem(shm); in pool_op_alloc()
30 shm->kaddr = NULL; in pool_op_alloc()
37 static void pool_op_free(struct tee_shm_pool_mgr *poolm, struct tee_shm *shm) in pool_op_free() argument
40 amdtee_unmap_shmem(shm); in pool_op_free()
41 free_pages((unsigned long)shm->kaddr, get_order(shm->size)); in pool_op_free()
42 shm->kaddr = NULL; in pool_op_free()
Dcore.c153 u32 get_buffer_id(struct tee_shm *shm) in get_buffer_id() argument
155 struct amdtee_context_data *ctxdata = shm->ctx->data; in get_buffer_id()
161 if (shmdata->kaddr == shm->kaddr) { in get_buffer_id()
341 int amdtee_map_shmem(struct tee_shm *shm) in amdtee_map_shmem() argument
349 if (!shm) in amdtee_map_shmem()
357 shmem.kaddr = shm->kaddr; in amdtee_map_shmem()
358 shmem.size = shm->size; in amdtee_map_shmem()
371 shmnode->kaddr = shm->kaddr; in amdtee_map_shmem()
373 ctxdata = shm->ctx->data; in amdtee_map_shmem()
383 void amdtee_unmap_shmem(struct tee_shm *shm) in amdtee_unmap_shmem() argument
[all …]
Damdtee_private.h148 int amdtee_map_shmem(struct tee_shm *shm);
150 void amdtee_unmap_shmem(struct tee_shm *shm);
171 u32 get_buffer_id(struct tee_shm *shm);
/Linux-v5.15/include/linux/
Dtee_drv.h66 struct tee_shm *shm; member
114 int (*shm_register)(struct tee_context *ctx, struct tee_shm *shm,
117 int (*shm_unregister)(struct tee_context *ctx, struct tee_shm *shm);
203 * subsystem and from drivers that implements their own shm pool manager.
235 int (*alloc)(struct tee_shm_pool_mgr *poolmgr, struct tee_shm *shm,
237 void (*free)(struct tee_shm_pool_mgr *poolmgr, struct tee_shm *shm);
242 * tee_shm_pool_alloc() - Create a shared memory pool from shm managers
255 * tee_shm_pool_mgr_alloc_res_mem() - Create a shm manager for reserved
352 * @shm: Shared memory handle
355 static inline bool tee_shm_is_registered(struct tee_shm *shm) in tee_shm_is_registered() argument
[all …]
/Linux-v5.15/drivers/media/platform/s5p-mfc/
Ds5p_mfc_opr_v5.c224 ctx->shm.size = buf_size->shm; in s5p_mfc_alloc_instance_buffer_v5()
225 ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->shm); in s5p_mfc_alloc_instance_buffer_v5()
233 ctx->shm.ofs = ctx->shm.dma - dev->dma_base[BANK_L_CTX]; in s5p_mfc_alloc_instance_buffer_v5()
234 BUG_ON(ctx->shm.ofs & ((1 << MFC_BANK1_ALIGN_ORDER) - 1)); in s5p_mfc_alloc_instance_buffer_v5()
236 memset(ctx->shm.virt, 0, buf_size->shm); in s5p_mfc_alloc_instance_buffer_v5()
245 s5p_mfc_release_priv_buf(ctx->dev, &ctx->shm); in s5p_mfc_release_instance_buffer_v5()
263 *(u32 *)(ctx->shm.virt + ofs) = data; in s5p_mfc_write_info_v5()
271 return *(u32 *)(ctx->shm.virt + ofs); in s5p_mfc_read_info_v5()
358 mfc_write(dev, ctx->shm.ofs, S5P_FIMV_SI_CH0_HOST_WR_ADR); in s5p_mfc_set_shared_buffer()
679 unsigned int shm; in s5p_mfc_set_enc_params() local
[all …]
/Linux-v5.15/sound/usb/usx2y/
Dusx2yhwdeppcm.c107 struct snd_usx2y_hwdep_pcm_shm *shm = usx2y->hwdep_pcm_shm; in usx2y_hwdep_urb_play_prepare() local
110 if (shm->playback_iso_start < 0) { in usx2y_hwdep_urb_play_prepare()
111 shm->playback_iso_start = shm->captured_iso_head - in usx2y_hwdep_urb_play_prepare()
113 if (shm->playback_iso_start < 0) in usx2y_hwdep_urb_play_prepare()
114 shm->playback_iso_start += ARRAY_SIZE(shm->captured_iso); in usx2y_hwdep_urb_play_prepare()
115 shm->playback_iso_head = shm->playback_iso_start; in usx2y_hwdep_urb_play_prepare()
121 counts = shm->captured_iso[shm->playback_iso_head].length / usx2y->stride; in usx2y_hwdep_urb_play_prepare()
127 urb->iso_frame_desc[pack].offset = shm->captured_iso[shm->playback_iso_head].offset; in usx2y_hwdep_urb_play_prepare()
128 urb->iso_frame_desc[pack].length = shm->captured_iso[shm->playback_iso_head].length; in usx2y_hwdep_urb_play_prepare()
132 if (++shm->playback_iso_head >= ARRAY_SIZE(shm->captured_iso)) in usx2y_hwdep_urb_play_prepare()
[all …]
DusX2Yhwdep.c73 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; in snd_us428ctls_poll() local
80 if (shm && shm->ctl_snapshot_last != shm->ctl_snapshot_red) in snd_us428ctls_poll()
/Linux-v5.15/tools/testing/selftests/futex/functional/
Dfutex_wait.c9 #include <sys/shm.h>
54 void *shm; in main() local
137 shm = mmap(NULL, sizeof(f_private), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in main()
138 if (shm == MAP_FAILED) { in main()
143 memcpy(shm, &f_private, sizeof(f_private)); in main()
145 futex = shm; in main()
154 res = futex_wake(shm, 1, 0); in main()
165 munmap(shm, sizeof(f_private)); in main()
/Linux-v5.15/drivers/char/tpm/
Dtpm_ftpm_tee.c82 struct tee_shm *shm = pvt_data->shm; in ftpm_tee_tpm_op_send() local
106 .shm = shm, in ftpm_tee_tpm_op_send()
112 temp_buf = tee_shm_get_va(shm, 0); in ftpm_tee_tpm_op_send()
124 .shm = shm, in ftpm_tee_tpm_op_send()
138 temp_buf = tee_shm_get_va(shm, command_params[1].u.memref.shm_offs); in ftpm_tee_tpm_op_send()
257 pvt_data->shm = tee_shm_alloc_kernel_buf(pvt_data->ctx, in ftpm_tee_probe()
260 if (IS_ERR(pvt_data->shm)) { in ftpm_tee_probe()
290 tee_shm_free(pvt_data->shm); in ftpm_tee_probe()
324 tee_shm_free(pvt_data->shm); in ftpm_tee_remove()
352 tee_shm_free(pvt_data->shm); in ftpm_plat_tee_shutdown()
Dtpm_ftpm_tee.h29 * @shm: Memory pool shared with fTPM TA in TEE.
37 struct tee_shm *shm; member
/Linux-v5.15/security/keys/trusted-keys/
Dtrusted_tee.c77 dev_err(pvt_data.dev, "key shm register failed\n"); in trusted_tee_seal()
85 dev_err(pvt_data.dev, "blob shm register failed\n"); in trusted_tee_seal()
95 param[0].u.memref.shm = reg_shm_in; in trusted_tee_seal()
99 param[1].u.memref.shm = reg_shm_out; in trusted_tee_seal()
138 dev_err(pvt_data.dev, "blob shm register failed\n"); in trusted_tee_unseal()
146 dev_err(pvt_data.dev, "key shm register failed\n"); in trusted_tee_unseal()
156 param[0].u.memref.shm = reg_shm_in; in trusted_tee_unseal()
160 param[1].u.memref.shm = reg_shm_out; in trusted_tee_unseal()
198 dev_err(pvt_data.dev, "key shm register failed\n"); in trusted_tee_get_random()
207 param[0].u.memref.shm = reg_shm; in trusted_tee_get_random()
/Linux-v5.15/include/uapi/linux/
Dshm.h24 #define SHMALL (ULONG_MAX - (1UL << 24)) /* max shm system wide (pages) */
103 __kernel_ulong_t shm_tot; /* total allocated shm */
104 __kernel_ulong_t shm_rss; /* total resident shm */
105 __kernel_ulong_t shm_swp; /* total swapped shm */
/Linux-v5.15/ipc/
Dshm.c3 * linux/ipc/shm.c
7 * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli.
9 * /proc/sysvipc/shm support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
11 * SMP thread shm, Jean-Luc Boyard <jean-luc.boyard@siemens.fr>
31 #include <linux/shm.h>
65 /* The task created the shm object. NULL if the task is dead. */
147 ipc_init_proc_interface("sysvipc/shm", in shm_init()
259 /* This is called by fork, once for every shm attach. */
300 * shm_may_destroy - identifies whether shm segment should be destroyed now
330 /* remove from the list of attaches of the shm segment */ in shm_close()
[all …]
/Linux-v5.15/tools/testing/selftests/vm/
Dwrite_to_hugetlbfs.c16 #include <sys/shm.h>
24 SHM, enumerator
196 case SHM: in main()
197 printf("Allocating using SHM.\n"); in main()
Dhugepage-shm.c3 * hugepage-shm:
35 #include <sys/shm.h>
/Linux-v5.15/tools/testing/selftests/proc/
Dsetns-sysvipc.c33 #include <sys/shm.h>
101 (void)open("/proc/sysvipc/shm", O_RDONLY); in main()
115 fd = open("/proc/sysvipc/shm", O_RDONLY); in main()
/Linux-v5.15/Documentation/translations/zh_CN/filesystems/
Dtmpfs.rst39 tmpfs /dev/shm tmpfs defaults 0 0
44 tmpfs的前身(shm fs)才能使用SYSV共享内存)

123456