aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/pci-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r--arch/x86/kernel/pci-dma.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 192624820217..00e07447a5bd 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -105,11 +105,15 @@ static void __init dma32_free_bootmem(void)
105 dma32_bootmem_ptr = NULL; 105 dma32_bootmem_ptr = NULL;
106 dma32_bootmem_size = 0; 106 dma32_bootmem_size = 0;
107} 107}
108#endif
108 109
109void __init pci_iommu_alloc(void) 110void __init pci_iommu_alloc(void)
110{ 111{
112#ifdef CONFIG_X86_64
111 /* free the range so iommu could get some range less than 4G */ 113 /* free the range so iommu could get some range less than 4G */
112 dma32_free_bootmem(); 114 dma32_free_bootmem();
115#endif
116
113 /* 117 /*
114 * The order of these functions is important for 118 * The order of these functions is important for
115 * fall-back/fail-over reasons 119 * fall-back/fail-over reasons
@@ -125,15 +129,6 @@ void __init pci_iommu_alloc(void)
125 pci_swiotlb_init(); 129 pci_swiotlb_init();
126} 130}
127 131
128unsigned long iommu_nr_pages(unsigned long addr, unsigned long len)
129{
130 unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
131
132 return size >> PAGE_SHIFT;
133}
134EXPORT_SYMBOL(iommu_nr_pages);
135#endif
136
137void *dma_generic_alloc_coherent(struct device *dev, size_t size, 132void *dma_generic_alloc_coherent(struct device *dev, size_t size,
138 dma_addr_t *dma_addr, gfp_t flag) 133 dma_addr_t *dma_addr, gfp_t flag)
139{ 134{