blob: cebbb03370eca37fdb33d3ab8a71611be0280489 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _M68K_DMA_MAPPING_H
2#define _M68K_DMA_MAPPING_H
3
Roman Zippel742636f2006-06-25 05:46:57 -07004#include <asm/cache.h>
5
Roman Zippelb035c962006-06-25 05:46:56 -07006struct scatterlist;
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Roman Zippelb035c962006-06-25 05:46:56 -07008static inline int dma_supported(struct device *dev, u64 mask)
9{
10 return 1;
11}
12
13static inline int dma_set_mask(struct device *dev, u64 mask)
14{
15 return 0;
16}
17
Roman Zippel742636f2006-06-25 05:46:57 -070018static inline int dma_get_cache_alignment(void)
19{
20 return 1 << L1_CACHE_SHIFT;
21}
22
23static inline int dma_is_consistent(dma_addr_t dma_addr)
24{
25 return 0;
26}
27
Roman Zippelb035c962006-06-25 05:46:56 -070028extern void *dma_alloc_coherent(struct device *, size_t,
29 dma_addr_t *, int);
30extern void dma_free_coherent(struct device *, size_t,
31 void *, dma_addr_t);
32
Roman Zippel742636f2006-06-25 05:46:57 -070033static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
34 dma_addr_t *handle, int flag)
35{
36 return dma_alloc_coherent(dev, size, handle, flag);
37}
38static inline void dma_free_noncoherent(struct device *dev, size_t size,
39 void *addr, dma_addr_t handle)
40{
41 dma_free_coherent(dev, size, addr, handle);
42}
43static inline void dma_cache_sync(void *vaddr, size_t size,
44 enum dma_data_direction dir)
45{
46 /* we use coherent allocation, so not much to do here. */
47}
48
Roman Zippelb035c962006-06-25 05:46:56 -070049extern dma_addr_t dma_map_single(struct device *, void *, size_t,
50 enum dma_data_direction);
51static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
52 size_t size, enum dma_data_direction dir)
53{
54}
55
56extern dma_addr_t dma_map_page(struct device *, struct page *,
57 unsigned long, size_t size,
58 enum dma_data_direction);
59static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
60 size_t size, enum dma_data_direction dir)
61{
62}
63
64extern int dma_map_sg(struct device *, struct scatterlist *, int,
65 enum dma_data_direction);
66static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
67 int nhwentries, enum dma_data_direction dir)
68{
69}
70
71extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
72 enum dma_data_direction);
73extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
74 enum dma_data_direction);
75
76static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
77 size_t size, enum dma_data_direction dir)
78{
79}
80
81static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
82 int nents, enum dma_data_direction dir)
83{
84}
85
86static inline int dma_mapping_error(dma_addr_t handle)
87{
88 return 0;
89}
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
91#endif /* _M68K_DMA_MAPPING_H */