}
int __must_check iommu_free_pgtables(struct domain *d);
-struct page_info *__must_check iommu_alloc_pgtable(struct domain *d);
+struct domain_iommu;
+struct page_info *__must_check iommu_alloc_pgtable(struct domain_iommu *hd);
#endif /* !__ARCH_X86_IOMMU_H__ */
/*
unsigned long next_table_mfn;
unsigned int level;
struct page_info *table;
- const struct domain_iommu *hd = dom_iommu(d);
+ struct domain_iommu *hd = dom_iommu(d);
table = hd->arch.amd.root_table;
level = hd->arch.amd.paging_mode;
mfn = next_table_mfn;
/* allocate lower level page table */
- table = iommu_alloc_pgtable(d);
+ table = iommu_alloc_pgtable(hd);
if ( table == NULL )
{
AMD_IOMMU_ERROR("cannot allocate I/O page table\n");
if ( next_table_mfn == 0 )
{
- table = iommu_alloc_pgtable(d);
+ table = iommu_alloc_pgtable(hd);
if ( table == NULL )
{
AMD_IOMMU_ERROR("cannot allocate I/O page table\n");
spin_lock(&hd->arch.mapping_lock);
- hd->arch.amd.root_table = iommu_alloc_pgtable(d);
+ hd->arch.amd.root_table = iommu_alloc_pgtable(hd);
if ( !hd->arch.amd.root_table )
goto out;
* page table pages, and the resulting allocations are always
* zeroed.
*/
- pg = iommu_alloc_pgtable(d);
+ pg = iommu_alloc_pgtable(hd);
if ( !pg )
break;
if ( unlikely(!hd->arch.amd.root_table) )
{
- hd->arch.amd.root_table = iommu_alloc_pgtable(d);
+ hd->arch.amd.root_table = iommu_alloc_pgtable(hd);
if ( !hd->arch.amd.root_table )
return -ENOMEM;
}
{
struct page_info *pg;
- if ( !alloc || !(pg = iommu_alloc_pgtable(domain)) )
+ if ( !alloc || !(pg = iommu_alloc_pgtable(hd)) )
goto out;
hd->arch.vtd.pgd_maddr = page_to_maddr(pg);
if ( !alloc )
break;
- pg = iommu_alloc_pgtable(domain);
+ pg = iommu_alloc_pgtable(hd);
if ( !pg )
break;
goto out;
}
- pg = iommu_alloc_pgtable(d);
+ pg = iommu_alloc_pgtable(hd);
rc = -ENOMEM;
if ( !pg )
* page table pages, and the resulting allocations are always
* zeroed.
*/
- pg = iommu_alloc_pgtable(d);
+ pg = iommu_alloc_pgtable(hd);
if ( !pg )
goto out;
return 0;
}
-struct page_info *iommu_alloc_pgtable(struct domain *d)
+struct page_info *iommu_alloc_pgtable(struct domain_iommu *hd)
{
- struct domain_iommu *hd = dom_iommu(d);
unsigned int memflags = 0;
struct page_info *pg;
void *p;