diff options
Diffstat (limited to 'arch/sparc/include/asm/dma-mapping.h')
-rw-r--r-- | arch/sparc/include/asm/dma-mapping.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 0f4150e26619..8c911ea9ee5f 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h | |||
@@ -5,4 +5,46 @@ | |||
5 | #else | 5 | #else |
6 | #include <asm/dma-mapping_32.h> | 6 | #include <asm/dma-mapping_32.h> |
7 | #endif | 7 | #endif |
8 | |||
9 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) | ||
10 | |||
11 | extern int dma_supported(struct device *dev, u64 mask); | ||
12 | extern int dma_set_mask(struct device *dev, u64 dma_mask); | ||
13 | |||
14 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
15 | { | ||
16 | return (dma_addr == DMA_ERROR_CODE); | ||
17 | } | ||
18 | |||
19 | static inline int dma_get_cache_alignment(void) | ||
20 | { | ||
21 | /* | ||
22 | * no easy way to get cache size on all processors, so return | ||
23 | * the maximum possible, to be safe | ||
24 | */ | ||
25 | return (1 << INTERNODE_CACHE_SHIFT); | ||
26 | } | ||
27 | |||
28 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
29 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
30 | #define dma_is_consistent(d, h) (1) | ||
31 | |||
32 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
33 | dma_addr_t dma_handle, | ||
34 | unsigned long offset, | ||
35 | size_t size, | ||
36 | enum dma_data_direction dir) | ||
37 | { | ||
38 | dma_sync_single_for_cpu(dev, dma_handle+offset, size, dir); | ||
39 | } | ||
40 | |||
41 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
42 | dma_addr_t dma_handle, | ||
43 | unsigned long offset, | ||
44 | size_t size, | ||
45 | enum dma_data_direction dir) | ||
46 | { | ||
47 | dma_sync_single_for_device(dev, dma_handle+offset, size, dir); | ||
48 | } | ||
49 | |||
8 | #endif | 50 | #endif |