From fdf696b7d915646969075fefc8a28e7e8a086257 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Wed, 12 Jun 2024 12:26:11 +0200 Subject: [PATCH] core: rename tee_mm_shm to core_virt_shm_pool 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 Reviewed-by: Jerome Forissier Reviewed-by: Etienne Carriere --- core/arch/arm/kernel/thread_spmc.c | 6 +++--- core/arch/arm/mm/mobj_ffa.c | 4 ++-- core/include/mm/core_mmu.h | 4 ++-- core/mm/core_mmu.c | 4 ++-- core/mm/mobj_dyn_shm.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/arch/arm/kernel/thread_spmc.c b/core/arch/arm/kernel/thread_spmc.c index cb4382ce21d..74bc1e0f24c 100644 --- a/core/arch/arm/kernel/thread_spmc.c +++ b/core/arch/arm/kernel/thread_spmc.c @@ -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; @@ -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); @@ -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; diff --git a/core/arch/arm/mm/mobj_ffa.c b/core/arch/arm/mm/mobj_ffa.c index 2af1ec4d502..4916b5a068d 100644 --- a/core/arch/arm/mm/mobj_ffa.c +++ b/core/arch/arm/mm/mobj_ffa.c @@ -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; @@ -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"); diff --git a/core/include/mm/core_mmu.h b/core/include/mm/core_mmu.h index 0d2cf752b12..52ab80cbc92 100644 --- a/core/include/mm/core_mmu.h +++ b/core/include/mm/core_mmu.h @@ -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 */ diff --git a/core/mm/core_mmu.c b/core/mm/core_mmu.c index 85a4d7e0764..4afb67caf74 100644 --- a/core/mm/core_mmu.c +++ b/core/mm/core_mmu.c @@ -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; diff --git a/core/mm/mobj_dyn_shm.c b/core/mm/mobj_dyn_shm.c index 6a6aa0d8deb..ffd29587dcd 100644 --- a/core/mm/mobj_dyn_shm.c +++ b/core/mm/mobj_dyn_shm.c @@ -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; @@ -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");