aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/dma-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/dma-mapping.h')
-rw-r--r--arch/arm/include/asm/dma-mapping.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index c568da7dcae..8f69b98f68f 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -9,20 +9,24 @@
9#include <asm-generic/dma-coherent.h> 9#include <asm-generic/dma-coherent.h>
10#include <asm/memory.h> 10#include <asm/memory.h>
11 11
12#ifdef __arch_page_to_dma
13#error Please update to __arch_pfn_to_dma
14#endif
15
12/* 16/*
13 * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions 17 * dma_to_pfn/pfn_to_dma/dma_to_virt/virt_to_dma are architecture private
14 * used internally by the DMA-mapping API to provide DMA addresses. They 18 * functions used internally by the DMA-mapping API to provide DMA
15 * must not be used by drivers. 19 * addresses. They must not be used by drivers.
16 */ 20 */
17#ifndef __arch_page_to_dma 21#ifndef __arch_pfn_to_dma
18static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) 22static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
19{ 23{
20 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); 24 return (dma_addr_t)__pfn_to_bus(pfn);
21} 25}
22 26
23static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) 27static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
24{ 28{
25 return pfn_to_page(__bus_to_pfn(addr)); 29 return __bus_to_pfn(addr);
26} 30}
27 31
28static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 32static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
@@ -35,14 +39,14 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
35 return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); 39 return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
36} 40}
37#else 41#else
38static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) 42static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
39{ 43{
40 return __arch_page_to_dma(dev, page); 44 return __arch_pfn_to_dma(dev, pfn);
41} 45}
42 46
43static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) 47static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
44{ 48{
45 return __arch_dma_to_page(dev, addr); 49 return __arch_dma_to_pfn(dev, addr);
46} 50}
47 51
48static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 52static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
@@ -368,7 +372,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
368 372
369 __dma_page_cpu_to_dev(page, offset, size, dir); 373 __dma_page_cpu_to_dev(page, offset, size, dir);
370 374
371 return page_to_dma(dev, page) + offset; 375 return pfn_to_dma(dev, page_to_pfn(page)) + offset;
372} 376}
373 377
374/** 378/**
@@ -408,8 +412,8 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
408static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, 412static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
409 size_t size, enum dma_data_direction dir) 413 size_t size, enum dma_data_direction dir)
410{ 414{
411 __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK, 415 __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)),
412 size, dir); 416 handle & ~PAGE_MASK, size, dir);
413} 417}
414#endif /* CONFIG_DMABOUNCE */ 418#endif /* CONFIG_DMABOUNCE */
415 419