2008-07-10 14:16:35 -04:00
|
|
|
#ifndef _DMA_REMAPPING_H
|
|
|
|
#define _DMA_REMAPPING_H
|
|
|
|
|
|
|
|
/*
|
2008-10-16 21:02:32 -04:00
|
|
|
* VT-d hardware uses 4KiB page size regardless of host page size.
|
2008-07-10 14:16:35 -04:00
|
|
|
*/
|
2008-10-16 21:02:32 -04:00
|
|
|
#define VTD_PAGE_SHIFT (12)
|
|
|
|
#define VTD_PAGE_SIZE (1UL << VTD_PAGE_SHIFT)
|
|
|
|
#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
|
|
|
|
#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
|
2008-07-10 14:16:35 -04:00
|
|
|
|
|
|
|
#define DMA_PTE_READ (1)
|
|
|
|
#define DMA_PTE_WRITE (2)
|
|
|
|
|
|
|
|
struct intel_iommu;
|
2008-11-20 10:49:47 -05:00
|
|
|
struct dmar_domain;
|
|
|
|
struct root_entry;
|
2008-07-10 14:16:35 -04:00
|
|
|
|
|
|
|
extern void free_dmar_iommu(struct intel_iommu *iommu);
|
2009-01-04 04:55:02 -05:00
|
|
|
|
|
|
|
#ifdef CONFIG_DMAR
|
2008-12-08 02:34:06 -05:00
|
|
|
extern int iommu_calculate_agaw(struct intel_iommu *iommu);
|
2009-01-04 04:55:02 -05:00
|
|
|
#else
|
|
|
|
static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
2008-07-10 14:16:35 -04:00
|
|
|
|
2008-07-10 14:16:43 -04:00
|
|
|
extern int dmar_disabled;
|
|
|
|
|
2008-07-10 14:16:35 -04:00
|
|
|
#endif
|