Skip to content

Commit

Permalink
core: rename tee_mm_shm to core_virt_shm_pool
Browse files Browse the repository at this point in the history
Rename tee_mm_shm to core_virt_shm_pool to make it clear that it handles
virtual memory allocations for shared memory.

Signed-off-by: Jens Wiklander <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
  • Loading branch information
jenswi-linaro authored and jforissier committed Jun 14, 2024
1 parent 9b0ee59 commit fdf696b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions core/arch/arm/kernel/thread_spmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static int map_buf(paddr_t pa, unsigned int sz, void **va_ret)
if (!core_pbuf_is(CORE_MEM_NON_SEC, pa, sz))
return FFA_INVALID_PARAMETERS;

mm = tee_mm_alloc(&tee_mm_shm, sz);
mm = tee_mm_alloc(&core_virt_shm_pool, sz);
if (!mm)
return FFA_NO_MEMORY;

Expand All @@ -313,7 +313,7 @@ void spmc_handle_spm_id_get(struct thread_smc_args *args)

static void unmap_buf(void *va, size_t sz)
{
tee_mm_entry_t *mm = tee_mm_find(&tee_mm_shm, (vaddr_t)va);
tee_mm_entry_t *mm = tee_mm_find(&core_virt_shm_pool, (vaddr_t)va);

assert(mm);
core_mmu_unmap_pages(tee_mm_get_smem(mm), sz / SMALL_PAGE_SIZE);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ static int handle_mem_share_tmem(paddr_t pbuf, size_t blen, size_t flen,
if (len < flen || len - offs < flen)
return FFA_INVALID_PARAMETERS;

mm = tee_mm_alloc(&tee_mm_shm, len);
mm = tee_mm_alloc(&core_virt_shm_pool, len);
if (!mm)
return FFA_NO_MEMORY;

Expand Down
4 changes: 2 additions & 2 deletions core/arch/arm/mm/mobj_ffa.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ static TEE_Result ffa_inc_map(struct mobj *mobj)
*/
if (!mf->mm) {
sz = ROUNDUP(mobj->size + mf->page_offset, SMALL_PAGE_SIZE);
mf->mm = tee_mm_alloc(&tee_mm_shm, sz);
mf->mm = tee_mm_alloc(&core_virt_shm_pool, sz);
if (!mf->mm) {
res = TEE_ERROR_OUT_OF_MEMORY;
goto out;
Expand Down Expand Up @@ -742,7 +742,7 @@ static TEE_Result mapped_shm_init(void)
if (!pool_start || !pool_end)
panic("Can't find region for shmem pool");

if (!tee_mm_init(&tee_mm_shm, pool_start, pool_end - pool_start,
if (!tee_mm_init(&core_virt_shm_pool, pool_start, pool_end - pool_start,
SMALL_PAGE_SHIFT,
TEE_MM_POOL_NO_FLAGS))
panic("Could not create shmem pool");
Expand Down
4 changes: 2 additions & 2 deletions core/include/mm/core_mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ extern tee_mm_pool_t tee_mm_sec_ddr;
/* Virtual memory pool for core mappings */
extern tee_mm_pool_t core_virt_mem_pool;

/* Shared memory pool */
extern tee_mm_pool_t tee_mm_shm;
/* Virtual memory pool for shared memory mappings */
extern tee_mm_pool_t core_virt_shm_pool;

#ifdef CFG_CORE_RESERVED_SHM
/* Default NSec shared memory allocated from NSec world */
Expand Down
4 changes: 2 additions & 2 deletions core/mm/core_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ tee_mm_pool_t tee_mm_sec_ddr;
/* Virtual memory pool for core mappings */
tee_mm_pool_t core_virt_mem_pool;

/* Shared memory pool */
tee_mm_pool_t tee_mm_shm;
/* Virtual memory pool for shared memory mappings */
tee_mm_pool_t core_virt_shm_pool;

#ifdef CFG_CORE_PHYS_RELOCATABLE
unsigned long core_mmu_tee_load_pa __nex_bss;
Expand Down
4 changes: 2 additions & 2 deletions core/mm/mobj_dyn_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static TEE_Result mobj_reg_shm_inc_map(struct mobj *mobj)
*/
if (!r->mm) {
sz = ROUNDUP(mobj->size + r->page_offset, SMALL_PAGE_SIZE);
r->mm = tee_mm_alloc(&tee_mm_shm, sz);
r->mm = tee_mm_alloc(&core_virt_shm_pool, sz);
if (!r->mm) {
res = TEE_ERROR_OUT_OF_MEMORY;
goto out;
Expand Down Expand Up @@ -460,7 +460,7 @@ static TEE_Result mobj_mapped_shm_init(void)
if (!pool_start || !pool_end)
panic("Can't find region for shmem pool");

if (!tee_mm_init(&tee_mm_shm, pool_start, pool_end - pool_start,
if (!tee_mm_init(&core_virt_shm_pool, pool_start, pool_end - pool_start,
SMALL_PAGE_SHIFT, TEE_MM_POOL_NO_FLAGS))
panic("Could not create shmem pool");

Expand Down

0 comments on commit fdf696b

Please sign in to comment.