diff options
author | Arthur Kepner <akepner@sgi.com> | 2008-04-29 04:00:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:12 -0400 |
commit | 309df0c503c35fbb5a09537fcbb1f4967b9ca489 (patch) | |
tree | 56a9df627a229bd64b934608b5f84d20bdaabf3a /include/asm-ia64/machvec.h | |
parent | a75b0a2f68d3937f96ed39525e4750601483e3b4 (diff) |
dma/ia64: update ia64 machvecs, swiotlb.c
Change all ia64 machvecs to use the new dma_*map*_attrs() interfaces.
Implement the old dma_*map_*() interfaces in terms of the corresponding new
interfaces. For ia64/sn, make use of one dma attribute,
DMA_ATTR_WRITE_BARRIER. Introduce swiotlb_*map*_attrs() functions.
Signed-off-by: Arthur Kepner <akepner@sgi.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Jes Sorensen <jes@sgi.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: David Miller <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-ia64/machvec.h')
-rw-r--r-- | include/asm-ia64/machvec.h | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index c201a2020aa4..9f020eb825c5 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -22,6 +22,7 @@ struct pci_bus; | |||
22 | struct task_struct; | 22 | struct task_struct; |
23 | struct pci_dev; | 23 | struct pci_dev; |
24 | struct msi_desc; | 24 | struct msi_desc; |
25 | struct dma_attrs; | ||
25 | 26 | ||
26 | typedef void ia64_mv_setup_t (char **); | 27 | typedef void ia64_mv_setup_t (char **); |
27 | typedef void ia64_mv_cpu_init_t (void); | 28 | typedef void ia64_mv_cpu_init_t (void); |
@@ -56,6 +57,11 @@ typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist | |||
56 | typedef int ia64_mv_dma_mapping_error (dma_addr_t dma_addr); | 57 | typedef int ia64_mv_dma_mapping_error (dma_addr_t dma_addr); |
57 | typedef int ia64_mv_dma_supported (struct device *, u64); | 58 | typedef int ia64_mv_dma_supported (struct device *, u64); |
58 | 59 | ||
60 | typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *); | ||
61 | typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *); | ||
62 | typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); | ||
63 | typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); | ||
64 | |||
59 | /* | 65 | /* |
60 | * WARNING: The legacy I/O space is _architected_. Platforms are | 66 | * WARNING: The legacy I/O space is _architected_. Platforms are |
61 | * expected to follow this architected model (see Section 10.7 in the | 67 | * expected to follow this architected model (see Section 10.7 in the |
@@ -136,10 +142,10 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
136 | # define platform_dma_init ia64_mv.dma_init | 142 | # define platform_dma_init ia64_mv.dma_init |
137 | # define platform_dma_alloc_coherent ia64_mv.dma_alloc_coherent | 143 | # define platform_dma_alloc_coherent ia64_mv.dma_alloc_coherent |
138 | # define platform_dma_free_coherent ia64_mv.dma_free_coherent | 144 | # define platform_dma_free_coherent ia64_mv.dma_free_coherent |
139 | # define platform_dma_map_single ia64_mv.dma_map_single | 145 | # define platform_dma_map_single_attrs ia64_mv.dma_map_single_attrs |
140 | # define platform_dma_unmap_single ia64_mv.dma_unmap_single | 146 | # define platform_dma_unmap_single_attrs ia64_mv.dma_unmap_single_attrs |
141 | # define platform_dma_map_sg ia64_mv.dma_map_sg | 147 | # define platform_dma_map_sg_attrs ia64_mv.dma_map_sg_attrs |
142 | # define platform_dma_unmap_sg ia64_mv.dma_unmap_sg | 148 | # define platform_dma_unmap_sg_attrs ia64_mv.dma_unmap_sg_attrs |
143 | # define platform_dma_sync_single_for_cpu ia64_mv.dma_sync_single_for_cpu | 149 | # define platform_dma_sync_single_for_cpu ia64_mv.dma_sync_single_for_cpu |
144 | # define platform_dma_sync_sg_for_cpu ia64_mv.dma_sync_sg_for_cpu | 150 | # define platform_dma_sync_sg_for_cpu ia64_mv.dma_sync_sg_for_cpu |
145 | # define platform_dma_sync_single_for_device ia64_mv.dma_sync_single_for_device | 151 | # define platform_dma_sync_single_for_device ia64_mv.dma_sync_single_for_device |
@@ -190,10 +196,10 @@ struct ia64_machine_vector { | |||
190 | ia64_mv_dma_init *dma_init; | 196 | ia64_mv_dma_init *dma_init; |
191 | ia64_mv_dma_alloc_coherent *dma_alloc_coherent; | 197 | ia64_mv_dma_alloc_coherent *dma_alloc_coherent; |
192 | ia64_mv_dma_free_coherent *dma_free_coherent; | 198 | ia64_mv_dma_free_coherent *dma_free_coherent; |
193 | ia64_mv_dma_map_single *dma_map_single; | 199 | ia64_mv_dma_map_single_attrs *dma_map_single_attrs; |
194 | ia64_mv_dma_unmap_single *dma_unmap_single; | 200 | ia64_mv_dma_unmap_single_attrs *dma_unmap_single_attrs; |
195 | ia64_mv_dma_map_sg *dma_map_sg; | 201 | ia64_mv_dma_map_sg_attrs *dma_map_sg_attrs; |
196 | ia64_mv_dma_unmap_sg *dma_unmap_sg; | 202 | ia64_mv_dma_unmap_sg_attrs *dma_unmap_sg_attrs; |
197 | ia64_mv_dma_sync_single_for_cpu *dma_sync_single_for_cpu; | 203 | ia64_mv_dma_sync_single_for_cpu *dma_sync_single_for_cpu; |
198 | ia64_mv_dma_sync_sg_for_cpu *dma_sync_sg_for_cpu; | 204 | ia64_mv_dma_sync_sg_for_cpu *dma_sync_sg_for_cpu; |
199 | ia64_mv_dma_sync_single_for_device *dma_sync_single_for_device; | 205 | ia64_mv_dma_sync_single_for_device *dma_sync_single_for_device; |
@@ -240,10 +246,10 @@ struct ia64_machine_vector { | |||
240 | platform_dma_init, \ | 246 | platform_dma_init, \ |
241 | platform_dma_alloc_coherent, \ | 247 | platform_dma_alloc_coherent, \ |
242 | platform_dma_free_coherent, \ | 248 | platform_dma_free_coherent, \ |
243 | platform_dma_map_single, \ | 249 | platform_dma_map_single_attrs, \ |
244 | platform_dma_unmap_single, \ | 250 | platform_dma_unmap_single_attrs, \ |
245 | platform_dma_map_sg, \ | 251 | platform_dma_map_sg_attrs, \ |
246 | platform_dma_unmap_sg, \ | 252 | platform_dma_unmap_sg_attrs, \ |
247 | platform_dma_sync_single_for_cpu, \ | 253 | platform_dma_sync_single_for_cpu, \ |
248 | platform_dma_sync_sg_for_cpu, \ | 254 | platform_dma_sync_sg_for_cpu, \ |
249 | platform_dma_sync_single_for_device, \ | 255 | platform_dma_sync_single_for_device, \ |
@@ -292,9 +298,13 @@ extern ia64_mv_dma_init swiotlb_init; | |||
292 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; | 298 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; |
293 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; | 299 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; |
294 | extern ia64_mv_dma_map_single swiotlb_map_single; | 300 | extern ia64_mv_dma_map_single swiotlb_map_single; |
301 | extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs; | ||
295 | extern ia64_mv_dma_unmap_single swiotlb_unmap_single; | 302 | extern ia64_mv_dma_unmap_single swiotlb_unmap_single; |
303 | extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs; | ||
296 | extern ia64_mv_dma_map_sg swiotlb_map_sg; | 304 | extern ia64_mv_dma_map_sg swiotlb_map_sg; |
305 | extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs; | ||
297 | extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg; | 306 | extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg; |
307 | extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs; | ||
298 | extern ia64_mv_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu; | 308 | extern ia64_mv_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu; |
299 | extern ia64_mv_dma_sync_sg_for_cpu swiotlb_sync_sg_for_cpu; | 309 | extern ia64_mv_dma_sync_sg_for_cpu swiotlb_sync_sg_for_cpu; |
300 | extern ia64_mv_dma_sync_single_for_device swiotlb_sync_single_for_device; | 310 | extern ia64_mv_dma_sync_single_for_device swiotlb_sync_single_for_device; |
@@ -340,17 +350,17 @@ extern ia64_mv_dma_supported swiotlb_dma_supported; | |||
340 | #ifndef platform_dma_free_coherent | 350 | #ifndef platform_dma_free_coherent |
341 | # define platform_dma_free_coherent swiotlb_free_coherent | 351 | # define platform_dma_free_coherent swiotlb_free_coherent |
342 | #endif | 352 | #endif |
343 | #ifndef platform_dma_map_single | 353 | #ifndef platform_dma_map_single_attrs |
344 | # define platform_dma_map_single swiotlb_map_single | 354 | # define platform_dma_map_single_attrs swiotlb_map_single_attrs |
345 | #endif | 355 | #endif |
346 | #ifndef platform_dma_unmap_single | 356 | #ifndef platform_dma_unmap_single_attrs |
347 | # define platform_dma_unmap_single swiotlb_unmap_single | 357 | # define platform_dma_unmap_single_attrs swiotlb_unmap_single_attrs |
348 | #endif | 358 | #endif |
349 | #ifndef platform_dma_map_sg | 359 | #ifndef platform_dma_map_sg_attrs |
350 | # define platform_dma_map_sg swiotlb_map_sg | 360 | # define platform_dma_map_sg_attrs swiotlb_map_sg_attrs |
351 | #endif | 361 | #endif |
352 | #ifndef platform_dma_unmap_sg | 362 | #ifndef platform_dma_unmap_sg_attrs |
353 | # define platform_dma_unmap_sg swiotlb_unmap_sg | 363 | # define platform_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs |
354 | #endif | 364 | #endif |
355 | #ifndef platform_dma_sync_single_for_cpu | 365 | #ifndef platform_dma_sync_single_for_cpu |
356 | # define platform_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu | 366 | # define platform_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu |