diff options
Diffstat (limited to 'arch/sparc/include/asm/dma-mapping.h')
-rw-r--r-- | arch/sparc/include/asm/dma-mapping.h | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 204e4bf64438..893f3ecc9750 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h | |||
@@ -13,36 +13,7 @@ extern int dma_set_mask(struct device *dev, u64 dma_mask); | |||
13 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 13 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
14 | #define dma_is_consistent(d, h) (1) | 14 | #define dma_is_consistent(d, h) (1) |
15 | 15 | ||
16 | struct dma_ops { | 16 | extern const struct dma_map_ops *dma_ops; |
17 | void *(*alloc_coherent)(struct device *dev, size_t size, | ||
18 | dma_addr_t *dma_handle, gfp_t flag); | ||
19 | void (*free_coherent)(struct device *dev, size_t size, | ||
20 | void *cpu_addr, dma_addr_t dma_handle); | ||
21 | dma_addr_t (*map_page)(struct device *dev, struct page *page, | ||
22 | unsigned long offset, size_t size, | ||
23 | enum dma_data_direction direction); | ||
24 | void (*unmap_page)(struct device *dev, dma_addr_t dma_addr, | ||
25 | size_t size, | ||
26 | enum dma_data_direction direction); | ||
27 | int (*map_sg)(struct device *dev, struct scatterlist *sg, int nents, | ||
28 | enum dma_data_direction direction); | ||
29 | void (*unmap_sg)(struct device *dev, struct scatterlist *sg, | ||
30 | int nhwentries, | ||
31 | enum dma_data_direction direction); | ||
32 | void (*sync_single_for_cpu)(struct device *dev, | ||
33 | dma_addr_t dma_handle, size_t size, | ||
34 | enum dma_data_direction direction); | ||
35 | void (*sync_single_for_device)(struct device *dev, | ||
36 | dma_addr_t dma_handle, size_t size, | ||
37 | enum dma_data_direction direction); | ||
38 | void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg, | ||
39 | int nelems, | ||
40 | enum dma_data_direction direction); | ||
41 | void (*sync_sg_for_device)(struct device *dev, | ||
42 | struct scatterlist *sg, int nents, | ||
43 | enum dma_data_direction dir); | ||
44 | }; | ||
45 | extern const struct dma_ops *dma_ops; | ||
46 | 17 | ||
47 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 18 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
48 | dma_addr_t *dma_handle, gfp_t flag) | 19 | dma_addr_t *dma_handle, gfp_t flag) |
@@ -62,40 +33,40 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | |||
62 | { | 33 | { |
63 | return dma_ops->map_page(dev, virt_to_page(cpu_addr), | 34 | return dma_ops->map_page(dev, virt_to_page(cpu_addr), |
64 | (unsigned long)cpu_addr & ~PAGE_MASK, size, | 35 | (unsigned long)cpu_addr & ~PAGE_MASK, size, |
65 | direction); | 36 | direction, NULL); |
66 | } | 37 | } |
67 | 38 | ||
68 | static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, | 39 | static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, |
69 | size_t size, | 40 | size_t size, |
70 | enum dma_data_direction direction) | 41 | enum dma_data_direction direction) |
71 | { | 42 | { |
72 | dma_ops->unmap_page(dev, dma_addr, size, direction); | 43 | dma_ops->unmap_page(dev, dma_addr, size, direction, NULL); |
73 | } | 44 | } |
74 | 45 | ||
75 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | 46 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, |
76 | unsigned long offset, size_t size, | 47 | unsigned long offset, size_t size, |
77 | enum dma_data_direction direction) | 48 | enum dma_data_direction direction) |
78 | { | 49 | { |
79 | return dma_ops->map_page(dev, page, offset, size, direction); | 50 | return dma_ops->map_page(dev, page, offset, size, direction, NULL); |
80 | } | 51 | } |
81 | 52 | ||
82 | static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, | 53 | static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, |
83 | size_t size, | 54 | size_t size, |
84 | enum dma_data_direction direction) | 55 | enum dma_data_direction direction) |
85 | { | 56 | { |
86 | dma_ops->unmap_page(dev, dma_address, size, direction); | 57 | dma_ops->unmap_page(dev, dma_address, size, direction, NULL); |
87 | } | 58 | } |
88 | 59 | ||
89 | static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | 60 | static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, |
90 | int nents, enum dma_data_direction direction) | 61 | int nents, enum dma_data_direction direction) |
91 | { | 62 | { |
92 | return dma_ops->map_sg(dev, sg, nents, direction); | 63 | return dma_ops->map_sg(dev, sg, nents, direction, NULL); |
93 | } | 64 | } |
94 | 65 | ||
95 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | 66 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, |
96 | int nents, enum dma_data_direction direction) | 67 | int nents, enum dma_data_direction direction) |
97 | { | 68 | { |
98 | dma_ops->unmap_sg(dev, sg, nents, direction); | 69 | dma_ops->unmap_sg(dev, sg, nents, direction, NULL); |
99 | } | 70 | } |
100 | 71 | ||
101 | static inline void dma_sync_single_for_cpu(struct device *dev, | 72 | static inline void dma_sync_single_for_cpu(struct device *dev, |