diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-05-20 00:43:00 -0600 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-05-20 00:43:00 -0600 |
commit | 78fab4c04c76b8c9327541bd270f82b85b42bbf7 (patch) | |
tree | b43006348a1ac15c28e6791d08646809761a2a4a /arch/powerpc/kernel/dma.c | |
parent | 3b8a4dd3ebfcc647260ad5c39ef4f73eb3a6b155 (diff) | |
parent | 61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff) | |
download | talos-op-linux-78fab4c04c76b8c9327541bd270f82b85b42bbf7.tar.gz talos-op-linux-78fab4c04c76b8c9327541bd270f82b85b42bbf7.zip |
Merge commit 'v2.6.39' into spi/next
Diffstat (limited to 'arch/powerpc/kernel/dma.c')
-rw-r--r-- | arch/powerpc/kernel/dma.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index cf02cad62d9a..d238c082c3c5 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c @@ -179,3 +179,21 @@ static int __init dma_init(void) return 0; } fs_initcall(dma_init); + +int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t handle, size_t size) +{ + unsigned long pfn; + +#ifdef CONFIG_NOT_COHERENT_CACHE + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + pfn = __dma_get_coherent_pfn((unsigned long)cpu_addr); +#else + pfn = page_to_pfn(virt_to_page(cpu_addr)); +#endif + return remap_pfn_range(vma, vma->vm_start, + pfn + vma->vm_pgoff, + vma->vm_end - vma->vm_start, + vma->vm_page_prot); +} +EXPORT_SYMBOL_GPL(dma_mmap_coherent); |