Lines Matching full:area

58 static int qcom_tzmem_init_area(struct qcom_tzmem_area *area)  in qcom_tzmem_init_area()  argument
63 static void qcom_tzmem_cleanup_area(struct qcom_tzmem_area *area) in qcom_tzmem_cleanup_area() argument
110 static int qcom_tzmem_init_area(struct qcom_tzmem_area *area) in qcom_tzmem_init_area() argument
118 pfn_and_ns_perm = (u64)area->paddr | QCOM_SCM_PERM_RW; in qcom_tzmem_init_area()
119 ipfn_and_s_perm = (u64)area->paddr | QCOM_SCM_PERM_RW; in qcom_tzmem_init_area()
120 size_and_flags = area->size | (1 << QCOM_SHM_BRIDGE_NUM_VM_SHIFT); in qcom_tzmem_init_area()
132 area->priv = no_free_ptr(handle); in qcom_tzmem_init_area()
137 static void qcom_tzmem_cleanup_area(struct qcom_tzmem_area *area) in qcom_tzmem_cleanup_area() argument
139 u64 *handle = area->priv; in qcom_tzmem_cleanup_area()
155 struct qcom_tzmem_area *area __free(kfree) = kzalloc(sizeof(*area), in qcom_tzmem_pool_add_memory()
157 if (!area) in qcom_tzmem_pool_add_memory()
160 area->size = PAGE_ALIGN(size); in qcom_tzmem_pool_add_memory()
162 area->vaddr = dma_alloc_coherent(qcom_tzmem_dev, area->size, in qcom_tzmem_pool_add_memory()
163 &area->paddr, gfp); in qcom_tzmem_pool_add_memory()
164 if (!area->vaddr) in qcom_tzmem_pool_add_memory()
167 ret = qcom_tzmem_init_area(area); in qcom_tzmem_pool_add_memory()
169 dma_free_coherent(qcom_tzmem_dev, area->size, in qcom_tzmem_pool_add_memory()
170 area->vaddr, area->paddr); in qcom_tzmem_pool_add_memory()
174 ret = gen_pool_add_virt(pool->genpool, (unsigned long)area->vaddr, in qcom_tzmem_pool_add_memory()
175 (phys_addr_t)area->paddr, size, -1); in qcom_tzmem_pool_add_memory()
177 dma_free_coherent(qcom_tzmem_dev, area->size, in qcom_tzmem_pool_add_memory()
178 area->vaddr, area->paddr); in qcom_tzmem_pool_add_memory()
183 list_add_tail(&area->list, &pool->areas); in qcom_tzmem_pool_add_memory()
185 area = NULL; in qcom_tzmem_pool_add_memory()
260 struct qcom_tzmem_area *area, *next; in qcom_tzmem_pool_free() local
283 list_for_each_entry_safe(area, next, &pool->areas, list) { in qcom_tzmem_pool_free()
284 list_del(&area->list); in qcom_tzmem_pool_free()
285 qcom_tzmem_cleanup_area(area); in qcom_tzmem_pool_free()
286 dma_free_coherent(qcom_tzmem_dev, area->size, in qcom_tzmem_pool_free()
287 area->vaddr, area->paddr); in qcom_tzmem_pool_free()
288 kfree(area); in qcom_tzmem_pool_free()