|
@@ -125,9 +125,16 @@ enum iommu_attr {
|
|
};
|
|
};
|
|
|
|
|
|
/* These are the possible reserved region types */
|
|
/* These are the possible reserved region types */
|
|
-#define IOMMU_RESV_DIRECT (1 << 0)
|
|
|
|
-#define IOMMU_RESV_RESERVED (1 << 1)
|
|
|
|
-#define IOMMU_RESV_MSI (1 << 2)
|
|
|
|
|
|
+enum iommu_resv_type {
|
|
|
|
+ /* Memory regions which must be mapped 1:1 at all times */
|
|
|
|
+ IOMMU_RESV_DIRECT,
|
|
|
|
+ /* Arbitrary "never map this or give it to a device" address ranges */
|
|
|
|
+ IOMMU_RESV_RESERVED,
|
|
|
|
+ /* Hardware MSI region (untranslated) */
|
|
|
|
+ IOMMU_RESV_MSI,
|
|
|
|
+ /* Software-managed MSI translation window */
|
|
|
|
+ IOMMU_RESV_SW_MSI,
|
|
|
|
+};
|
|
|
|
|
|
/**
|
|
/**
|
|
* struct iommu_resv_region - descriptor for a reserved memory region
|
|
* struct iommu_resv_region - descriptor for a reserved memory region
|
|
@@ -142,7 +149,7 @@ struct iommu_resv_region {
|
|
phys_addr_t start;
|
|
phys_addr_t start;
|
|
size_t length;
|
|
size_t length;
|
|
int prot;
|
|
int prot;
|
|
- int type;
|
|
|
|
|
|
+ enum iommu_resv_type type;
|
|
};
|
|
};
|
|
|
|
|
|
#ifdef CONFIG_IOMMU_API
|
|
#ifdef CONFIG_IOMMU_API
|
|
@@ -288,7 +295,8 @@ extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
|
|
extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
|
|
extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
|
|
extern int iommu_request_dm_for_dev(struct device *dev);
|
|
extern int iommu_request_dm_for_dev(struct device *dev);
|
|
extern struct iommu_resv_region *
|
|
extern struct iommu_resv_region *
|
|
-iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot, int type);
|
|
|
|
|
|
+iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
|
|
|
|
+ enum iommu_resv_type type);
|
|
extern int iommu_get_group_resv_regions(struct iommu_group *group,
|
|
extern int iommu_get_group_resv_regions(struct iommu_group *group,
|
|
struct list_head *head);
|
|
struct list_head *head);
|
|
|
|
|