dma-mapping.h 942 字节
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 const struct dma_map_ops *mips_dma_map_ops;
L
Linus Torvalds 已提交
13

14
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
15
{
16
	return mips_dma_map_ops;
17
}
L
Linus Torvalds 已提交
18

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

24 25 26 27 28
	return addr + size <= *dev->dma_mask;
}

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

29 30 31 32 33 34 35 36 37 38
#define arch_setup_dma_ops arch_setup_dma_ops
static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
				      u64 size, const struct iommu_ops *iommu,
				      bool coherent)
{
#ifdef CONFIG_DMA_PERDEV_COHERENT
	dev->archdata.dma_coherent = coherent;
#endif
}

L
Linus Torvalds 已提交
39
#endif /* _ASM_DMA_MAPPING_H */