Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99628
b: refs/heads/master
c: 6631ee9
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Jun 27, 2008
1 parent 8a5016f commit d076d03
Show file tree
Hide file tree
Showing 2 changed files with 47 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: c432f3df8ea740e2ecb27da88bd6b5a254714959
refs/heads/master: 6631ee9d00996e7663a086b5abceba65c89ff8f6
46 changes: 46 additions & 0 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,3 +906,49 @@ void prealloc_protection_domains(void)
}
}

static struct dma_mapping_ops amd_iommu_dma_ops = {
.alloc_coherent = alloc_coherent,
.free_coherent = free_coherent,
.map_single = map_single,
.unmap_single = unmap_single,
.map_sg = map_sg,
.unmap_sg = unmap_sg,
};

int __init amd_iommu_init_dma_ops(void)
{
struct amd_iommu *iommu;
int order = amd_iommu_aperture_order;
int ret;

list_for_each_entry(iommu, &amd_iommu_list, list) {
iommu->default_dom = dma_ops_domain_alloc(iommu, order);
if (iommu->default_dom == NULL)
return -ENOMEM;
ret = iommu_init_unity_mappings(iommu);
if (ret)
goto free_domains;
}

if (amd_iommu_isolate)
prealloc_protection_domains();

iommu_detected = 1;
force_iommu = 1;
bad_dma_address = 0;
gart_iommu_aperture_disabled = 1;
gart_iommu_aperture = 0;

dma_ops = &amd_iommu_dma_ops;

return 0;

free_domains:

list_for_each_entry(iommu, &amd_iommu_list, list) {
if (iommu->default_dom)
dma_ops_domain_free(iommu->default_dom);
}

return ret;
}

0 comments on commit d076d03

Please sign in to comment.