dma_remapping.h 738 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _DMA_REMAPPING_H
  2. #define _DMA_REMAPPING_H
  3. /*
  4. * VT-d hardware uses 4KiB page size regardless of host page size.
  5. */
  6. #define VTD_PAGE_SHIFT (12)
  7. #define VTD_PAGE_SIZE (1UL << VTD_PAGE_SHIFT)
  8. #define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
  9. #define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
  10. #define DMA_PTE_READ (1)
  11. #define DMA_PTE_WRITE (2)
  12. #define DMA_PTE_SNP (1 << 11)
  13. struct intel_iommu;
  14. struct dmar_domain;
  15. struct root_entry;
  16. extern void free_dmar_iommu(struct intel_iommu *iommu);
  17. #ifdef CONFIG_DMAR
  18. extern int iommu_calculate_agaw(struct intel_iommu *iommu);
  19. #else
  20. static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
  21. {
  22. return 0;
  23. }
  24. #endif
  25. extern int dmar_disabled;
  26. #endif