1 /* Glue code to lib/swiotlb.c */
4 #include <linux/cache.h>
5 #include <linux/module.h>
6 #include <linux/dma-mapping.h>
8 #include <asm/swiotlb.h>
10 #include <asm/iommu.h>
11 #include <asm/machvec.h>
13 int swiotlb __read_mostly;
14 EXPORT_SYMBOL(swiotlb);
16 struct dma_mapping_ops swiotlb_dma_ops = {
17 .mapping_error = swiotlb_dma_mapping_error,
18 .alloc_coherent = swiotlb_alloc_coherent,
19 .free_coherent = swiotlb_free_coherent,
20 .map_single = swiotlb_map_single,
21 .unmap_single = swiotlb_unmap_single,
22 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
23 .sync_single_for_device = swiotlb_sync_single_for_device,
24 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
25 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
26 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
27 .sync_sg_for_device = swiotlb_sync_sg_for_device,
28 .map_sg = swiotlb_map_sg,
29 .unmap_sg = swiotlb_unmap_sg,
30 .dma_supported_op = swiotlb_dma_supported,
33 void __init pci_swiotlb_init(void)
35 if (!iommu_detected) {
36 #ifdef CONFIG_IA64_GENERIC
38 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
41 dma_ops = &swiotlb_dma_ops;
43 panic("Unable to find Intel IOMMU");