diff options
Diffstat (limited to 'arch/x86/kernel/pci-swiotlb_64.c')
-rw-r--r-- | arch/x86/kernel/pci-swiotlb_64.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c index d59c91747665..d1c0366886dd 100644 --- a/arch/x86/kernel/pci-swiotlb_64.c +++ b/arch/x86/kernel/pci-swiotlb_64.c | |||
@@ -45,6 +45,23 @@ swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size, | |||
45 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); | 45 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); |
46 | } | 46 | } |
47 | 47 | ||
48 | /* these will be moved to lib/swiotlb.c later on */ | ||
49 | |||
50 | static dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | ||
51 | unsigned long offset, size_t size, | ||
52 | enum dma_data_direction dir, | ||
53 | struct dma_attrs *attrs) | ||
54 | { | ||
55 | return swiotlb_map_single(dev, page_address(page) + offset, size, dir); | ||
56 | } | ||
57 | |||
58 | static void swiotlb_unmap_page(struct device *dev, dma_addr_t dma_handle, | ||
59 | size_t size, enum dma_data_direction dir, | ||
60 | struct dma_attrs *attrs) | ||
61 | { | ||
62 | swiotlb_unmap_single(dev, dma_handle, size, dir); | ||
63 | } | ||
64 | |||
48 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 65 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
49 | dma_addr_t *dma_handle, gfp_t flags) | 66 | dma_addr_t *dma_handle, gfp_t flags) |
50 | { | 67 | { |
@@ -71,6 +88,8 @@ struct dma_mapping_ops swiotlb_dma_ops = { | |||
71 | .sync_sg_for_device = swiotlb_sync_sg_for_device, | 88 | .sync_sg_for_device = swiotlb_sync_sg_for_device, |
72 | .map_sg = swiotlb_map_sg, | 89 | .map_sg = swiotlb_map_sg, |
73 | .unmap_sg = swiotlb_unmap_sg, | 90 | .unmap_sg = swiotlb_unmap_sg, |
91 | .map_page = swiotlb_map_page, | ||
92 | .unmap_page = swiotlb_unmap_page, | ||
74 | .dma_supported = NULL, | 93 | .dma_supported = NULL, |
75 | }; | 94 | }; |
76 | 95 | ||