LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/4] dma: dma_{un}map_{single|sg}_attrs() interface
@ 2008-01-30 5:49 akepner
0 siblings, 0 replies; only message in thread
From: akepner @ 2008-01-30 5:49 UTC (permalink / raw)
To: Tony Luck, Grant Grundler, Jesse Barnes, Jes Sorensen,
Randy Dunlap, Roland Dreier, James Bottomley, David Miller,
Muli Ben-Yehuda
Cc: linux-kernel
Introduce a new interface for passing architecture-specific
attributes when memory is mapped and unmapped for DMA. Give
the interface a default implementation which ignores
attributes.
Signed-off-by: Arthur Kepner <akepner@sgi.com>
--
dma-mapping.h | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 101a2d4..bc313e3 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -116,4 +116,37 @@ static inline void dmam_release_declared_memory(struct device *dev)
}
#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
+#ifndef ARCH_USES_DMA_ATTRS
+struct dma_attrs;
+
+static inline dma_addr_t dma_map_single_attrs(struct device *dev,
+ void *cpu_addr, size_t size,
+ int dir, struct dma_attrs* attrs)
+{
+ return dma_map_single(dev, cpu_addr, size, dir);
+}
+
+static inline void dma_unmap_single_attrs(struct device *dev,
+ dma_addr_t dma_addr,
+ size_t size, int dir,
+ struct dma_attrs* attrs)
+{
+ return dma_unmap_single(dev, dma_addr, size, dir);
+}
+
+static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
+ int nents, int dir, struct dma_attrs *attrs)
+{
+ return dma_map_sg(dev, sgl, nents, dir);
+}
+
+static inline void dma_unmap_sg_attrs(struct device *dev,
+ struct scatterlist *sgl,
+ int nents, int dir,
+ struct dma_attrs *attrs)
+{
+ return dma_unmap_sg(dev, sgl, nents, dir);
+}
+#endif /* ARCH_USES_DMA_ATTRS */
+
#endif
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-30 5:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30 5:49 [PATCH 0/4] dma: dma_{un}map_{single|sg}_attrs() interface akepner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).