Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358829
b: refs/heads/master
c: d7787d5
h: refs/heads/master
i:
  358827: 78c42d5
v: v3
  • Loading branch information
Joerg Roedel committed Feb 6, 2013
1 parent 97ebf96 commit 0f1a6fd
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2e121601619631517409cba34e50db3cbff5852
refs/heads/master: d7787d579cbef9f8079104759a2259fc916c688c
20 changes: 20 additions & 0 deletions trunk/drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,26 @@ size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
}
EXPORT_SYMBOL_GPL(iommu_unmap);


int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
phys_addr_t paddr, u64 size)
{
if (unlikely(domain->ops->domain_window_enable == NULL))
return -ENODEV;

return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size);
}
EXPORT_SYMBOL_GPL(iommu_domain_window_enable);

void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr)
{
if (unlikely(domain->ops->domain_window_disable == NULL))
return;

return domain->ops->domain_window_disable(domain, wnd_nr);
}
EXPORT_SYMBOL_GPL(iommu_domain_window_disable);

static int __init iommu_init(void)
{
iommu_group_kset = kset_create_and_add("iommu_groups",
Expand Down
22 changes: 22 additions & 0 deletions trunk/include/linux/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ struct iommu_ops {
enum iommu_attr attr, void *data);
int (*domain_set_attr)(struct iommu_domain *domain,
enum iommu_attr attr, void *data);

/* Window handling functions */
int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
phys_addr_t paddr, u64 size);
void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);

unsigned long pgsize_bitmap;
};

Expand Down Expand Up @@ -158,6 +164,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
void *data);

/* Window handling function prototypes */
extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
phys_addr_t offset, u64 size);
extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr);
/**
* report_iommu_fault() - report about an IOMMU fault to the IOMMU framework
* @domain: the iommu domain where the fault has happened
Expand Down Expand Up @@ -240,6 +250,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
return -ENODEV;
}

static inline int iommu_domain_window_enable(struct iommu_domain *domain,
u32 wnd_nr, phys_addr_t paddr,
u64 size)
{
return -ENODEV;
}

static inline void iommu_domain_window_disable(struct iommu_domain *domain,
u32 wnd_nr)
{
}

static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
unsigned long iova)
{
Expand Down

0 comments on commit 0f1a6fd

Please sign in to comment.