2011-12-29 16:09:51 +04:00
|
|
|
#ifndef ASM_DMA_CONTIGUOUS_H
|
|
|
|
#define ASM_DMA_CONTIGUOUS_H
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
#ifdef CONFIG_CMA
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/dma-contiguous.h>
|
|
|
|
|
|
|
|
static inline struct cma *dev_get_cma_area(struct device *dev)
|
|
|
|
{
|
|
|
|
if (dev && dev->cma_area)
|
|
|
|
return dev->cma_area;
|
|
|
|
return dma_contiguous_default_area;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
|
|
|
|
{
|
|
|
|
if (dev)
|
|
|
|
dev->cma_area = cma;
|
2012-07-06 14:02:04 +04:00
|
|
|
if (!dev && !dma_contiguous_default_area)
|
2011-12-29 16:09:51 +04:00
|
|
|
dma_contiguous_default_area = cma;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|