diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2011-12-29 07:09:51 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-05-21 09:09:38 -0400 |
commit | 0a2b9a6ea93650b8a00f9fd5ee8fdd25671e2df6 (patch) | |
tree | c930063ff30882db67e110774bf8b46497d23f15 /arch/x86/include | |
parent | c64be2bb1c6eb43c838b2c6d57b074078be208dd (diff) |
X86: integrate CMA with DMA-mapping subsystem
This patch adds support for CMA to dma-mapping subsystem for x86
architecture that uses common pci-dma/pci-nommu implementation. This
allows to test CMA on KVM/QEMU and a lot of common x86 boxes.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/dma-contiguous.h | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/dma-mapping.h | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/include/asm/dma-contiguous.h b/arch/x86/include/asm/dma-contiguous.h new file mode 100644 index 000000000000..c09241659971 --- /dev/null +++ b/arch/x86/include/asm/dma-contiguous.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef ASMX86_DMA_CONTIGUOUS_H | ||
2 | #define ASMX86_DMA_CONTIGUOUS_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | #include <asm-generic/dma-contiguous.h> | ||
8 | |||
9 | static inline void | ||
10 | dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) { } | ||
11 | |||
12 | #endif | ||
13 | #endif | ||
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 4b4331d71935..7b9227b44b9b 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <asm/swiotlb.h> | 14 | #include <asm/swiotlb.h> |
15 | #include <asm-generic/dma-coherent.h> | 15 | #include <asm-generic/dma-coherent.h> |
16 | #include <linux/dma-contiguous.h> | ||
16 | 17 | ||
17 | #ifdef CONFIG_ISA | 18 | #ifdef CONFIG_ISA |
18 | # define ISA_DMA_BIT_MASK DMA_BIT_MASK(24) | 19 | # define ISA_DMA_BIT_MASK DMA_BIT_MASK(24) |
@@ -62,6 +63,10 @@ extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | |||
62 | dma_addr_t *dma_addr, gfp_t flag, | 63 | dma_addr_t *dma_addr, gfp_t flag, |
63 | struct dma_attrs *attrs); | 64 | struct dma_attrs *attrs); |
64 | 65 | ||
66 | extern void dma_generic_free_coherent(struct device *dev, size_t size, | ||
67 | void *vaddr, dma_addr_t dma_addr, | ||
68 | struct dma_attrs *attrs); | ||
69 | |||
65 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 70 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
66 | { | 71 | { |
67 | if (!dev->dma_mask) | 72 | if (!dev->dma_mask) |