| /linux/drivers/tee/ |
| H A D | tee_shm.c | 21 struct tee_shm shm; member 26 static void release_registered_pages(struct tee_shm *shm) in release_registered_pages() argument 28 if (shm->pages) { in release_registered_pages() 29 if (shm->flags & TEE_SHM_USER_MAPPED) in release_registered_pages() 30 unpin_user_pages(shm->pages, shm->num_pages); in release_registered_pages() 32 kfree(shm->pages); in release_registered_pages() 36 static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm) in tee_shm_release() argument 38 void *p = shm; in tee_shm_release() 40 if (shm->flags & TEE_SHM_DMA_MEM) { in tee_shm_release() 44 dma_mem = container_of(shm, struct tee_shm_dma_mem, shm); in tee_shm_release() [all …]
|
| H A D | tee_shm_pool.c | 12 static int pool_op_gen_alloc(struct tee_shm_pool *pool, struct tee_shm *shm, in pool_op_gen_alloc() argument 26 shm->kaddr = (void *)va; in pool_op_gen_alloc() 27 shm->paddr = gen_pool_virt_to_phys(genpool, va); in pool_op_gen_alloc() 28 shm->size = s; in pool_op_gen_alloc() 33 shm->flags &= ~TEE_SHM_DYNAMIC; in pool_op_gen_alloc() 37 static void pool_op_gen_free(struct tee_shm_pool *pool, struct tee_shm *shm) in pool_op_gen_free() argument 39 gen_pool_free(pool->private_data, (unsigned long)shm->kaddr, in pool_op_gen_free() 40 shm->size); in pool_op_gen_free() 41 shm->kaddr = NULL; in pool_op_gen_free()
|
| H A D | tee_core.c | 260 struct tee_shm *shm; in tee_ioctl_shm_alloc() local 269 shm = tee_shm_alloc_user_buf(ctx, data.size); in tee_ioctl_shm_alloc() 270 if (IS_ERR(shm)) in tee_ioctl_shm_alloc() 271 return PTR_ERR(shm); in tee_ioctl_shm_alloc() 273 data.id = shm->id; in tee_ioctl_shm_alloc() 274 data.size = shm->size; in tee_ioctl_shm_alloc() 279 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_alloc() 286 tee_shm_put(shm); in tee_ioctl_shm_alloc() 296 struct tee_shm *shm; in tee_ioctl_shm_register() local 305 shm = tee_shm_register_user_buf(ctx, data.addr, data.length); in tee_ioctl_shm_register() [all …]
|
| H A D | tee_heap.c | 342 struct tee_shm *shm, in tee_heap_update_from_dma_buf() argument 357 shm->size = buf->size; in tee_heap_update_from_dma_buf() 360 buf->offs, shm, parent_shm); in tee_heap_update_from_dma_buf() 384 struct tee_shm *shm __always_unused, in tee_heap_update_from_dma_buf() 435 struct tee_shm *shm, in protmem_pool_op_static_update_shm() argument 440 shm->paddr = stp->pa_base + offs; in protmem_pool_op_static_update_shm()
|
| /linux/drivers/tee/qcomtee/ |
| H A D | shm.c | 44 struct tee_shm *shm; in qcomtee_msg_buffers_alloc() local 68 shm = tee_shm_alloc_priv_buf(ctx, size); in qcomtee_msg_buffers_alloc() 69 if (IS_ERR(shm)) in qcomtee_msg_buffers_alloc() 70 return PTR_ERR(shm); in qcomtee_msg_buffers_alloc() 73 oic->in_shm = shm; in qcomtee_msg_buffers_alloc() 74 shm = tee_shm_alloc_priv_buf(ctx, MAX_OUTBOUND_BUFFER_SIZE); in qcomtee_msg_buffers_alloc() 75 if (IS_ERR(shm)) { in qcomtee_msg_buffers_alloc() 78 return PTR_ERR(shm); in qcomtee_msg_buffers_alloc() 81 oic->out_shm = shm; in qcomtee_msg_buffers_alloc() 102 static int qcomtee_shm_register(struct tee_context *ctx, struct tee_shm *shm, in qcomtee_shm_register() argument [all …]
|
| H A D | mem_obj.c | 37 struct tee_shm *shm; member 68 tee_shm_put(mem_object->shm); in qcomtee_mem_object_release() 91 struct tee_shm *shm; in qcomtee_memobj_param_to_object() local 98 shm = tee_shm_get_from_id(ctx, param->u.objref.id); in qcomtee_memobj_param_to_object() 99 if (IS_ERR(shm)) in qcomtee_memobj_param_to_object() 100 return PTR_ERR(shm); in qcomtee_memobj_param_to_object() 106 shm->id); in qcomtee_memobj_param_to_object() 108 tee_shm_put(shm); in qcomtee_memobj_param_to_object() 113 mem_object->paddr = shm->paddr; in qcomtee_memobj_param_to_object() 114 mem_object->size = shm->size; in qcomtee_memobj_param_to_object() [all …]
|
| /linux/drivers/tee/amdtee/ |
| H A D | shm_pool.c | 11 static int pool_op_alloc(struct tee_shm_pool *pool, struct tee_shm *shm, in pool_op_alloc() argument 26 shm->kaddr = (void *)va; in pool_op_alloc() 27 shm->paddr = __psp_pa((void *)va); in pool_op_alloc() 28 shm->size = PAGE_SIZE << order; in pool_op_alloc() 31 rc = amdtee_map_shmem(shm); in pool_op_alloc() 34 shm->kaddr = NULL; in pool_op_alloc() 41 static void pool_op_free(struct tee_shm_pool *pool, struct tee_shm *shm) in pool_op_free() argument 44 amdtee_unmap_shmem(shm); in pool_op_free() 45 free_pages((unsigned long)shm->kaddr, get_order(shm->size)); in pool_op_free() 46 shm->kaddr = NULL; in pool_op_free()
|
| /linux/drivers/tee/optee/ |
| H A D | smc_abi.c | 86 struct tee_shm *shm; in from_msg_param_tmp_mem() local 93 shm = (struct tee_shm *)(unsigned long)mp->u.tmem.shm_ref; in from_msg_param_tmp_mem() 94 if (!shm) { in from_msg_param_tmp_mem() 96 p->u.memref.shm = NULL; in from_msg_param_tmp_mem() 100 rc = tee_shm_get_pa(shm, 0, &pa); in from_msg_param_tmp_mem() 105 p->u.memref.shm = shm; in from_msg_param_tmp_mem() 113 struct tee_shm *shm; in from_msg_param_reg_mem() local 118 shm = (struct tee_shm *)(unsigned long)mp->u.rmem.shm_ref; in from_msg_param_reg_mem() 120 if (shm) { in from_msg_param_reg_mem() 122 p->u.memref.shm = shm; in from_msg_param_reg_mem() [all …]
|
| H A D | rpc.c | 88 msg.buf = params[2].u.memref.shm->kaddr; in handle_rpc_func_cmd_i2c_transfer() 220 struct tee_shm *shm; in optee_rpc_cmd_alloc_suppl() local 233 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in optee_rpc_cmd_alloc_suppl() 235 return shm; in optee_rpc_cmd_alloc_suppl() 238 void optee_rpc_cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm) in optee_rpc_cmd_free_suppl() argument 244 param.u.value.b = tee_shm_get_id(shm); in optee_rpc_cmd_free_suppl() 258 tee_shm_put(shm); in optee_rpc_cmd_free_suppl() 331 buf = tee_shm_get_va(params[1].u.memref.shm, in handle_rpc_func_rpmb_probe_next() 392 p0 = tee_shm_get_va(params[0].u.memref.shm, in handle_rpc_func_rpmb_frames() 394 p1 = tee_shm_get_va(params[1].u.memref.shm, in handle_rpc_func_rpmb_frames()
|
| H A D | protmem.c | 182 struct tee_shm *shm, in protmem_pool_op_dyn_update_shm() argument 223 struct tee_shm *shm; in get_protmem_config() local 233 params[1].u.memref.shm = shm_param; in get_protmem_config() 237 &shm, &offs); in get_protmem_config() 249 rc = optee->ops->do_call_with_arg(optee->ctx, shm, offs, false); in get_protmem_config()
|
| /linux/drivers/nvmem/ |
| H A D | stm32-bsec-optee-ta.c | 142 struct tee_shm *shm; in stm32_bsec_optee_ta_read() local 168 shm = tee_shm_alloc_kernel_buf(ctx, num_bytes); in stm32_bsec_optee_ta_read() 169 if (IS_ERR(shm)) { in stm32_bsec_optee_ta_read() 170 ret = PTR_ERR(shm); in stm32_bsec_optee_ta_read() 175 param[1].u.memref.shm = shm; in stm32_bsec_optee_ta_read() 186 shm_buf = tee_shm_get_va(shm, 0); in stm32_bsec_optee_ta_read() 196 tee_shm_free(shm); in stm32_bsec_optee_ta_read() 207 { struct tee_shm *shm; in stm32_bsec_optee_ta_write() local 233 shm = tee_shm_alloc_kernel_buf(ctx, bytes); in stm32_bsec_optee_ta_write() 234 if (IS_ERR(shm)) { in stm32_bsec_optee_ta_write() [all …]
|
| /linux/drivers/tee/tstee/ |
| H A D | core.c | 167 struct tee_shm *shm = NULL; in tstee_invoke_func() local 194 shm = tee_shm_get_from_id(ctx, shm_id); in tstee_invoke_func() 195 if (IS_ERR(shm)) in tstee_invoke_func() 196 return PTR_ERR(shm); in tstee_invoke_func() 198 if (shm->size < req_len) { in tstee_invoke_func() 205 handle = shm->sec_world_id; in tstee_invoke_func() 232 if (shm && shm->size >= ffa_args[TS_RPC_SERVICE_RESP_LEN]) in tstee_invoke_func() 236 if (shm) in tstee_invoke_func() 237 tee_shm_put(shm); in tstee_invoke_func() 242 static int tstee_shm_register(struct tee_context *ctx, struct tee_shm *shm, in tstee_shm_register() argument [all …]
|
| /linux/include/linux/ |
| H A D | tee_drv.h | 82 struct tee_shm *shm; member 145 void tee_shm_free(struct tee_shm *shm); 154 void *tee_shm_get_va(struct tee_shm *shm, size_t offs); 164 int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa); 171 static inline size_t tee_shm_get_size(struct tee_shm *shm) in tee_shm_get_size() argument 173 return shm->size; in tee_shm_get_size() 182 static inline struct page **tee_shm_get_pages(struct tee_shm *shm, in tee_shm_get_pages() argument 185 *num_pages = shm->num_pages; in tee_shm_get_pages() 186 return shm->pages; in tee_shm_get_pages() 194 static inline size_t tee_shm_get_page_offset(struct tee_shm *shm) in tee_shm_get_page_offset() argument [all …]
|
| /linux/drivers/media/platform/samsung/s5p-mfc/ |
| H A D | s5p_mfc_opr_v5.c | 224 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() 681 unsigned int shm; in s5p_mfc_set_enc_params() local [all …]
|
| /linux/tools/testing/selftests/futex/functional/ |
| H A D | futex_wait.c | 11 #include <sys/shm.h> 128 void *shm; in TEST() 148 shm = mmap(NULL, sizeof(f_private), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 149 if (shm == MAP_FAILED) { 152 ASSERT_NE(shm, MAP_FAILED) 156 memcpy(shm, &f_private, sizeof(f_private)); 158 futex = shm; 167 res = futex_wake(shm, 1, 0); 174 munmap(shm, sizeof(f_private)); 108 void *shm; TEST() local
|
| /linux/sound/usb/usx2y/ |
| H A D | usx2yhwdeppcm.c | 107 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 …]
|
| H A D | usX2Yhwdep.c | 69 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; in snd_us428ctls_poll() local 76 if (shm && shm->ctl_snapshot_last != shm->ctl_snapshot_red) in snd_us428ctls_poll()
|
| /linux/drivers/rtc/ |
| H A D | rtc-optee.c | 146 struct tee_shm *shm; member 166 param[0].u.memref.shm = priv->shm; in optee_rtc_readtime() 173 optee_tm = tee_shm_get_va(priv->shm, 0); in optee_rtc_readtime() 205 param[0].u.memref.shm = priv->shm; in optee_rtc_settime() 208 optee_tm = tee_shm_get_va(priv->shm, 0); in optee_rtc_settime() 293 param[0].u.memref.shm = priv->shm; in optee_rtc_read_alarm() 300 optee_alarm = tee_shm_get_va(priv->shm, 0); in optee_rtc_read_alarm() 339 param[0].u.memref.shm = priv->shm; in optee_rtc_set_alarm() 342 optee_alarm = tee_shm_get_va(priv->shm, 0); in optee_rtc_set_alarm() 513 param[0].u.memref.shm = priv->shm; in optee_rtc_read_info() [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/ |
| H A D | gsp.c | 188 args->messageQueueInitArguments.sharedMemPhysAddr = gsp->shm.mem.addr; in r570_gsp_set_rmargs() 189 args->messageQueueInitArguments.pageTableEntryCount = gsp->shm.ptes.nr; in r570_gsp_set_rmargs() 191 (u8 *)gsp->shm.cmdq.ptr - (u8 *)gsp->shm.mem.data; in r570_gsp_set_rmargs() 193 (u8 *)gsp->shm.msgq.ptr - (u8 *)gsp->shm.mem.data; in r570_gsp_set_rmargs()
|
| /linux/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/ |
| H A D | gsp.c | 1143 gsp->shm.cmdq.size = 0x40000; in r535_gsp_shared_init() 1144 gsp->shm.msgq.size = 0x40000; in r535_gsp_shared_init() 1146 gsp->shm.ptes.nr = (gsp->shm.cmdq.size + gsp->shm.msgq.size) >> GSP_PAGE_SHIFT; in r535_gsp_shared_init() 1147 gsp->shm.ptes.nr += DIV_ROUND_UP(gsp->shm.ptes.nr * sizeof(u64), GSP_PAGE_SIZE); in r535_gsp_shared_init() 1148 gsp->shm.ptes.size = ALIGN(gsp->shm.ptes.nr * sizeof(u64), GSP_PAGE_SIZE); in r535_gsp_shared_init() 1150 ret = nvkm_gsp_mem_ctor(gsp, gsp->shm.ptes.size + in r535_gsp_shared_init() 1151 gsp->shm.cmdq.size + in r535_gsp_shared_init() 1152 gsp->shm.msgq.size, in r535_gsp_shared_init() 1153 &gsp->shm.mem); in r535_gsp_shared_init() 1157 gsp->shm.ptes.ptr = gsp->shm.mem.data; in r535_gsp_shared_init() [all …]
|
| /linux/security/keys/trusted-keys/ |
| H A D | trusted_tee.c | 76 dev_err(pvt_data.dev, "shm register failed\n"); in trusted_tee_seal() 85 param[0].u.memref.shm = reg_shm; in trusted_tee_seal() 89 param[1].u.memref.shm = reg_shm; in trusted_tee_seal() 123 dev_err(pvt_data.dev, "shm register failed\n"); in trusted_tee_unseal() 132 param[0].u.memref.shm = reg_shm; in trusted_tee_unseal() 136 param[1].u.memref.shm = reg_shm; in trusted_tee_unseal() 169 dev_err(pvt_data.dev, "key shm register failed\n"); in trusted_tee_get_random() 178 param[0].u.memref.shm = reg_shm; in trusted_tee_get_random()
|
| /linux/Documentation/translations/zh_CN/filesystems/ |
| H A D | tmpfs.rst | 36 2) glibc 2.2及更高版本期望将tmpfs挂载在/dev/shm上以用于POSIX共享内存 39 tmpfs /dev/shm tmpfs defaults 0 0 44 tmpfs的前身(shm fs)才能使用SYSV共享内存)
|
| /linux/Documentation/translations/zh_TW/filesystems/ |
| H A D | tmpfs.rst | 36 2) glibc 2.2及更高版本期望將tmpfs掛載在/dev/shm上以用於POSIX共享內存 39 tmpfs /dev/shm tmpfs defaults 0 0 44 tmpfs的前身(shm fs)才能使用SYSV共享內存)
|
| /linux/drivers/firmware/efi/stmm/ |
| H A D | tee_stmm_efi.c | 57 struct tee_shm *shm = NULL; in tee_mm_communicate() local 69 shm = tee_shm_register_kernel_buf(pvt_data.ctx, comm_buf, buf_size); in tee_mm_communicate() 70 if (IS_ERR(shm)) { in tee_mm_communicate() 83 param[0].u.memref.shm = shm; in tee_mm_communicate() 89 tee_shm_free(shm); in tee_mm_communicate()
|
| /linux/arch/arm/boot/dts/nuvoton/ |
| H A D | nuvoton-wpcm450.dtsi | 485 nuvoton,shm = <&shm>; 489 shm: syscon@c8001000 { label 490 compatible = "nuvoton,wpcm450-shm", "syscon";
|