1 #ifndef ___ASM_SPARC_DMA_MAPPING_H 2 #define ___ASM_SPARC_DMA_MAPPING_H 3 4 #include <linux/scatterlist.h> 5 #include <linux/mm.h> 6 #include <linux/dma-debug.h> 7 8 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 9 enum dma_data_direction dir) 10 { 11 /* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this 12 * routine can be a nop. 13 */ 14 } 15 16 extern const struct dma_map_ops *dma_ops; 17 extern const struct dma_map_ops pci32_dma_ops; 18 19 extern struct bus_type pci_bus_type; 20 21 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 22 { 23 #ifdef CONFIG_SPARC_LEON 24 if (sparc_cpu_model == sparc_leon) 25 return &pci32_dma_ops; 26 #endif 27 #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI) 28 if (bus == &pci_bus_type) 29 return &pci32_dma_ops; 30 #endif 31 return dma_ops; 32 } 33 34 #endif 35