irq_remapping/amd: Enhance AMD IR driver to support hierarchical irqdomains
[deliverable/linux.git] / drivers / iommu / amd_iommu_types.h
index c4fffb710c5873f85105f60419aa6dc96c6e1a70..6533e874c9d77972f0523cfca326830d02e70dd7 100644 (file)
 #define PTE_PAGE_SIZE(pte) \
        (1ULL << (1 + ffz(((pte) | 0xfffULL))))
 
+/*
+ * Takes a page-table level and returns the default page-size for this level
+ */
+#define PTE_LEVEL_PAGE_SIZE(level)                     \
+       (1ULL << (12 + (9 * (level))))
+
 #define IOMMU_PTE_P  (1ULL << 0)
 #define IOMMU_PTE_TV (1ULL << 1)
 #define IOMMU_PTE_U  (1ULL << 59)
@@ -392,6 +398,7 @@ struct amd_iommu_fault {
 
 
 struct iommu_domain;
+struct irq_domain;
 
 /*
  * This structure contains generic data for  IOMMU protection domains
@@ -400,6 +407,8 @@ struct iommu_domain;
 struct protection_domain {
        struct list_head list;  /* for list of all protection domains */
        struct list_head dev_list; /* List of all devices in this domain */
+       struct iommu_domain domain; /* generic domain handle used by
+                                      iommu core code */
        spinlock_t lock;        /* mostly used to lock the page table*/
        struct mutex api_lock;  /* protect page tables in the iommu-api path */
        u16 id;                 /* the domain id written to the device table */
@@ -411,10 +420,7 @@ struct protection_domain {
        bool updated;           /* complete domain flush required */
        unsigned dev_cnt;       /* devices assigned to this domain */
        unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
-       void *priv;             /* private data */
-       struct iommu_domain *iommu_domain; /* Pointer to generic
-                                             domain structure */
-
+       void *priv;             /* private data */
 };
 
 /*
@@ -574,6 +580,10 @@ struct amd_iommu {
        /* The maximum PC banks and counters/bank (PCSup=1) */
        u8 max_banks;
        u8 max_counters;
+#ifdef CONFIG_IRQ_REMAP
+       struct irq_domain *ir_domain;
+       struct irq_domain *msi_domain;
+#endif
 };
 
 struct devid_map {
This page took 0.026131 seconds and 5 git commands to generate.