summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-09-03 18:34:04 +0200
committerJoerg Roedel <jroedel@suse.de>2014-09-25 15:44:49 +0200
commit1aed074869a9cbe0a846ea7b254d8fd9a4a4d31f (patch)
tree54b73121409c21112fee7e61dc749d076157cddb /include
parent0f33be009b89d2268e94194dc4fd01a7851b6d51 (diff)
downloadlinux-1aed074869a9cbe0a846ea7b254d8fd9a4a4d31f.tar.gz
linux-1aed074869a9cbe0a846ea7b254d8fd9a4a4d31f.tar.bz2
linux-1aed074869a9cbe0a846ea7b254d8fd9a4a4d31f.zip
iommu: Convert iommu-caps from define to enum
Allow compile-time type-checking. Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iommu.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 20f9a527922a..98fc126655ae 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -57,8 +57,11 @@ struct iommu_domain {
struct iommu_domain_geometry geometry;
};
-#define IOMMU_CAP_CACHE_COHERENCY 0x1
-#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
+enum iommu_cap {
+ IOMMU_CAP_CACHE_COHERENCY, /* IOMMU can enforce cache coherent DMA
+ transactions */
+ IOMMU_CAP_INTR_REMAP, /* IOMMU supports interrupt isolation */
+};
/*
* Following constraints are specifc to FSL_PAMUV1:
@@ -155,7 +158,7 @@ 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, dma_addr_t iova);
extern int iommu_domain_has_cap(struct iommu_domain *domain,
- unsigned long cap);
+ enum iommu_cap cap);
extern void iommu_set_fault_handler(struct iommu_domain *domain,
iommu_fault_handler_t handler, void *token);
@@ -305,7 +308,7 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad
}
static inline int iommu_domain_has_cap(struct iommu_domain *domain,
- unsigned long cap)
+ enum iommu_cap cap)
{
return 0;
}