diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2019-04-18 08:56:31 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-05-02 13:58:09 +0200 |
commit | 37a6b717787bf3927f7af379ae66b1b6d0fe2a51 (patch) | |
tree | c7a9472aa82d7363ab4e6e36ce0680cec59ca80e /core/arch/arm/include | |
parent | fda78375e37ff7341cd205bdc26c9ed9b991b927 (diff) |
core: introduce CFG_CORE_DYN_SHM
Introduces CFG_CORE_DYN_SHM which if set to y enables dynamic shared
memory, else disables support for dynamic shared memory. In contrast
with CFG_DYN_SHM_CAP it actually removes the support instead of just
omit reporting it.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/arch/arm/include')
-rw-r--r-- | core/arch/arm/include/mm/core_mmu.h | 2 | ||||
-rw-r--r-- | core/arch/arm/include/mm/mobj.h | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/arch/arm/include/mm/core_mmu.h b/core/arch/arm/include/mm/core_mmu.h index 23819a97..09f03d10 100644 --- a/core/arch/arm/include/mm/core_mmu.h +++ b/core/arch/arm/include/mm/core_mmu.h @@ -593,6 +593,7 @@ bool cpu_mmu_enabled(void); /* Do section mapping, not support on LPAE */ void map_memarea_sections(const struct tee_mmap_region *mm, uint32_t *ttb); +#ifdef CFG_CORE_DYN_SHM /* * Check if platform defines nsec DDR range(s). * Static SHM (MEM_AREA_NSEC_SHM) is not covered by this API as it is @@ -602,6 +603,7 @@ bool core_mmu_nsec_ddr_is_defined(void); void core_mmu_set_discovered_nsec_ddr(struct core_mmu_phys_mem *start, size_t nelems); +#endif /* Initialize MMU partition */ void core_init_mmu_prtn(struct mmu_partition *prtn, struct tee_mmap_region *mm); diff --git a/core/arch/arm/include/mm/mobj.h b/core/arch/arm/include/mm/mobj.h index 2429d677..fbc8cbf9 100644 --- a/core/arch/arm/include/mm/mobj.h +++ b/core/arch/arm/include/mm/mobj.h @@ -120,6 +120,7 @@ struct mobj *mobj_mm_alloc(struct mobj *mobj_parent, size_t size, struct mobj *mobj_phys_alloc(paddr_t pa, size_t size, uint32_t cattr, enum buf_is_attr battr); +#ifdef CFG_CORE_DYN_SHM /* reg_shm represents TEE shared memory */ struct mobj *mobj_reg_shm_alloc(paddr_t *pages, size_t num_pages, paddr_t page_offset, uint64_t cookie); @@ -188,6 +189,17 @@ void mobj_reg_shm_unguard(struct mobj *mobj); */ struct mobj *mobj_mapped_shm_alloc(paddr_t *pages, size_t num_pages, paddr_t page_offset, uint64_t cookie); +#else +static inline TEE_Result mobj_reg_shm_inc_map(struct mobj *mobj __unused) +{ + return TEE_ERROR_NOT_SUPPORTED; +} + +static inline TEE_Result mobj_reg_shm_dec_map(struct mobj *mobj __unused) +{ + return TEE_ERROR_NOT_SUPPORTED; +} +#endif /*CFG_CORE_DYN_SHM*/ struct mobj *mobj_shm_alloc(paddr_t pa, size_t size, uint64_t cookie); |