Lines Matching refs:size
115 static void *mips_dma_alloc_noncoherent(struct device *dev, size_t size, in mips_dma_alloc_noncoherent() argument
122 ret = (void *) __get_free_pages(gfp, get_order(size)); in mips_dma_alloc_noncoherent()
125 memset(ret, 0, size); in mips_dma_alloc_noncoherent()
126 *dma_handle = plat_map_dma_mem(dev, ret, size); in mips_dma_alloc_noncoherent()
132 static void *mips_dma_alloc_coherent(struct device *dev, size_t size, in mips_dma_alloc_coherent() argument
137 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; in mips_dma_alloc_coherent()
144 return mips_dma_alloc_noncoherent(dev, size, dma_handle, gfp); in mips_dma_alloc_coherent()
150 count, get_order(size)); in mips_dma_alloc_coherent()
152 page = alloc_pages(gfp, get_order(size)); in mips_dma_alloc_coherent()
158 memset(ret, 0, size); in mips_dma_alloc_coherent()
159 *dma_handle = plat_map_dma_mem(dev, ret, size); in mips_dma_alloc_coherent()
161 dma_cache_wback_inv((unsigned long) ret, size); in mips_dma_alloc_coherent()
170 static void mips_dma_free_noncoherent(struct device *dev, size_t size, in mips_dma_free_noncoherent() argument
173 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); in mips_dma_free_noncoherent()
174 free_pages((unsigned long) vaddr, get_order(size)); in mips_dma_free_noncoherent()
177 static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr, in mips_dma_free_coherent() argument
181 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; in mips_dma_free_coherent()
185 mips_dma_free_noncoherent(dev, size, vaddr, dma_handle); in mips_dma_free_coherent()
189 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); in mips_dma_free_coherent()
197 __free_pages(page, get_order(size)); in mips_dma_free_coherent()
201 void *cpu_addr, dma_addr_t dma_addr, size_t size, in mips_dma_mmap() argument
205 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; in mips_dma_mmap()
221 if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) in mips_dma_mmap()
234 static inline void __dma_sync_virtual(void *addr, size_t size, in __dma_sync_virtual() argument
239 dma_cache_wback((unsigned long)addr, size); in __dma_sync_virtual()
243 dma_cache_inv((unsigned long)addr, size); in __dma_sync_virtual()
247 dma_cache_wback_inv((unsigned long)addr, size); in __dma_sync_virtual()
262 unsigned long offset, size_t size, enum dma_data_direction direction) in __dma_sync() argument
264 size_t left = size; in __dma_sync()
285 size, direction); in __dma_sync()
293 size_t size, enum dma_data_direction direction, struct dma_attrs *attrs) in mips_dma_unmap_page() argument
297 dma_addr & ~PAGE_MASK, size, direction); in mips_dma_unmap_page()
299 plat_unmap_dma_mem(dev, dma_addr, size, direction); in mips_dma_unmap_page()
323 unsigned long offset, size_t size, enum dma_data_direction direction, in mips_dma_map_page() argument
327 __dma_sync(page, offset, size, direction); in mips_dma_map_page()
349 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) in mips_dma_sync_single_for_cpu() argument
353 dma_handle & ~PAGE_MASK, size, direction); in mips_dma_sync_single_for_cpu()
358 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) in mips_dma_sync_single_for_device() argument
362 dma_handle & ~PAGE_MASK, size, direction); in mips_dma_sync_single_for_device()
406 void dma_cache_sync(struct device *dev, void *vaddr, size_t size, in dma_cache_sync() argument
412 __dma_sync_virtual(vaddr, size, direction); in dma_cache_sync()