Home
last modified time | relevance | path

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

12345678910>>...14

/kernel/linux/linux-5.10/drivers/tee/
Dtee_shm.c16 static void release_registered_pages(struct tee_shm *shm) in release_registered_pages() argument
18 if (shm->pages) { in release_registered_pages()
19 if (shm->flags & TEE_SHM_USER_MAPPED) { in release_registered_pages()
20 unpin_user_pages(shm->pages, shm->num_pages); in release_registered_pages()
24 for (n = 0; n < shm->num_pages; n++) in release_registered_pages()
25 put_page(shm->pages[n]); in release_registered_pages()
28 kfree(shm->pages); in release_registered_pages()
32 static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm) in tee_shm_release() argument
34 if (shm->flags & TEE_SHM_POOL) { in tee_shm_release()
37 if (shm->flags & TEE_SHM_DMA_BUF) in tee_shm_release()
[all …]
/kernel/linux/linux-6.6/drivers/tee/
Dtee_shm.c44 static void release_registered_pages(struct tee_shm *shm) in release_registered_pages() argument
46 if (shm->pages) { in release_registered_pages()
47 if (shm->flags & TEE_SHM_USER_MAPPED) in release_registered_pages()
48 unpin_user_pages(shm->pages, shm->num_pages); in release_registered_pages()
50 shm_put_kernel_pages(shm->pages, shm->num_pages); in release_registered_pages()
52 kfree(shm->pages); in release_registered_pages()
56 static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm) in tee_shm_release() argument
58 if (shm->flags & TEE_SHM_POOL) { in tee_shm_release()
59 teedev->pool->ops->free(teedev->pool, shm); in tee_shm_release()
60 } else if (shm->flags & TEE_SHM_DYNAMIC) { in tee_shm_release()
[all …]
Dtee_shm_pool.c12 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()
/kernel/linux/linux-5.10/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()
47 shm->flags |= TEE_SHM_REGISTER; in pool_op_alloc()
48 rc = optee_shm_register(shm->ctx, shm, pages, nr_pages, in pool_op_alloc()
49 (unsigned long)shm->kaddr); in pool_op_alloc()
63 struct tee_shm *shm) in pool_op_free() argument
65 if (!(shm->flags & TEE_SHM_PRIV)) in pool_op_free()
[all …]
Drpc.c104 msg.buf = params[2].u.memref.shm->kaddr; in handle_rpc_func_cmd_i2c_transfer()
268 struct tee_shm *shm; in cmd_alloc_suppl() local
281 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in cmd_alloc_suppl()
283 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(optee->ctx, sz, in handle_rpc_func_cmd_shm_alloc()
325 if (IS_ERR(shm)) { in handle_rpc_func_cmd_shm_alloc()
330 if (tee_shm_get_pa(shm, 0, &pa)) { in handle_rpc_func_cmd_shm_alloc()
335 sz = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
[all …]
Dcall.c180 struct tee_shm *shm; in get_msg_arg() local
183 shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params), in get_msg_arg()
185 if (IS_ERR(shm)) in get_msg_arg()
186 return shm; in get_msg_arg()
188 ma = tee_shm_get_va(shm, 0); in get_msg_arg()
194 rc = tee_shm_get_pa(shm, 0, msg_parg); in get_msg_arg()
203 tee_shm_free(shm); in get_msg_arg()
207 return shm; in get_msg_arg()
216 struct tee_shm *shm; in optee_open_session() local
223 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 …]
/kernel/liteos_a/testsuites/unittest/basic/mem/shm/
Dconfig.gni31 mem_shm_include_dirs = [ "$TEST_UNITTEST_DIR/basic/mem/shm" ]
33 mem_shm_sources_entry = [ "$TEST_UNITTEST_DIR/basic/mem/shm/mem_shm_test.cpp" ]
36 [ "$TEST_UNITTEST_DIR/basic/mem/shm/smoke/shm_test_011.cpp" ]
39 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_001.cpp",
40 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_002.cpp",
41 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_003.cpp",
42 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_004.cpp",
43 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_005.cpp",
44 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_006.cpp",
45 "$TEST_UNITTEST_DIR/basic/mem/shm/full/shm_test_007.cpp",
[all …]
/kernel/linux/linux-6.6/drivers/tee/optee/
Dffa_abi.c41 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()
[all …]
Dsmc_abi.c49 * A typical OP-TEE private shm allocation is 224 bytes (argument struct
85 struct tee_shm *shm; in from_msg_param_tmp_mem() local
92 shm = (struct tee_shm *)(unsigned long)mp->u.tmem.shm_ref; in from_msg_param_tmp_mem()
93 if (!shm) { in from_msg_param_tmp_mem()
95 p->u.memref.shm = NULL; in from_msg_param_tmp_mem()
99 rc = tee_shm_get_pa(shm, 0, &pa); in from_msg_param_tmp_mem()
104 p->u.memref.shm = shm; in from_msg_param_tmp_mem()
112 struct tee_shm *shm; in from_msg_param_reg_mem() local
117 shm = (struct tee_shm *)(unsigned long)mp->u.rmem.shm_ref; in from_msg_param_reg_mem()
119 if (shm) { in from_msg_param_reg_mem()
[all …]
Dcore.c21 int optee_pool_op_alloc_helper(struct tee_shm_pool *pool, struct tee_shm *shm, in optee_pool_op_alloc_helper() argument
24 struct tee_shm *shm, in optee_pool_op_alloc_helper()
41 shm->kaddr = page_address(page); in optee_pool_op_alloc_helper()
42 shm->paddr = page_to_phys(page); in optee_pool_op_alloc_helper()
43 shm->size = PAGE_SIZE << order; in optee_pool_op_alloc_helper()
58 rc = shm_register(shm->ctx, shm, pages, nr_pages, in optee_pool_op_alloc_helper()
59 (unsigned long)shm->kaddr); in optee_pool_op_alloc_helper()
68 free_pages((unsigned long)shm->kaddr, order); in optee_pool_op_alloc_helper()
72 void optee_pool_op_free_helper(struct tee_shm_pool *pool, struct tee_shm *shm, in optee_pool_op_free_helper() argument
74 struct tee_shm *shm)) in optee_pool_op_free_helper()
[all …]
/kernel/linux/linux-6.6/drivers/tee/amdtee/
Dshm_pool.c11 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()
/kernel/liteos_a/testsuites/unittest/basic/mem/shm/full/
Dshm_test_003.cpp37 void *shm = NULL; in Testcase() local
44 shm = shmat(shmid, NULL, 0); in Testcase()
45 ICUNIT_ASSERT_NOT_EQUAL(shm, INVALID_PTR, shm); in Testcase()
47 (void)memset_s(shm, PAGE_SIZE, 0, PAGE_SIZE); in Testcase()
49 ret = shmdt(shm); in Testcase()
58 shm = shmat(shmid, vaddrPageAlign, 0); in Testcase()
59 ICUNIT_ASSERT_EQUAL(shm, vaddrPageAlign, shm); in Testcase()
61 (void)memset_s(shm, PAGE_SIZE, 0, PAGE_SIZE); in Testcase()
63 ret = shmdt(shm); in Testcase()
67 shm = shmat(shmid, vaddr, SHM_REMAP); in Testcase()
[all …]
Dshm_test_001.cpp44 void *shm = nullptr; in ShmReadFunc() local
52 shm = shmat(shmid, 0, 0); in ShmReadFunc()
53 ICUNIT_ASSERT_NOT_EQUAL_NULL_VOID(shm, INVALID_PTR, shm); in ShmReadFunc()
55 printf("Memory attached at %p\n", shm); in ShmReadFunc()
57 shared = (struct shared_use_st *)shm; in ShmReadFunc()
72 ret = shmdt(shm); in ShmReadFunc()
84 void *shm = nullptr; in ShmWriteFunc() local
94 shm = shmat(shmid, nullptr, 0); in ShmWriteFunc()
95 ICUNIT_ASSERT_NOT_EQUAL_NULL_VOID(shm, INVALID_PTR, shm); in ShmWriteFunc()
97 printf("Memory attached at %p\n", shm); in ShmWriteFunc()
[all …]
/kernel/liteos_a/testsuites/unittest/container/smoke/
DIt_ipc_container_004.cpp42 const char testBuf[] = "child test shm"; in childFunc1()
51 void *shm = shmat(shmid, 0, 0); in childFunc1() local
52 if (shm == reinterpret_cast<void *>(-1)) { in childFunc1()
56 shared = (struct shared_use_st *)shm; in childFunc1()
59 shmdt(shm); in childFunc1()
63 ret = shmdt(shm); in childFunc1()
73 const char testBuf[] = "parent test shm"; in childFunc()
74 const char testBuf1[] = "child test shm"; in childFunc()
89 void *shm = shmat(shmid, 0, 0); in childFunc() local
90 if (shm == reinterpret_cast<void *>(-1)) { in childFunc()
[all …]
DIt_ipc_container_005.cpp33 static const char testBuf[] = "test shm";
62 void *shm = shmat(shmid, 0, 0); in childFunc() local
63 if (shm == reinterpret_cast<void *>(-1)) { in childFunc()
68 shared = (struct shared_use_st *)shm; in childFunc()
71 shmdt(shm); in childFunc()
76 ret = shmdt(shm); in childFunc()
110 void *shm = shmat(shmid, 0, 0); in testChild() local
111 if (shm == reinterpret_cast<void *>(-1)) { in testChild()
116 shared = (struct shared_use_st *)shm; in testChild()
119 shmdt(shm); in testChild()
[all …]
DIt_ipc_container_006.cpp33 static const char testBuf[] = "test shm";
51 void *shm = shmat(shmid, 0, 0); in childFunc1() local
52 if (shm == reinterpret_cast<void *>(-1)) { in childFunc1()
56 shared = (struct shared_use_st *)shm; in childFunc1()
60 shmdt(shm); in childFunc1()
65 ret = shmdt(shm); in childFunc1()
122 void *shm = shmat(shmid, 0, 0); in childFunc() local
123 if (shm == reinterpret_cast<void *>(-1)) { in childFunc()
128 shared = (struct shared_use_st *)shm; in childFunc()
138 shmdt(shm); in childFunc()
[all …]
/kernel/linux/linux-5.10/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()
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-6.6/include/linux/
Dtee_drv.h63 struct tee_shm *shm; member
111 int (*shm_register)(struct tee_context *ctx, struct tee_shm *shm,
114 int (*shm_unregister)(struct tee_context *ctx, struct tee_shm *shm);
204 * subsystem and from drivers that implements their own shm pool manager.
237 int (*alloc)(struct tee_shm_pool *pool, struct tee_shm *shm,
239 void (*free)(struct tee_shm_pool *pool, struct tee_shm *shm);
244 * tee_shm_pool_alloc_res_mem() - Create a shm manager for reserved memory
281 * @shm: Shared memory handle
284 static inline bool tee_shm_is_dynamic(struct tee_shm *shm) in tee_shm_is_dynamic() argument
286 return shm && (shm->flags & TEE_SHM_DYNAMIC); in tee_shm_is_dynamic()
[all …]
/kernel/linux/linux-6.6/drivers/media/platform/samsung/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 …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-6.6/drivers/rtc/
Drtc-optee.c44 * @shm: Memory pool shared with RTC device.
51 struct tee_shm *shm; member
69 param[0].u.memref.shm = priv->shm; in optee_rtc_readtime()
76 optee_tm = tee_shm_get_va(priv->shm, 0); in optee_rtc_readtime()
117 param[0].u.memref.shm = priv->shm; in optee_rtc_settime()
120 rtc_data = tee_shm_get_va(priv->shm, 0); in optee_rtc_settime()
204 param[0].u.memref.shm = priv->shm; in optee_rtc_read_info()
211 info = tee_shm_get_va(priv->shm, 0); in optee_rtc_read_info()
247 struct tee_shm *shm; in optee_rtc_probe() local
277 shm = tee_shm_alloc_kernel_buf(priv->ctx, sizeof(struct optee_rtc_info)); in optee_rtc_probe()
[all …]
/kernel/linux/linux-6.6/drivers/nvmem/
Dstm32-bsec-optee-ta.c142 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 …]
/kernel/linux/linux-6.6/Documentation/devicetree/bindings/spi/
Dnuvoton,wpcm450-fiu.yaml35 nuvoton,shm:
37 description: a phandle to the SHM block (see ../arm/nuvoton,shm.yaml)
55 nuvoton,shm = <&shm>;
63 shm: syscon@c8001000 {
64 compatible = "nuvoton,wpcm450-shm", "syscon";

12345678910>>...14