dma-mapping.h 835 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef _ASM_DMA_MAPPING_H
#define _ASM_DMA_MAPPING_H

C
Christoph Hellwig 已提交
4
#include <linux/scatterlist.h>
5
#include <asm/dma-coherence.h>
L
Linus Torvalds 已提交
6 7
#include <asm/cache.h>

R
Ralf Baechle 已提交
8
#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */
9
#include <dma-coherence.h>
10
#endif
L
Linus Torvalds 已提交
11

12
extern struct dma_map_ops *mips_dma_map_ops;
L
Linus Torvalds 已提交
13

14 15 16 17 18 19 20
static inline struct dma_map_ops *get_dma_ops(struct device *dev)
{
	if (dev && dev->archdata.dma_ops)
		return dev->archdata.dma_ops;
	else
		return mips_dma_map_ops;
}
L
Linus Torvalds 已提交
21

22 23 24
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
{
	if (!dev->dma_mask)
25
		return false;
L
Linus Torvalds 已提交
26

27 28 29 30 31
	return addr + size <= *dev->dma_mask;
}

static inline void dma_mark_clean(void *addr, size_t size) {}

32
extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
L
Linus Torvalds 已提交
33 34 35
	       enum dma_data_direction direction);

#endif /* _ASM_DMA_MAPPING_H */