direct-io.hg

view linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c @ 9642:f4285d150d3a

Must use __copy_to_user_inatomic() in swiotlb's sync_single()
function, as we cannot sleep there.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 14 11:58:11 2006 +0100 (2006-04-14)
parents b765c96f8127
children 48c0f5489d44
line source
1 /*
2 * Dynamic DMA mapping support.
3 *
4 * This implementation is a fallback for platforms that do not support
5 * I/O TLBs (aka DMA address translation hardware).
6 * Copyright (C) 2000 Asit Mallick <Asit.K.Mallick@intel.com>
7 * Copyright (C) 2000 Goutham Rao <goutham.rao@intel.com>
8 * Copyright (C) 2000, 2003 Hewlett-Packard Co
9 * David Mosberger-Tang <davidm@hpl.hp.com>
10 * Copyright (C) 2005 Keir Fraser <keir@xensource.com>
11 */
13 #include <linux/cache.h>
14 #include <linux/mm.h>
15 #include <linux/module.h>
16 #include <linux/pci.h>
17 #include <linux/spinlock.h>
18 #include <linux/string.h>
19 #include <linux/types.h>
20 #include <linux/ctype.h>
21 #include <linux/init.h>
22 #include <linux/bootmem.h>
23 #include <linux/highmem.h>
24 #include <asm/io.h>
25 #include <asm/pci.h>
26 #include <asm/dma.h>
27 #include <asm/uaccess.h>
28 #include <xen/interface/memory.h>
30 int swiotlb;
31 EXPORT_SYMBOL(swiotlb);
33 #define OFFSET(val,align) ((unsigned long)((val) & ( (align) - 1)))
35 #define SG_ENT_PHYS_ADDRESS(sg) (page_to_bus((sg)->page) + (sg)->offset)
37 /*
38 * Maximum allowable number of contiguous slabs to map,
39 * must be a power of 2. What is the appropriate value ?
40 * The complexity of {map,unmap}_single is linearly dependent on this value.
41 */
42 #define IO_TLB_SEGSIZE 128
44 /*
45 * log of the size of each IO TLB slab. The number of slabs is command line
46 * controllable.
47 */
48 #define IO_TLB_SHIFT 11
50 static int swiotlb_force;
51 static char *iotlb_virt_start;
52 static unsigned long iotlb_nslabs;
54 /*
55 * Used to do a quick range check in swiotlb_unmap_single and
56 * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
57 * API.
58 */
59 static dma_addr_t iotlb_bus_start, iotlb_bus_end, iotlb_bus_mask;
61 /* Does the given dma address reside within the swiotlb aperture? */
62 #define in_swiotlb_aperture(a) (!(((a) ^ iotlb_bus_start) & iotlb_bus_mask))
64 /*
65 * When the IOMMU overflows we return a fallback buffer. This sets the size.
66 */
67 static unsigned long io_tlb_overflow = 32*1024;
69 void *io_tlb_overflow_buffer;
71 /*
72 * This is a free list describing the number of free entries available from
73 * each index
74 */
75 static unsigned int *io_tlb_list;
76 static unsigned int io_tlb_index;
78 /*
79 * We need to save away the original address corresponding to a mapped entry
80 * for the sync operations.
81 */
82 static struct phys_addr {
83 struct page *page;
84 unsigned int offset;
85 } *io_tlb_orig_addr;
87 /*
88 * Protect the above data structures in the map and unmap calls
89 */
90 static DEFINE_SPINLOCK(io_tlb_lock);
92 static int __init
93 setup_io_tlb_npages(char *str)
94 {
95 /* Unlike ia64, the size is aperture in megabytes, not 'slabs'! */
96 if (isdigit(*str)) {
97 iotlb_nslabs = simple_strtoul(str, &str, 0) <<
98 (20 - IO_TLB_SHIFT);
99 iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
100 /* Round up to power of two (xen_create_contiguous_region). */
101 while (iotlb_nslabs & (iotlb_nslabs-1))
102 iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
103 }
104 if (*str == ',')
105 ++str;
106 /*
107 * NB. 'force' enables the swiotlb, but doesn't force its use for
108 * every DMA like it does on native Linux. 'off' forcibly disables
109 * use of the swiotlb.
110 */
111 if (!strcmp(str, "force"))
112 swiotlb_force = 1;
113 else if (!strcmp(str, "off"))
114 swiotlb_force = -1;
115 return 1;
116 }
117 __setup("swiotlb=", setup_io_tlb_npages);
118 /* make io_tlb_overflow tunable too? */
120 /*
121 * Statically reserve bounce buffer space and initialize bounce buffer data
122 * structures for the software IO TLB used to implement the PCI DMA API.
123 */
124 void
125 swiotlb_init_with_default_size (size_t default_size)
126 {
127 unsigned long i, bytes;
128 int rc;
130 if (!iotlb_nslabs) {
131 iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
132 iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
133 /* Round up to power of two (xen_create_contiguous_region). */
134 while (iotlb_nslabs & (iotlb_nslabs-1))
135 iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
136 }
138 bytes = iotlb_nslabs * (1UL << IO_TLB_SHIFT);
140 /*
141 * Get IO TLB memory from the low pages
142 */
143 iotlb_virt_start = alloc_bootmem_low_pages(bytes);
144 if (!iotlb_virt_start)
145 panic("Cannot allocate SWIOTLB buffer!\n"
146 "Use dom0_mem Xen boot parameter to reserve\n"
147 "some DMA memory (e.g., dom0_mem=-128M).\n");
149 /* Hardcode 31 address bits for now: aacraid limitation. */
150 rc = xen_create_contiguous_region(
151 (unsigned long)iotlb_virt_start, get_order(bytes), 31);
152 BUG_ON(rc);
154 /*
155 * Allocate and initialize the free list array. This array is used
156 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE.
157 */
158 io_tlb_list = alloc_bootmem(iotlb_nslabs * sizeof(int));
159 for (i = 0; i < iotlb_nslabs; i++)
160 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
161 io_tlb_index = 0;
162 io_tlb_orig_addr = alloc_bootmem(
163 iotlb_nslabs * sizeof(*io_tlb_orig_addr));
165 /*
166 * Get the overflow emergency buffer
167 */
168 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
170 iotlb_bus_start = virt_to_bus(iotlb_virt_start);
171 iotlb_bus_end = iotlb_bus_start + bytes;
172 iotlb_bus_mask = ~(dma_addr_t)(bytes - 1);
174 printk(KERN_INFO "Software IO TLB enabled: \n"
175 " Aperture: %lu megabytes\n"
176 " Bus range: 0x%016lx - 0x%016lx\n"
177 " Kernel range: 0x%016lx - 0x%016lx\n",
178 bytes >> 20,
179 (unsigned long)iotlb_bus_start,
180 (unsigned long)iotlb_bus_end,
181 (unsigned long)iotlb_virt_start,
182 (unsigned long)iotlb_virt_start + bytes);
183 }
185 void
186 swiotlb_init(void)
187 {
188 long ram_end;
189 size_t defsz = 64 * (1 << 20); /* 64MB default size */
191 if (swiotlb_force == 1) {
192 swiotlb = 1;
193 } else if ((swiotlb_force != -1) &&
194 (xen_start_info->flags & SIF_INITDOMAIN)) {
195 /* Domain 0 always has a swiotlb. */
196 ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
197 if (ram_end <= 0x7ffff)
198 defsz = 2 * (1 << 20); /* 2MB on <2GB on systems. */
199 swiotlb = 1;
200 }
202 if (swiotlb)
203 swiotlb_init_with_default_size(defsz);
204 else
205 printk(KERN_INFO "Software IO TLB disabled\n");
206 }
208 /*
209 * We use __copy_to_user_inatomic to transfer to the host buffer because the
210 * buffer may be mapped read-only (e.g, in blkback driver) but lower-level
211 * drivers map the buffer for DMA_BIDIRECTIONAL access. This causes an
212 * unnecessary copy from the aperture to the host buffer, and a page fault.
213 */
214 static void
215 __sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir)
216 {
217 if (PageHighMem(buffer.page)) {
218 size_t len, bytes;
219 char *dev, *host, *kmp;
220 len = size;
221 while (len != 0) {
222 if (((bytes = len) + buffer.offset) > PAGE_SIZE)
223 bytes = PAGE_SIZE - buffer.offset;
224 kmp = kmap_atomic(buffer.page, KM_SWIOTLB);
225 dev = dma_addr + size - len;
226 host = kmp + buffer.offset;
227 if (dir == DMA_FROM_DEVICE) {
228 if (__copy_to_user_inatomic(host, dev, bytes))
229 /* inaccessible */;
230 } else
231 memcpy(dev, host, bytes);
232 kunmap_atomic(kmp, KM_SWIOTLB);
233 len -= bytes;
234 buffer.page++;
235 buffer.offset = 0;
236 }
237 } else {
238 char *host = (char *)phys_to_virt(
239 page_to_pseudophys(buffer.page)) + buffer.offset;
240 if (dir == DMA_FROM_DEVICE) {
241 if (__copy_to_user_inatomic(host, dma_addr, size))
242 /* inaccessible */;
243 } else if (dir == DMA_TO_DEVICE)
244 memcpy(dma_addr, host, size);
245 }
246 }
248 /*
249 * Allocates bounce buffer and returns its kernel virtual address.
250 */
251 static void *
252 map_single(struct device *hwdev, struct phys_addr buffer, size_t size, int dir)
253 {
254 unsigned long flags;
255 char *dma_addr;
256 unsigned int nslots, stride, index, wrap;
257 int i;
259 /*
260 * For mappings greater than a page, we limit the stride (and
261 * hence alignment) to a page size.
262 */
263 nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
264 if (size > PAGE_SIZE)
265 stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
266 else
267 stride = 1;
269 BUG_ON(!nslots);
271 /*
272 * Find suitable number of IO TLB entries size that will fit this
273 * request and allocate a buffer from that IO TLB pool.
274 */
275 spin_lock_irqsave(&io_tlb_lock, flags);
276 {
277 wrap = index = ALIGN(io_tlb_index, stride);
279 if (index >= iotlb_nslabs)
280 wrap = index = 0;
282 do {
283 /*
284 * If we find a slot that indicates we have 'nslots'
285 * number of contiguous buffers, we allocate the
286 * buffers from that slot and mark the entries as '0'
287 * indicating unavailable.
288 */
289 if (io_tlb_list[index] >= nslots) {
290 int count = 0;
292 for (i = index; i < (int)(index + nslots); i++)
293 io_tlb_list[i] = 0;
294 for (i = index - 1;
295 (OFFSET(i, IO_TLB_SEGSIZE) !=
296 IO_TLB_SEGSIZE -1) && io_tlb_list[i];
297 i--)
298 io_tlb_list[i] = ++count;
299 dma_addr = iotlb_virt_start +
300 (index << IO_TLB_SHIFT);
302 /*
303 * Update the indices to avoid searching in
304 * the next round.
305 */
306 io_tlb_index =
307 ((index + nslots) < iotlb_nslabs
308 ? (index + nslots) : 0);
310 goto found;
311 }
312 index += stride;
313 if (index >= iotlb_nslabs)
314 index = 0;
315 } while (index != wrap);
317 spin_unlock_irqrestore(&io_tlb_lock, flags);
318 return NULL;
319 }
320 found:
321 spin_unlock_irqrestore(&io_tlb_lock, flags);
323 /*
324 * Save away the mapping from the original address to the DMA address.
325 * This is needed when we sync the memory. Then we sync the buffer if
326 * needed.
327 */
328 io_tlb_orig_addr[index] = buffer;
329 if ((dir == DMA_TO_DEVICE) || (dir == DMA_BIDIRECTIONAL))
330 __sync_single(buffer, dma_addr, size, DMA_TO_DEVICE);
332 return dma_addr;
333 }
335 /*
336 * dma_addr is the kernel virtual address of the bounce buffer to unmap.
337 */
338 static void
339 unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
340 {
341 unsigned long flags;
342 int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
343 int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
344 struct phys_addr buffer = io_tlb_orig_addr[index];
346 /*
347 * First, sync the memory before unmapping the entry
348 */
349 if ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))
350 __sync_single(buffer, dma_addr, size, DMA_FROM_DEVICE);
352 /*
353 * Return the buffer to the free list by setting the corresponding
354 * entries to indicate the number of contigous entries available.
355 * While returning the entries to the free list, we merge the entries
356 * with slots below and above the pool being returned.
357 */
358 spin_lock_irqsave(&io_tlb_lock, flags);
359 {
360 count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ?
361 io_tlb_list[index + nslots] : 0);
362 /*
363 * Step 1: return the slots to the free list, merging the
364 * slots with superceeding slots
365 */
366 for (i = index + nslots - 1; i >= index; i--)
367 io_tlb_list[i] = ++count;
368 /*
369 * Step 2: merge the returned slots with the preceding slots,
370 * if available (non zero)
371 */
372 for (i = index - 1;
373 (OFFSET(i, IO_TLB_SEGSIZE) !=
374 IO_TLB_SEGSIZE -1) && io_tlb_list[i];
375 i--)
376 io_tlb_list[i] = ++count;
377 }
378 spin_unlock_irqrestore(&io_tlb_lock, flags);
379 }
381 static void
382 sync_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
383 {
384 int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
385 struct phys_addr buffer = io_tlb_orig_addr[index];
386 BUG_ON((dir != DMA_FROM_DEVICE) && (dir != DMA_TO_DEVICE));
387 __sync_single(buffer, dma_addr, size, dir);
388 }
390 static void
391 swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
392 {
393 /*
394 * Ran out of IOMMU space for this operation. This is very bad.
395 * Unfortunately the drivers cannot handle this operation properly.
396 * unless they check for pci_dma_mapping_error (most don't)
397 * When the mapping is small enough return a static buffer to limit
398 * the damage, or panic when the transfer is too big.
399 */
400 printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
401 "device %s\n", (unsigned long)size, dev ? dev->bus_id : "?");
403 if (size > io_tlb_overflow && do_panic) {
404 if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
405 panic("PCI-DMA: Memory would be corrupted\n");
406 if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL)
407 panic("PCI-DMA: Random memory would be DMAed\n");
408 }
409 }
411 /*
412 * Map a single buffer of the indicated size for DMA in streaming mode. The
413 * PCI address to use is returned.
414 *
415 * Once the device is given the dma address, the device owns this memory until
416 * either swiotlb_unmap_single or swiotlb_dma_sync_single is performed.
417 */
418 dma_addr_t
419 swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
420 {
421 dma_addr_t dev_addr = virt_to_bus(ptr);
422 void *map;
423 struct phys_addr buffer;
425 BUG_ON(dir == DMA_NONE);
427 /*
428 * If the pointer passed in happens to be in the device's DMA window,
429 * we can safely return the device addr and not worry about bounce
430 * buffering it.
431 */
432 if (!range_straddles_page_boundary(ptr, size) &&
433 !address_needs_mapping(hwdev, dev_addr))
434 return dev_addr;
436 /*
437 * Oh well, have to allocate and map a bounce buffer.
438 */
439 buffer.page = virt_to_page(ptr);
440 buffer.offset = (unsigned long)ptr & ~PAGE_MASK;
441 map = map_single(hwdev, buffer, size, dir);
442 if (!map) {
443 swiotlb_full(hwdev, size, dir, 1);
444 map = io_tlb_overflow_buffer;
445 }
447 dev_addr = virt_to_bus(map);
448 return dev_addr;
449 }
451 /*
452 * Unmap a single streaming mode DMA translation. The dma_addr and size must
453 * match what was provided for in a previous swiotlb_map_single call. All
454 * other usages are undefined.
455 *
456 * After this call, reads by the cpu to the buffer are guaranteed to see
457 * whatever the device wrote there.
458 */
459 void
460 swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size,
461 int dir)
462 {
463 BUG_ON(dir == DMA_NONE);
464 if (in_swiotlb_aperture(dev_addr))
465 unmap_single(hwdev, bus_to_virt(dev_addr), size, dir);
466 }
468 /*
469 * Make physical memory consistent for a single streaming mode DMA translation
470 * after a transfer.
471 *
472 * If you perform a swiotlb_map_single() but wish to interrogate the buffer
473 * using the cpu, yet do not wish to teardown the PCI dma mapping, you must
474 * call this function before doing so. At the next point you give the PCI dma
475 * address back to the card, you must first perform a
476 * swiotlb_dma_sync_for_device, and then the device again owns the buffer
477 */
478 void
479 swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
480 size_t size, int dir)
481 {
482 BUG_ON(dir == DMA_NONE);
483 if (in_swiotlb_aperture(dev_addr))
484 sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
485 }
487 void
488 swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
489 size_t size, int dir)
490 {
491 BUG_ON(dir == DMA_NONE);
492 if (in_swiotlb_aperture(dev_addr))
493 sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
494 }
496 /*
497 * Map a set of buffers described by scatterlist in streaming mode for DMA.
498 * This is the scatter-gather version of the above swiotlb_map_single
499 * interface. Here the scatter gather list elements are each tagged with the
500 * appropriate dma address and length. They are obtained via
501 * sg_dma_{address,length}(SG).
502 *
503 * NOTE: An implementation may be able to use a smaller number of
504 * DMA address/length pairs than there are SG table elements.
505 * (for example via virtual mapping capabilities)
506 * The routine returns the number of addr/length pairs actually
507 * used, at most nents.
508 *
509 * Device ownership issues as mentioned above for swiotlb_map_single are the
510 * same here.
511 */
512 int
513 swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
514 int dir)
515 {
516 struct phys_addr buffer;
517 dma_addr_t dev_addr;
518 char *map;
519 int i;
521 BUG_ON(dir == DMA_NONE);
523 for (i = 0; i < nelems; i++, sg++) {
524 dev_addr = SG_ENT_PHYS_ADDRESS(sg);
525 if (address_needs_mapping(hwdev, dev_addr)) {
526 buffer.page = sg->page;
527 buffer.offset = sg->offset;
528 map = map_single(hwdev, buffer, sg->length, dir);
529 if (!map) {
530 /* Don't panic here, we expect map_sg users
531 to do proper error handling. */
532 swiotlb_full(hwdev, sg->length, dir, 0);
533 swiotlb_unmap_sg(hwdev, sg - i, i, dir);
534 sg[0].dma_length = 0;
535 return 0;
536 }
537 sg->dma_address = (dma_addr_t)virt_to_bus(map);
538 } else
539 sg->dma_address = dev_addr;
540 sg->dma_length = sg->length;
541 }
542 return nelems;
543 }
545 /*
546 * Unmap a set of streaming mode DMA translations. Again, cpu read rules
547 * concerning calls here are the same as for swiotlb_unmap_single() above.
548 */
549 void
550 swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
551 int dir)
552 {
553 int i;
555 BUG_ON(dir == DMA_NONE);
557 for (i = 0; i < nelems; i++, sg++)
558 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
559 unmap_single(hwdev,
560 (void *)bus_to_virt(sg->dma_address),
561 sg->dma_length, dir);
562 }
564 /*
565 * Make physical memory consistent for a set of streaming mode DMA translations
566 * after a transfer.
567 *
568 * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules
569 * and usage.
570 */
571 void
572 swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
573 int nelems, int dir)
574 {
575 int i;
577 BUG_ON(dir == DMA_NONE);
579 for (i = 0; i < nelems; i++, sg++)
580 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
581 sync_single(hwdev,
582 (void *)bus_to_virt(sg->dma_address),
583 sg->dma_length, dir);
584 }
586 void
587 swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
588 int nelems, int dir)
589 {
590 int i;
592 BUG_ON(dir == DMA_NONE);
594 for (i = 0; i < nelems; i++, sg++)
595 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
596 sync_single(hwdev,
597 (void *)bus_to_virt(sg->dma_address),
598 sg->dma_length, dir);
599 }
601 dma_addr_t
602 swiotlb_map_page(struct device *hwdev, struct page *page,
603 unsigned long offset, size_t size,
604 enum dma_data_direction direction)
605 {
606 struct phys_addr buffer;
607 dma_addr_t dev_addr;
608 char *map;
610 dev_addr = page_to_bus(page) + offset;
611 if (address_needs_mapping(hwdev, dev_addr)) {
612 buffer.page = page;
613 buffer.offset = offset;
614 map = map_single(hwdev, buffer, size, direction);
615 if (!map) {
616 swiotlb_full(hwdev, size, direction, 1);
617 map = io_tlb_overflow_buffer;
618 }
619 dev_addr = (dma_addr_t)virt_to_bus(map);
620 }
622 return dev_addr;
623 }
625 void
626 swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address,
627 size_t size, enum dma_data_direction direction)
628 {
629 BUG_ON(direction == DMA_NONE);
630 if (in_swiotlb_aperture(dma_address))
631 unmap_single(hwdev, bus_to_virt(dma_address), size, direction);
632 }
634 int
635 swiotlb_dma_mapping_error(dma_addr_t dma_addr)
636 {
637 return (dma_addr == virt_to_bus(io_tlb_overflow_buffer));
638 }
640 /*
641 * Return whether the given PCI device DMA address mask can be supported
642 * properly. For example, if your device can only drive the low 24-bits
643 * during PCI bus mastering, then you would pass 0x00ffffff as the mask to
644 * this function.
645 */
646 int
647 swiotlb_dma_supported (struct device *hwdev, u64 mask)
648 {
649 return (mask >= (iotlb_bus_end - 1));
650 }
652 EXPORT_SYMBOL(swiotlb_init);
653 EXPORT_SYMBOL(swiotlb_map_single);
654 EXPORT_SYMBOL(swiotlb_unmap_single);
655 EXPORT_SYMBOL(swiotlb_map_sg);
656 EXPORT_SYMBOL(swiotlb_unmap_sg);
657 EXPORT_SYMBOL(swiotlb_sync_single_for_cpu);
658 EXPORT_SYMBOL(swiotlb_sync_single_for_device);
659 EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu);
660 EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
661 EXPORT_SYMBOL(swiotlb_map_page);
662 EXPORT_SYMBOL(swiotlb_unmap_page);
663 EXPORT_SYMBOL(swiotlb_dma_mapping_error);
664 EXPORT_SYMBOL(swiotlb_dma_supported);
666 /*
667 * Local variables:
668 * c-file-style: "linux"
669 * indent-tabs-mode: t
670 * c-indent-level: 8
671 * c-basic-offset: 8
672 * tab-width: 8
673 * End:
674 */