dma-contiguous.h 442 B

123456789101112131415161718192021222324252627
  1. #ifndef ASM_DMA_CONTIGUOUS_H
  2. #define ASM_DMA_CONTIGUOUS_H
  3. #ifdef __KERNEL__
  4. #ifdef CONFIG_CMA
  5. #include <linux/device.h>
  6. #include <linux/dma-contiguous.h>
  7. static inline struct cma *dev_get_cma_area(struct device *dev)
  8. {
  9. if (dev && dev->cma_area)
  10. return dev->cma_area;
  11. return dma_contiguous_def_area;
  12. }
  13. static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
  14. {
  15. if (dev)
  16. dev->cma_area = cma;
  17. }
  18. #endif
  19. #endif
  20. #endif