Lines Matching refs:cpu_addr
949 static void __iommu_dma_free(struct device *dev, size_t size, void *cpu_addr) in __iommu_dma_free() argument
957 dma_free_from_pool(dev, cpu_addr, alloc_size)) in __iommu_dma_free()
960 if (IS_ENABLED(CONFIG_DMA_REMAP) && is_vmalloc_addr(cpu_addr)) { in __iommu_dma_free()
965 pages = dma_common_find_pages(cpu_addr); in __iommu_dma_free()
967 page = vmalloc_to_page(cpu_addr); in __iommu_dma_free()
968 dma_common_free_remap(cpu_addr, alloc_size); in __iommu_dma_free()
971 page = virt_to_page(cpu_addr); in __iommu_dma_free()
980 static void iommu_dma_free(struct device *dev, size_t size, void *cpu_addr, in iommu_dma_free() argument
984 __iommu_dma_free(dev, size, cpu_addr); in iommu_dma_free()
994 void *cpu_addr; in iommu_dma_alloc_pages() local
1005 cpu_addr = dma_common_contiguous_remap(page, alloc_size, in iommu_dma_alloc_pages()
1007 if (!cpu_addr) in iommu_dma_alloc_pages()
1013 cpu_addr = page_address(page); in iommu_dma_alloc_pages()
1017 memset(cpu_addr, 0, alloc_size); in iommu_dma_alloc_pages()
1018 return cpu_addr; in iommu_dma_alloc_pages()
1030 void *cpu_addr; in iommu_dma_alloc() local
1042 page = dma_alloc_from_pool(dev, PAGE_ALIGN(size), &cpu_addr, in iommu_dma_alloc()
1045 cpu_addr = iommu_dma_alloc_pages(dev, size, &page, gfp, attrs); in iommu_dma_alloc()
1046 if (!cpu_addr) in iommu_dma_alloc()
1052 __iommu_dma_free(dev, size, cpu_addr); in iommu_dma_alloc()
1056 return cpu_addr; in iommu_dma_alloc()
1077 void *cpu_addr, dma_addr_t handle, enum dma_data_direction dir) in iommu_dma_free_noncoherent() argument
1080 __iommu_dma_free(dev, size, cpu_addr); in iommu_dma_free_noncoherent()
1088 void *cpu_addr, dma_addr_t dma_addr, size_t size, in iommu_dma_mmap() argument
1097 if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret)) in iommu_dma_mmap()
1103 if (IS_ENABLED(CONFIG_DMA_REMAP) && is_vmalloc_addr(cpu_addr)) { in iommu_dma_mmap()
1104 struct page **pages = dma_common_find_pages(cpu_addr); in iommu_dma_mmap()
1108 pfn = vmalloc_to_pfn(cpu_addr); in iommu_dma_mmap()
1110 pfn = page_to_pfn(virt_to_page(cpu_addr)); in iommu_dma_mmap()
1119 void *cpu_addr, dma_addr_t dma_addr, size_t size, in iommu_dma_get_sgtable() argument
1125 if (IS_ENABLED(CONFIG_DMA_REMAP) && is_vmalloc_addr(cpu_addr)) { in iommu_dma_get_sgtable()
1126 struct page **pages = dma_common_find_pages(cpu_addr); in iommu_dma_get_sgtable()
1134 page = vmalloc_to_page(cpu_addr); in iommu_dma_get_sgtable()
1136 page = virt_to_page(cpu_addr); in iommu_dma_get_sgtable()