dma-mapping.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef _ASM_CRIS_DMA_MAPPING_H
  2. #define _ASM_CRIS_DMA_MAPPING_H
  3. #include "scatterlist.h"
  4. static inline int
  5. dma_supported(struct device *dev, u64 mask)
  6. {
  7. BUG();
  8. return 0;
  9. }
  10. static inline int
  11. dma_set_mask(struct device *dev, u64 dma_mask)
  12. {
  13. BUG();
  14. return 1;
  15. }
  16. static inline void *
  17. dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
  18. int flag)
  19. {
  20. BUG();
  21. return NULL;
  22. }
  23. static inline void
  24. dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
  25. dma_addr_t dma_handle)
  26. {
  27. BUG();
  28. }
  29. static inline dma_addr_t
  30. dma_map_single(struct device *dev, void *cpu_addr, size_t size,
  31. enum dma_data_direction direction)
  32. {
  33. BUG();
  34. return 0;
  35. }
  36. static inline void
  37. dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
  38. enum dma_data_direction direction)
  39. {
  40. BUG();
  41. }
  42. static inline dma_addr_t
  43. dma_map_page(struct device *dev, struct page *page,
  44. unsigned long offset, size_t size,
  45. enum dma_data_direction direction)
  46. {
  47. BUG();
  48. return 0;
  49. }
  50. static inline void
  51. dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
  52. enum dma_data_direction direction)
  53. {
  54. BUG();
  55. }
  56. static inline int
  57. dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
  58. enum dma_data_direction direction)
  59. {
  60. BUG();
  61. return 1;
  62. }
  63. static inline void
  64. dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
  65. enum dma_data_direction direction)
  66. {
  67. BUG();
  68. }
  69. static inline void
  70. dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
  71. enum dma_data_direction direction)
  72. {
  73. BUG();
  74. }
  75. static inline void
  76. dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
  77. enum dma_data_direction direction)
  78. {
  79. BUG();
  80. }
  81. /* Now for the API extensions over the pci_ one */
  82. #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
  83. #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
  84. #define dma_is_consistent(d) (1)
  85. static inline int
  86. dma_get_cache_alignment(void)
  87. {
  88. /* no easy way to get cache size on all processors, so return
  89. * the maximum possible, to be safe */
  90. return (1 << L1_CACHE_SHIFT_MAX);
  91. }
  92. static inline void
  93. dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
  94. unsigned long offset, size_t size,
  95. enum dma_data_direction direction)
  96. {
  97. BUG();
  98. }
  99. static inline void
  100. dma_cache_sync(void *vaddr, size_t size,
  101. enum dma_data_direction direction)
  102. {
  103. BUG();
  104. }
  105. #endif