summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Doyu <hdoyu@nvidia.com>2013-04-03 15:50:44 +0300
committerHarshada Kale <hkale@nvidia.com>2013-06-10 03:51:05 -0700
commit2fa899cea85450ffda872115c5c931089bd1d14f (patch)
tree803052bc1bd78b5124c2ec637b9b8b1330f1dc05
parent0774cef9ef1f7aef2a97369a28687b1bedd6d50f (diff)
iommu/core: Add new API iommu_map_pages()
Add new API iommu_map_pages() to call iommu_ops->map_pages() internally. bug 1286500 Change-Id: I37605703def34bba774e480b29506c459d6391bd (cherry picked from commit 11ed57ffcbd908e12c1fd836211beed4fc577833) Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/234131 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
-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,