Lines Matching refs:pages
190 static void __iommu_dma_free_pages(struct page **pages, int count) in __iommu_dma_free_pages() argument
193 __free_page(pages[count]); in __iommu_dma_free_pages()
194 kvfree(pages); in __iommu_dma_free_pages()
199 struct page **pages; in __iommu_dma_alloc_pages() local
200 unsigned int i = 0, array_size = count * sizeof(*pages); in __iommu_dma_alloc_pages()
204 pages = kzalloc(array_size, GFP_KERNEL); in __iommu_dma_alloc_pages()
206 pages = vzalloc(array_size); in __iommu_dma_alloc_pages()
207 if (!pages) in __iommu_dma_alloc_pages()
239 __iommu_dma_free_pages(pages, i); in __iommu_dma_alloc_pages()
245 pages[i++] = page++; in __iommu_dma_alloc_pages()
247 return pages; in __iommu_dma_alloc_pages()
260 void iommu_dma_free(struct device *dev, struct page **pages, size_t size, in iommu_dma_free() argument
264 __iommu_dma_free_pages(pages, PAGE_ALIGN(size) >> PAGE_SHIFT); in iommu_dma_free()
292 struct page **pages; in iommu_dma_alloc() local
299 pages = __iommu_dma_alloc_pages(count, gfp); in iommu_dma_alloc()
300 if (!pages) in iommu_dma_alloc()
308 if (sg_alloc_table_from_pages(&sgt, pages, count, 0, size, GFP_KERNEL)) in iommu_dma_alloc()
330 return pages; in iommu_dma_alloc()
337 __iommu_dma_free_pages(pages, count); in iommu_dma_alloc()
351 int iommu_dma_mmap(struct page **pages, size_t size, struct vm_area_struct *vma) in iommu_dma_mmap() argument
358 ret = vm_insert_page(vma, uaddr, pages[i]); in iommu_dma_mmap()