dma-mapping.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _ASM_LINUX_DMA_MAPPING_H
  2. #define _ASM_LINUX_DMA_MAPPING_H
  3. #include <linux/device.h>
  4. #include <linux/err.h>
  5. /* These definitions mirror those in pci.h, so they can be used
  6. * interchangeably with their PCI_ counterparts */
  7. enum dma_data_direction {
  8. DMA_BIDIRECTIONAL = 0,
  9. DMA_TO_DEVICE = 1,
  10. DMA_FROM_DEVICE = 2,
  11. DMA_NONE = 3,
  12. };
  13. #define DMA_64BIT_MASK 0xffffffffffffffffULL
  14. #define DMA_32BIT_MASK 0x00000000ffffffffULL
  15. #include <asm/dma-mapping.h>
  16. /* Backwards compat, remove in 2.7.x */
  17. #define dma_sync_single dma_sync_single_for_cpu
  18. #define dma_sync_sg dma_sync_sg_for_cpu
  19. extern u64 dma_get_required_mask(struct device *dev);
  20. /* flags for the coherent memory api */
  21. #define DMA_MEMORY_MAP 0x01
  22. #define DMA_MEMORY_IO 0x02
  23. #define DMA_MEMORY_INCLUDES_CHILDREN 0x04
  24. #define DMA_MEMORY_EXCLUSIVE 0x08
  25. #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
  26. static inline int
  27. dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
  28. dma_addr_t device_addr, size_t size, int flags)
  29. {
  30. return 0;
  31. }
  32. static inline void
  33. dma_release_declared_memory(struct device *dev)
  34. {
  35. }
  36. static inline void *
  37. dma_mark_declared_memory_occupied(struct device *dev,
  38. dma_addr_t device_addr, size_t size)
  39. {
  40. return ERR_PTR(-EBUSY);
  41. }
  42. #endif
  43. #endif