diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-01-29 00:35:34 -0500 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-03-24 01:17:41 -0400 |
commit | 9a4048a211513c3d6c56ddf2efb276113eae0b80 (patch) | |
tree | 41bc9509df6c55db3bcaa44ecf5aa5f5ae785c89 /arch/m68k/include/asm/dma-mapping.h | |
parent | 76fdb7d6bd7922353abc8a1407c6dde3789042ce (diff) |
m68k: swtich non-mmu setups to use the mmu dma-mapping.h
The mmu version of dma-mapping.h (which is dma-mapping_mm.h) is clean
to be used for non-mmu setups as well. Remove dma-mapping_no.h and
revert dma-mapping_mm.h to dma-mapping.h
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/include/asm/dma-mapping.h')
-rw-r--r-- | arch/m68k/include/asm/dma-mapping.h | 113 |
1 files changed, 110 insertions, 3 deletions
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index f4a4c7638f89..26f505488c11 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h | |||
@@ -1,5 +1,112 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_DMA_MAPPING_H |
2 | #include "dma-mapping_no.h" | 2 | #define _M68K_DMA_MAPPING_H |
3 | |||
4 | #include <asm/cache.h> | ||
5 | |||
6 | struct scatterlist; | ||
7 | |||
8 | #ifndef CONFIG_MMU_SUN3 | ||
9 | static inline int dma_supported(struct device *dev, u64 mask) | ||
10 | { | ||
11 | return 1; | ||
12 | } | ||
13 | |||
14 | static inline int dma_set_mask(struct device *dev, u64 mask) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | static inline int dma_get_cache_alignment(void) | ||
20 | { | ||
21 | return 1 << L1_CACHE_SHIFT; | ||
22 | } | ||
23 | |||
24 | static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | extern void *dma_alloc_coherent(struct device *, size_t, | ||
30 | dma_addr_t *, gfp_t); | ||
31 | extern void dma_free_coherent(struct device *, size_t, | ||
32 | void *, dma_addr_t); | ||
33 | |||
34 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | ||
35 | dma_addr_t *handle, gfp_t flag) | ||
36 | { | ||
37 | return dma_alloc_coherent(dev, size, handle, flag); | ||
38 | } | ||
39 | static inline void dma_free_noncoherent(struct device *dev, size_t size, | ||
40 | void *addr, dma_addr_t handle) | ||
41 | { | ||
42 | dma_free_coherent(dev, size, addr, handle); | ||
43 | } | ||
44 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
45 | enum dma_data_direction dir) | ||
46 | { | ||
47 | /* we use coherent allocation, so not much to do here. */ | ||
48 | } | ||
49 | |||
50 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | ||
51 | enum dma_data_direction); | ||
52 | static inline void dma_unmap_single(struct device *dev, dma_addr_t addr, | ||
53 | size_t size, enum dma_data_direction dir) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | extern dma_addr_t dma_map_page(struct device *, struct page *, | ||
58 | unsigned long, size_t size, | ||
59 | enum dma_data_direction); | ||
60 | static inline void dma_unmap_page(struct device *dev, dma_addr_t address, | ||
61 | size_t size, enum dma_data_direction dir) | ||
62 | { | ||
63 | } | ||
64 | |||
65 | extern int dma_map_sg(struct device *, struct scatterlist *, int, | ||
66 | enum dma_data_direction); | ||
67 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
68 | int nhwentries, enum dma_data_direction dir) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t, | ||
73 | enum dma_data_direction); | ||
74 | extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int, | ||
75 | enum dma_data_direction); | ||
76 | |||
77 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
78 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
79 | enum dma_data_direction direction) | ||
80 | { | ||
81 | /* just sync everything for now */ | ||
82 | dma_sync_single_for_device(dev, dma_handle, offset + size, direction); | ||
83 | } | ||
84 | |||
85 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, | ||
86 | size_t size, enum dma_data_direction dir) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
91 | int nents, enum dma_data_direction dir) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
96 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
97 | enum dma_data_direction direction) | ||
98 | { | ||
99 | /* just sync everything for now */ | ||
100 | dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction); | ||
101 | } | ||
102 | |||
103 | static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
107 | |||
3 | #else | 108 | #else |
4 | #include "dma-mapping_mm.h" | 109 | #include <asm-generic/dma-mapping-broken.h> |
5 | #endif | 110 | #endif |
111 | |||
112 | #endif /* _M68K_DMA_MAPPING_H */ | ||