diff options
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ff203c465fed..9a663c6db16a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -66,6 +66,33 @@ dma_mark_declared_memory_occupied(struct device *dev, | |||
66 | } | 66 | } |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | #endif | 69 | /* |
70 | * Managed DMA API | ||
71 | */ | ||
72 | extern void *dmam_alloc_coherent(struct device *dev, size_t size, | ||
73 | dma_addr_t *dma_handle, gfp_t gfp); | ||
74 | extern void dmam_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
75 | dma_addr_t dma_handle); | ||
76 | extern void *dmam_alloc_noncoherent(struct device *dev, size_t size, | ||
77 | dma_addr_t *dma_handle, gfp_t gfp); | ||
78 | extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, | ||
79 | dma_addr_t dma_handle); | ||
80 | #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | ||
81 | extern int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
82 | dma_addr_t device_addr, size_t size, | ||
83 | int flags); | ||
84 | extern void dmam_release_declared_memory(struct device *dev); | ||
85 | #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ | ||
86 | static inline int dmam_declare_coherent_memory(struct device *dev, | ||
87 | dma_addr_t bus_addr, dma_addr_t device_addr, | ||
88 | size_t size, gfp_t gfp) | ||
89 | { | ||
90 | return 0; | ||
91 | } | ||
70 | 92 | ||
93 | static inline void dmam_release_declared_memory(struct device *dev) | ||
94 | { | ||
95 | } | ||
96 | #endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ | ||
71 | 97 | ||
98 | #endif | ||