aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/dma-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/dma-mapping.h')
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index dd70fac57ec8..62678e365ca0 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -22,9 +22,11 @@
22 22
23/* Some dma direct funcs must be visible for use in other dma_ops */ 23/* Some dma direct funcs must be visible for use in other dma_ops */
24extern void *dma_direct_alloc_coherent(struct device *dev, size_t size, 24extern void *dma_direct_alloc_coherent(struct device *dev, size_t size,
25 dma_addr_t *dma_handle, gfp_t flag); 25 dma_addr_t *dma_handle, gfp_t flag,
26 struct dma_attrs *attrs);
26extern void dma_direct_free_coherent(struct device *dev, size_t size, 27extern void dma_direct_free_coherent(struct device *dev, size_t size,
27 void *vaddr, dma_addr_t dma_handle); 28 void *vaddr, dma_addr_t dma_handle,
29 struct dma_attrs *attrs);
28 30
29 31
30#ifdef CONFIG_NOT_COHERENT_CACHE 32#ifdef CONFIG_NOT_COHERENT_CACHE
@@ -130,23 +132,29 @@ static inline int dma_supported(struct device *dev, u64 mask)
130 132
131extern int dma_set_mask(struct device *dev, u64 dma_mask); 133extern int dma_set_mask(struct device *dev, u64 dma_mask);
132 134
133static inline void *dma_alloc_coherent(struct device *dev, size_t size, 135#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
134 dma_addr_t *dma_handle, gfp_t flag) 136
137static inline void *dma_alloc_attrs(struct device *dev, size_t size,
138 dma_addr_t *dma_handle, gfp_t flag,
139 struct dma_attrs *attrs)
135{ 140{
136 struct dma_map_ops *dma_ops = get_dma_ops(dev); 141 struct dma_map_ops *dma_ops = get_dma_ops(dev);
137 void *cpu_addr; 142 void *cpu_addr;
138 143
139 BUG_ON(!dma_ops); 144 BUG_ON(!dma_ops);
140 145
141 cpu_addr = dma_ops->alloc_coherent(dev, size, dma_handle, flag); 146 cpu_addr = dma_ops->alloc(dev, size, dma_handle, flag, attrs);
142 147
143 debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); 148 debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);
144 149
145 return cpu_addr; 150 return cpu_addr;
146} 151}
147 152
148static inline void dma_free_coherent(struct device *dev, size_t size, 153#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
149 void *cpu_addr, dma_addr_t dma_handle) 154
155static inline void dma_free_attrs(struct device *dev, size_t size,
156 void *cpu_addr, dma_addr_t dma_handle,
157 struct dma_attrs *attrs)
150{ 158{
151 struct dma_map_ops *dma_ops = get_dma_ops(dev); 159 struct dma_map_ops *dma_ops = get_dma_ops(dev);
152 160
@@ -154,7 +162,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
154 162
155 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); 163 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
156 164
157 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); 165 dma_ops->free(dev, size, cpu_addr, dma_handle, attrs);
158} 166}
159 167
160static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 168static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)