dma-mapping.h 632 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef ___ASM_SPARC_DMA_MAPPING_H
  3. #define ___ASM_SPARC_DMA_MAPPING_H
  4. #include <linux/scatterlist.h>
  5. #include <linux/mm.h>
  6. #include <linux/dma-debug.h>
  7. extern const struct dma_map_ops *dma_ops;
  8. extern const struct dma_map_ops pci32_dma_ops;
  9. extern struct bus_type pci_bus_type;
  10. static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
  11. {
  12. #ifdef CONFIG_SPARC_LEON
  13. if (sparc_cpu_model == sparc_leon)
  14. return &pci32_dma_ops;
  15. #endif
  16. #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
  17. if (bus == &pci_bus_type)
  18. return &pci32_dma_ops;
  19. #endif
  20. return dma_ops;
  21. }
  22. #endif