2.4.36-stable kernel tree
Revision | 478fa857d1b94e9af904ee86be15fe5592c972d6 (tree) |
---|---|
Zeit | 2005-07-01 08:02:16 |
Autor | Andi Kleen <ak@suse...> |
Commiter | Marcelo Tosatti |
[PATCH] x86-64: Fix build with !CONFIG_SWIOTLB
Allow compilation without CONFIG_SWIOTLB
Pointed out by Tymm Twillman. I did the patch slightly differently
than his version.
Signed-off-by: Andi Kleen <ak@suse.de>
@@ -47,6 +47,10 @@ int iommu_fullflush = 1; | ||
47 | 47 | extern int fallback_aper_order; |
48 | 48 | extern int fallback_aper_force; |
49 | 49 | |
50 | +#ifdef CONFIG_SWIOTLB | |
51 | +extern char *io_tlb_start, *io_tlb_end; | |
52 | +#endif | |
53 | + | |
50 | 54 | /* Allocation bitmap for the remapping area */ |
51 | 55 | static spinlock_t iommu_bitmap_lock = SPIN_LOCK_UNLOCKED; |
52 | 56 | static unsigned long *iommu_gart_bitmap; /* guarded by iommu_bitmap_lock */ |
@@ -234,10 +238,10 @@ void pci_free_consistent(struct pci_dev *hwdev, size_t size, | ||
234 | 238 | void *vaddr, dma_addr_t bus) |
235 | 239 | { |
236 | 240 | unsigned long iommu_page; |
237 | - extern char *io_tlb_start, *io_tlb_end; | |
238 | - | |
241 | + | |
239 | 242 | size = round_up(size, PAGE_SIZE); |
240 | 243 | #ifdef CONFIG_SWIOTLB |
244 | + /* Overlap should not happen */ | |
241 | 245 | if (swiotlb && vaddr >= (void *)io_tlb_start && |
242 | 246 | vaddr < (void *)io_tlb_end) { |
243 | 247 | swiotlb_unmap_single (hwdev, bus, size, PCI_DMA_TODEVICE); |
@@ -65,8 +65,9 @@ extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, | ||
65 | 65 | extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, |
66 | 66 | void *vaddr, dma_addr_t dma_handle); |
67 | 67 | |
68 | -#ifdef CONFIG_SWIOTLB | |
69 | 68 | extern int swiotlb; |
69 | + | |
70 | +#ifdef CONFIG_SWIOTLB | |
70 | 71 | extern dma_addr_t swiotlb_map_single (struct pci_dev *hwdev, void *ptr, size_t size, |
71 | 72 | int dir); |
72 | 73 | extern void swiotlb_unmap_single (struct pci_dev *hwdev, dma_addr_t dev_addr, |