dma-coherent.h 891 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef DMA_COHERENT_H
  2. #define DMA_COHERENT_H
  3. #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
  4. /*
  5. * These two functions are only for dma allocator.
  6. * Don't use them in device drivers.
  7. */
  8. int dma_alloc_from_coherent(struct device *dev, ssize_t size,
  9. dma_addr_t *dma_handle, void **ret);
  10. int dma_release_from_coherent(struct device *dev, int order, void *vaddr);
  11. /*
  12. * Standard interface
  13. */
  14. #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
  15. extern int
  16. dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
  17. dma_addr_t device_addr, size_t size, int flags);
  18. extern void
  19. dma_release_declared_memory(struct device *dev);
  20. extern void *
  21. dma_mark_declared_memory_occupied(struct device *dev,
  22. dma_addr_t device_addr, size_t size);
  23. #else
  24. #define dma_alloc_from_coherent(dev, size, handle, ret) (0)
  25. #define dma_release_from_coherent(dev, order, vaddr) (0)
  26. #endif
  27. #endif