diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-02 21:36:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-02 21:36:15 -0500 |
commit | 3a7142371efdc95f4c5b5ffc188b18efdc4e64dd (patch) | |
tree | 29f2fbc9b0932ebeeb85dad6b309c1a22f9b1026 /include | |
parent | ec1890c5df451799dec969a3581ff72e1934b5ee (diff) | |
parent | c7fb577e2a6cb04732541f2dc402bd46747f7558 (diff) |
Merge branch 'swiotlb' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86_64/dma-mapping.h | 31 | ||||
-rw-r--r-- | include/asm-x86_64/swiotlb.h | 8 |
2 files changed, 35 insertions, 4 deletions
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h index 54a380efed41..36d16dfbac88 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86_64/dma-mapping.h | |||
@@ -85,10 +85,33 @@ static inline void dma_sync_single_for_device(struct device *hwdev, | |||
85 | flush_write_buffers(); | 85 | flush_write_buffers(); |
86 | } | 86 | } |
87 | 87 | ||
88 | #define dma_sync_single_range_for_cpu(dev, dma_handle, offset, size, dir) \ | 88 | static inline void dma_sync_single_range_for_cpu(struct device *hwdev, |
89 | dma_sync_single_for_cpu(dev, dma_handle, size, dir) | 89 | dma_addr_t dma_handle, |
90 | #define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir) \ | 90 | unsigned long offset, |
91 | dma_sync_single_for_device(dev, dma_handle, size, dir) | 91 | size_t size, int direction) |
92 | { | ||
93 | if (direction == DMA_NONE) | ||
94 | out_of_line_bug(); | ||
95 | |||
96 | if (swiotlb) | ||
97 | return swiotlb_sync_single_range_for_cpu(hwdev,dma_handle,offset,size,direction); | ||
98 | |||
99 | flush_write_buffers(); | ||
100 | } | ||
101 | |||
102 | static inline void dma_sync_single_range_for_device(struct device *hwdev, | ||
103 | dma_addr_t dma_handle, | ||
104 | unsigned long offset, | ||
105 | size_t size, int direction) | ||
106 | { | ||
107 | if (direction == DMA_NONE) | ||
108 | out_of_line_bug(); | ||
109 | |||
110 | if (swiotlb) | ||
111 | return swiotlb_sync_single_range_for_device(hwdev,dma_handle,offset,size,direction); | ||
112 | |||
113 | flush_write_buffers(); | ||
114 | } | ||
92 | 115 | ||
93 | static inline void dma_sync_sg_for_cpu(struct device *hwdev, | 116 | static inline void dma_sync_sg_for_cpu(struct device *hwdev, |
94 | struct scatterlist *sg, | 117 | struct scatterlist *sg, |
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h index 7cbfd10ecc3c..dddf1b218681 100644 --- a/include/asm-x86_64/swiotlb.h +++ b/include/asm-x86_64/swiotlb.h | |||
@@ -15,6 +15,14 @@ extern void swiotlb_sync_single_for_cpu(struct device *hwdev, | |||
15 | extern void swiotlb_sync_single_for_device(struct device *hwdev, | 15 | extern void swiotlb_sync_single_for_device(struct device *hwdev, |
16 | dma_addr_t dev_addr, | 16 | dma_addr_t dev_addr, |
17 | size_t size, int dir); | 17 | size_t size, int dir); |
18 | extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev, | ||
19 | dma_addr_t dev_addr, | ||
20 | unsigned long offset, | ||
21 | size_t size, int dir); | ||
22 | extern void swiotlb_sync_single_range_for_device(struct device *hwdev, | ||
23 | dma_addr_t dev_addr, | ||
24 | unsigned long offset, | ||
25 | size_t size, int dir); | ||
18 | extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, | 26 | extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, |
19 | struct scatterlist *sg, int nelems, | 27 | struct scatterlist *sg, int nelems, |
20 | int dir); | 28 | int dir); |