1 #ifndef _ASM_X86_DMA_MAPPING_H
2 #define _ASM_X86_DMA_MAPPING_H
14 #include <asm/swiotlb.h>
19 # define ISA_DMA_BIT_MASK DMA_BIT_MASK(24)
21 # define ISA_DMA_BIT_MASK DMA_BIT_MASK(32)
24 #define DMA_ERROR_CODE 0
34 #ifndef CONFIG_X86_DEV_DMA_OPS
56 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
57 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
70 #ifdef CONFIG_X86_DMA_REMAP
81 return addr + size - 1 <= *dev->
dma_mask;
99 flush_write_buffers();
102 static inline unsigned long dma_alloc_coherent_mask(
struct device *dev,
105 unsigned long dma_mask = 0;
114 static inline gfp_t dma_alloc_coherent_gfp_flags(
struct device *dev,
gfp_t gfp)
116 unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);
127 #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
144 if (!is_device_dma_capable(dev))
150 memory = ops->
alloc(dev, size, dma_handle,
151 dma_alloc_coherent_gfp_flags(dev, gfp), attrs);
157 #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
159 static inline void dma_free_attrs(
struct device *dev,
size_t size,
172 ops->
free(dev, size, vaddr, bus, attrs);