summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/iommu.c7
-rw-r--r--include/linux/iommu.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 2198b2dbbcd3..155563579f19 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -286,6 +286,13 @@ int iommu_map(struct iommu_domain *domain, unsigned long iova,
}
EXPORT_SYMBOL_GPL(iommu_map);
+int iommu_map_pages(struct iommu_domain *domain, unsigned long iova,
+ struct page **pages, size_t count, int prot)
+{
+ return domain->ops->map_pages(domain, iova, pages, count, prot);
+}
+EXPORT_SYMBOL_GPL(iommu_map_pages);
+
size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
{
size_t unmapped_page, unmapped = 0;
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d937580417ba..79a21e2f03b6 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -68,6 +68,8 @@ struct iommu_ops {
void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
int (*map)(struct iommu_domain *domain, unsigned long iova,
phys_addr_t paddr, size_t size, int prot);
+ int (*map_pages)(struct iommu_domain *domain, unsigned long iova,
+ struct page **pages, size_t count, int prot);
size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
size_t size);
phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
@@ -88,6 +90,8 @@ extern void iommu_detach_device(struct iommu_domain *domain,
struct device *dev);
extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
phys_addr_t paddr, size_t size, int prot);
+extern int iommu_map_pages(struct iommu_domain *domain, unsigned long iova,
+ struct page **pages, size_t count, int prot);
extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
size_t size);
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,