This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / x86_64 / kernel / pci-swiotlb-xen.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 <asm/dma-mapping.h>
7 #include <asm/proto.h>
8 #include <asm/swiotlb.h>
9 #include <asm/dma.h>
10
11 #if 0
12 int swiotlb __read_mostly;
13 EXPORT_SYMBOL(swiotlb);
14 #endif
15
16 struct dma_mapping_ops swiotlb_dma_ops = {
17 #if 0
18         .mapping_error = swiotlb_dma_mapping_error,
19         .alloc_coherent = swiotlb_alloc_coherent,
20         .free_coherent = swiotlb_free_coherent,
21         .map_single = swiotlb_map_single,
22         .unmap_single = swiotlb_unmap_single,
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         .map_sg = swiotlb_map_sg,
30         .unmap_sg = swiotlb_unmap_sg,
31         .dma_supported = NULL,
32 #endif
33 };
34
35 void pci_swiotlb_init(void)
36 {
37 #if 0
38         /* don't initialize swiotlb if iommu=off (no_iommu=1) */
39         if (!iommu_aperture && !no_iommu &&
40             (end_pfn > MAX_DMA32_PFN || force_iommu))
41                swiotlb = 1;
42         if (swiotlb) {
43                 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
44                 swiotlb_init();
45                 dma_ops = &swiotlb_dma_ops;
46         }
47 #else
48         swiotlb_init();
49         if (swiotlb) {
50                 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
51                 dma_ops = &swiotlb_dma_ops;
52         }
53 #endif
54 }