aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intel-iommu.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/intel-iommu.h')
-rw-r--r--drivers/pci/intel-iommu.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h
index 459ad1f9dc54..0e4862675ad2 100644
--- a/drivers/pci/intel-iommu.h
+++ b/drivers/pci/intel-iommu.h
@@ -23,10 +23,24 @@
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/msi.h> 25#include <linux/msi.h>
26#include <linux/sysdev.h>
26#include "iova.h" 27#include "iova.h"
27#include <linux/io.h> 28#include <linux/io.h>
28 29
29/* 30/*
31 * We need a fixed PAGE_SIZE of 4K irrespective of
32 * arch PAGE_SIZE for IOMMU page tables.
33 */
34#define PAGE_SHIFT_4K (12)
35#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K)
36#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K)
37#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
38
39#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K)
40#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK)
41#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK)
42
43/*
30 * Intel IOMMU register specification per version 1.0 public spec. 44 * Intel IOMMU register specification per version 1.0 public spec.
31 */ 45 */
32 46