diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-08-19 10:32:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-22 02:34:46 -0400 |
commit | 43a5a5a09b8cfd56047706cf904718d073ccfd33 (patch) | |
tree | 5f537fa359fae2f58a0d590968f4555c97c8a634 | |
parent | 94581094e774402a11887719bac10505236c2d51 (diff) |
x86: add free_coherent dma_ops callback to GART driver
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 076e64b2d4f3..ef753e233580 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -519,6 +519,15 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | |||
519 | return NULL; | 519 | return NULL; |
520 | } | 520 | } |
521 | 521 | ||
522 | /* free a coherent mapping */ | ||
523 | static void | ||
524 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
525 | dma_addr_t dma_addr) | ||
526 | { | ||
527 | gart_unmap_single(dev, dma_addr, size, DMA_BIDIRECTIONAL); | ||
528 | free_pages((unsigned long)vaddr, get_order(size)); | ||
529 | } | ||
530 | |||
522 | static int no_agp; | 531 | static int no_agp; |
523 | 532 | ||
524 | static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size) | 533 | static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size) |
@@ -722,6 +731,7 @@ static struct dma_mapping_ops gart_dma_ops = { | |||
722 | .map_sg = gart_map_sg, | 731 | .map_sg = gart_map_sg, |
723 | .unmap_sg = gart_unmap_sg, | 732 | .unmap_sg = gart_unmap_sg, |
724 | .alloc_coherent = gart_alloc_coherent, | 733 | .alloc_coherent = gart_alloc_coherent, |
734 | .free_coherent = gart_free_coherent, | ||
725 | }; | 735 | }; |
726 | 736 | ||
727 | void gart_iommu_shutdown(void) | 737 | void gart_iommu_shutdown(void) |