~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/ia64/kernel/pci-swiotlb.c

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* Glue code to lib/swiotlb.c */
  2 
  3 #include <linux/pci.h>
  4 #include <linux/gfp.h>
  5 #include <linux/cache.h>
  6 #include <linux/module.h>
  7 #include <linux/dma-mapping.h>
  8 
  9 #include <asm/swiotlb.h>
 10 #include <asm/dma.h>
 11 #include <asm/iommu.h>
 12 #include <asm/machvec.h>
 13 
 14 int swiotlb __read_mostly;
 15 EXPORT_SYMBOL(swiotlb);
 16 
 17 static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size,
 18                                          dma_addr_t *dma_handle, gfp_t gfp,
 19                                          unsigned long attrs)
 20 {
 21         if (dev->coherent_dma_mask != DMA_BIT_MASK(64))
 22                 gfp |= GFP_DMA;
 23         return swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
 24 }
 25 
 26 static void ia64_swiotlb_free_coherent(struct device *dev, size_t size,
 27                                        void *vaddr, dma_addr_t dma_addr,
 28                                        unsigned long attrs)
 29 {
 30         swiotlb_free_coherent(dev, size, vaddr, dma_addr);
 31 }
 32 
 33 struct dma_map_ops swiotlb_dma_ops = {
 34         .alloc = ia64_swiotlb_alloc_coherent,
 35         .free = ia64_swiotlb_free_coherent,
 36         .map_page = swiotlb_map_page,
 37         .unmap_page = swiotlb_unmap_page,
 38         .map_sg = swiotlb_map_sg_attrs,
 39         .unmap_sg = swiotlb_unmap_sg_attrs,
 40         .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
 41         .sync_single_for_device = swiotlb_sync_single_for_device,
 42         .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
 43         .sync_sg_for_device = swiotlb_sync_sg_for_device,
 44         .dma_supported = swiotlb_dma_supported,
 45         .mapping_error = swiotlb_dma_mapping_error,
 46 };
 47 
 48 void __init swiotlb_dma_init(void)
 49 {
 50         dma_ops = &swiotlb_dma_ops;
 51         swiotlb_init(1);
 52 }
 53 
 54 void __init pci_swiotlb_init(void)
 55 {
 56         if (!iommu_detected) {
 57 #ifdef CONFIG_IA64_GENERIC
 58                 swiotlb = 1;
 59                 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
 60                 machvec_init("dig");
 61                 swiotlb_init(1);
 62                 dma_ops = &swiotlb_dma_ops;
 63 #else
 64                 panic("Unable to find Intel IOMMU");
 65 #endif
 66         }
 67 }
 68 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp