mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
iommu: iommu_alloc_resv_region
Introduce a new helper serving the purpose to allocate a reserved region. This will be used in iommu driver implementing reserved region callbacks. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com> Tested-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com> Tested-by: Bharat Bhushan <bharat.bhushan@nxp.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
d30ddcaa7b
commit
2b20cbba33
2 changed files with 20 additions and 0 deletions
|
@ -1575,6 +1575,24 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list)
|
||||||
ops->put_resv_regions(dev, list);
|
ops->put_resv_regions(dev, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
|
||||||
|
size_t length,
|
||||||
|
int prot, int type)
|
||||||
|
{
|
||||||
|
struct iommu_resv_region *region;
|
||||||
|
|
||||||
|
region = kzalloc(sizeof(*region), GFP_KERNEL);
|
||||||
|
if (!region)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
INIT_LIST_HEAD(®ion->list);
|
||||||
|
region->start = start;
|
||||||
|
region->length = length;
|
||||||
|
region->prot = prot;
|
||||||
|
region->type = type;
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
/* Request that a device is direct mapped by the IOMMU */
|
/* Request that a device is direct mapped by the IOMMU */
|
||||||
int iommu_request_dm_for_dev(struct device *dev)
|
int iommu_request_dm_for_dev(struct device *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -244,6 +244,8 @@ extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
|
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 *
|
||||||
|
iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot, int type);
|
||||||
|
|
||||||
extern int iommu_attach_group(struct iommu_domain *domain,
|
extern int iommu_attach_group(struct iommu_domain *domain,
|
||||||
struct iommu_group *group);
|
struct iommu_group *group);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue