dma-iommu.h 705 B

1234567891011121314151617181920212223242526272829303132333435
  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. struct dma_iommu_mapping {
  9. /* iommu specific data */
  10. struct iommu_domain *domain;
  11. void *bitmap;
  12. size_t bits;
  13. unsigned int order;
  14. dma_addr_t base;
  15. spinlock_t lock;
  16. struct kref kref;
  17. };
  18. struct dma_iommu_mapping *
  19. arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size,
  20. int order);
  21. void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
  22. int arm_iommu_attach_device(struct device *dev,
  23. struct dma_iommu_mapping *mapping);
  24. #endif /* __KERNEL__ */
  25. #endif