aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2013-01-29 08:26:20 -0500
committerJoerg Roedel <joro@8bytes.org>2013-02-06 04:47:22 -0500
commitd7787d579cbef9f8079104759a2259fc916c688c (patch)
tree28e2066c0c89b1d25e8caf2c60956ecc45e3f781 /drivers/iommu/iommu.c
parentd2e121601619631517409cba34e50db3cbff5852 (diff)
iommu: Add domain window handling functions
Add the iommu_domain_window_enable() and iommu_domain_window_disable() functions to the IOMMU-API. These functions will be used to setup domains that are based on subwindows and not on paging. Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 0e0e5f2e0ccc..b3aced7356cc 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -852,6 +852,26 @@ size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
852} 852}
853EXPORT_SYMBOL_GPL(iommu_unmap); 853EXPORT_SYMBOL_GPL(iommu_unmap);
854 854
855
856int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
857 phys_addr_t paddr, u64 size)
858{
859 if (unlikely(domain->ops->domain_window_enable == NULL))
860 return -ENODEV;
861
862 return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size);
863}
864EXPORT_SYMBOL_GPL(iommu_domain_window_enable);
865
866void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr)
867{
868 if (unlikely(domain->ops->domain_window_disable == NULL))
869 return;
870
871 return domain->ops->domain_window_disable(domain, wnd_nr);
872}
873EXPORT_SYMBOL_GPL(iommu_domain_window_disable);
874
855static int __init iommu_init(void) 875static int __init iommu_init(void)
856{ 876{
857 iommu_group_kset = kset_create_and_add("iommu_groups", 877 iommu_group_kset = kset_create_and_add("iommu_groups",