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 #define HAVE_ARCH_DMA_SUPPORTED 1 9 int dma_supported(struct device *dev, u64 mask); 10 11 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 12 enum dma_data_direction dir) 13 { 14 /* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this 15 * routine can be a nop. 16 */ 17 } 18 19 extern const struct dma_map_ops *dma_ops; 20 extern const struct dma_map_ops *leon_dma_ops; 21 extern const struct dma_map_ops pci32_dma_ops; 22 23 extern struct bus_type pci_bus_type; 24 25 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 26 { 27 #ifdef CONFIG_SPARC_LEON 28 if (sparc_cpu_model == sparc_leon) 29 return leon_dma_ops; 30 #endif 31 #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI) 32 if (bus == &pci_bus_type) 33 return &pci32_dma_ops; 34 #endif 35 return dma_ops; 36 } 37 38 #endif 39