IA64: fix compile error on IA64_DIG_VTD
[safe/jmp/linux-2.6] / arch / ia64 / kernel / pci-swiotlb.c
1 /* Glue code to lib/swiotlb.c */
2
3 #include <linux/pci.h>
4 #include <linux/cache.h>
5 #include <linux/module.h>
6 #include <linux/dma-mapping.h>
7
8 #include <asm/swiotlb.h>
9 #include <asm/dma.h>
10 #include <asm/iommu.h>
11 #include <asm/machvec.h>
12
13 int swiotlb __read_mostly;
14 EXPORT_SYMBOL(swiotlb);
15
16 struct dma_map_ops swiotlb_dma_ops = {
17         .alloc_coherent = swiotlb_alloc_coherent,
18         .free_coherent = swiotlb_free_coherent,
19         .map_page = swiotlb_map_page,
20         .unmap_page = swiotlb_unmap_page,
21         .map_sg = swiotlb_map_sg_attrs,
22         .unmap_sg = swiotlb_unmap_sg_attrs,
23         .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
24         .sync_single_for_device = swiotlb_sync_single_for_device,
25         .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
26         .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
27         .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
28         .sync_sg_for_device = swiotlb_sync_sg_for_device,
29         .dma_supported = swiotlb_dma_supported,
30         .mapping_error = swiotlb_dma_mapping_error,
31 };
32
33 void __init swiotlb_dma_init(void)
34 {
35         dma_ops = &swiotlb_dma_ops;
36         swiotlb_init();
37 }
38
39 void __init pci_swiotlb_init(void)
40 {
41         if (!iommu_detected) {
42 #ifdef CONFIG_IA64_GENERIC
43                 swiotlb = 1;
44                 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
45                 machvec_init("dig");
46                 swiotlb_init();
47                 dma_ops = &swiotlb_dma_ops;
48 #else
49                 panic("Unable to find Intel IOMMU");
50 #endif
51         }
52 }