aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2008-08-01 13:13:32 -0400
committerTony Luck <tony.luck@intel.com>2008-08-01 13:21:21 -0400
commit7f30491ccd28627742e37899453ae20e3da8e18f (patch)
tree7291c0a26ed3a31acf9542857af3981d278f5de8 /arch/ia64/include/asm/dma-mapping.h
parent94ad374a0751f40d25e22e036c37f7263569d24c (diff)
[IA64] Move include/asm-ia64 to arch/ia64/include/asm
After moving the the include files there were a few clean-ups: 1) Some files used #include <asm-ia64/xyz.h>, changed to <asm/xyz.h> 2) Some comments alerted maintainers to look at various header files to make matching updates if certain code were to be changed. Updated these comments to use the new include paths. 3) Some header files mentioned their own names in initial comments. Just deleted these self references. Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/include/asm/dma-mapping.h')
-rw-r--r--arch/ia64/include/asm/dma-mapping.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
new file mode 100644
index 000000000000..9f0df9bd46b7
--- /dev/null
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -0,0 +1,97 @@
1#ifndef _ASM_IA64_DMA_MAPPING_H
2#define _ASM_IA64_DMA_MAPPING_H
3
4/*
5 * Copyright (C) 2003-2004 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */
8#include <asm/machvec.h>
9#include <linux/scatterlist.h>
10
11#define dma_alloc_coherent platform_dma_alloc_coherent
12/* coherent mem. is cheap */
13static inline void *
14dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
15 gfp_t flag)
16{
17 return dma_alloc_coherent(dev, size, dma_handle, flag);
18}
19#define dma_free_coherent platform_dma_free_coherent
20static inline void
21dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
22 dma_addr_t dma_handle)
23{
24 dma_free_coherent(dev, size, cpu_addr, dma_handle);
25}
26#define dma_map_single_attrs platform_dma_map_single_attrs
27static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
28 size_t size, int dir)
29{
30 return dma_map_single_attrs(dev, cpu_addr, size, dir, NULL);
31}
32#define dma_map_sg_attrs platform_dma_map_sg_attrs
33static inline int dma_map_sg(struct device *dev, struct scatterlist *sgl,
34 int nents, int dir)
35{
36 return dma_map_sg_attrs(dev, sgl, nents, dir, NULL);
37}
38#define dma_unmap_single_attrs platform_dma_unmap_single_attrs
39static inline void dma_unmap_single(struct device *dev, dma_addr_t cpu_addr,
40 size_t size, int dir)
41{
42 return dma_unmap_single_attrs(dev, cpu_addr, size, dir, NULL);
43}
44#define dma_unmap_sg_attrs platform_dma_unmap_sg_attrs
45static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
46 int nents, int dir)
47{
48 return dma_unmap_sg_attrs(dev, sgl, nents, dir, NULL);
49}
50#define dma_sync_single_for_cpu platform_dma_sync_single_for_cpu
51#define dma_sync_sg_for_cpu platform_dma_sync_sg_for_cpu
52#define dma_sync_single_for_device platform_dma_sync_single_for_device
53#define dma_sync_sg_for_device platform_dma_sync_sg_for_device
54#define dma_mapping_error platform_dma_mapping_error
55
56#define dma_map_page(dev, pg, off, size, dir) \
57 dma_map_single(dev, page_address(pg) + (off), (size), (dir))
58#define dma_unmap_page(dev, dma_addr, size, dir) \
59 dma_unmap_single(dev, dma_addr, size, dir)
60
61/*
62 * Rest of this file is part of the "Advanced DMA API". Use at your own risk.
63 * See Documentation/DMA-API.txt for details.
64 */
65
66#define dma_sync_single_range_for_cpu(dev, dma_handle, offset, size, dir) \
67 dma_sync_single_for_cpu(dev, dma_handle, size, dir)
68#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir) \
69 dma_sync_single_for_device(dev, dma_handle, size, dir)
70
71#define dma_supported platform_dma_supported
72
73static inline int
74dma_set_mask (struct device *dev, u64 mask)
75{
76 if (!dev->dma_mask || !dma_supported(dev, mask))
77 return -EIO;
78 *dev->dma_mask = mask;
79 return 0;
80}
81
82extern int dma_get_cache_alignment(void);
83
84static inline void
85dma_cache_sync (struct device *dev, void *vaddr, size_t size,
86 enum dma_data_direction dir)
87{
88 /*
89 * IA-64 is cache-coherent, so this is mostly a no-op. However, we do need to
90 * ensure that dma_cache_sync() enforces order, hence the mb().
91 */
92 mb();
93}
94
95#define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */
96
97#endif /* _ASM_IA64_DMA_MAPPING_H */