Files
linux-apfs/include/linux/dma_remapping.h
T

53 lines
1.3 KiB
C
Raw Normal View History

#ifndef _DMA_REMAPPING_H
#define _DMA_REMAPPING_H
/*
2008-10-16 18:02:32 -07:00
* VT-d hardware uses 4KiB page size regardless of host page size.
*/
2008-10-16 18:02:32 -07: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)
#define VTD_STRIDE_SHIFT (9)
#define VTD_STRIDE_MASK (((u64)-1) << VTD_STRIDE_SHIFT)
#define DMA_PTE_READ (1)
#define DMA_PTE_WRITE (2)
#define DMA_PTE_LARGE_PAGE (1 << 7)
#define DMA_PTE_SNP (1 << 11)
2009-04-24 17:30:20 -07:00
#define CONTEXT_TT_MULTI_LEVEL 0
2009-05-18 13:51:37 +08:00
#define CONTEXT_TT_DEV_IOTLB 1
2009-04-24 17:30:20 -07:00
#define CONTEXT_TT_PASS_THROUGH 2
struct intel_iommu;
struct dmar_domain;
struct root_entry;
#ifdef CONFIG_INTEL_IOMMU
extern void free_dmar_iommu(struct intel_iommu *iommu);
2008-12-08 15:34:06 +08:00
extern int iommu_calculate_agaw(struct intel_iommu *iommu);
2009-04-24 17:30:20 -07:00
extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
extern int dmar_disabled;
extern int intel_iommu_enabled;
#else
static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
{
return 0;
}
2009-04-24 17:30:20 -07:00
static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
{
return 0;
}
static inline void free_dmar_iommu(struct intel_iommu *iommu)
{
}
#define dmar_disabled (1)
#define intel_iommu_enabled (0)
#endif
#endif