dma-mapping.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef _M68K_DMA_MAPPING_H
  2. #define _M68K_DMA_MAPPING_H
  3. #include <asm/cache.h>
  4. struct scatterlist;
  5. static inline int dma_supported(struct device *dev, u64 mask)
  6. {
  7. return 1;
  8. }
  9. static inline int dma_set_mask(struct device *dev, u64 mask)
  10. {
  11. return 0;
  12. }
  13. static inline int dma_get_cache_alignment(void)
  14. {
  15. return 1 << L1_CACHE_SHIFT;
  16. }
  17. static inline int dma_is_consistent(dma_addr_t dma_addr)
  18. {
  19. return 0;
  20. }
  21. extern void *dma_alloc_coherent(struct device *, size_t,
  22. dma_addr_t *, int);
  23. extern void dma_free_coherent(struct device *, size_t,
  24. void *, dma_addr_t);
  25. static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
  26. dma_addr_t *handle, int flag)
  27. {
  28. return dma_alloc_coherent(dev, size, handle, flag);
  29. }
  30. static inline void dma_free_noncoherent(struct device *dev, size_t size,
  31. void *addr, dma_addr_t handle)
  32. {
  33. dma_free_coherent(dev, size, addr, handle);
  34. }
  35. static inline void dma_cache_sync(void *vaddr, size_t size,
  36. enum dma_data_direction dir)
  37. {
  38. /* we use coherent allocation, so not much to do here. */
  39. }
  40. extern dma_addr_t dma_map_single(struct device *, void *, size_t,
  41. enum dma_data_direction);
  42. static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
  43. size_t size, enum dma_data_direction dir)
  44. {
  45. }
  46. extern dma_addr_t dma_map_page(struct device *, struct page *,
  47. unsigned long, size_t size,
  48. enum dma_data_direction);
  49. static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
  50. size_t size, enum dma_data_direction dir)
  51. {
  52. }
  53. extern int dma_map_sg(struct device *, struct scatterlist *, int,
  54. enum dma_data_direction);
  55. static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
  56. int nhwentries, enum dma_data_direction dir)
  57. {
  58. }
  59. extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
  60. enum dma_data_direction);
  61. extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
  62. enum dma_data_direction);
  63. static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
  64. size_t size, enum dma_data_direction dir)
  65. {
  66. }
  67. static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
  68. int nents, enum dma_data_direction dir)
  69. {
  70. }
  71. static inline int dma_mapping_error(dma_addr_t handle)
  72. {
  73. return 0;
  74. }
  75. #endif /* _M68K_DMA_MAPPING_H */