dma-iommu.h 779 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef ASMARM_DMA_IOMMU_H
  2. #define ASMARM_DMA_IOMMU_H
  3. #ifdef __KERNEL__
  4. #include <linux/mm_types.h>
  5. #include <linux/scatterlist.h>
  6. #include <linux/dma-debug.h>
  7. #include <linux/kmemcheck.h>
  8. #include <linux/kref.h>
  9. struct dma_iommu_mapping {
  10. /* iommu specific data */
  11. struct iommu_domain *domain;
  12. void *bitmap;
  13. size_t bits;
  14. unsigned int order;
  15. dma_addr_t base;
  16. spinlock_t lock;
  17. struct kref kref;
  18. };
  19. struct dma_iommu_mapping *
  20. arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size,
  21. int order);
  22. void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
  23. int arm_iommu_attach_device(struct device *dev,
  24. struct dma_iommu_mapping *mapping);
  25. void arm_iommu_detach_device(struct device *dev);
  26. #endif /* __KERNEL__ */
  27. #endif