diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-12 15:35:52 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-12 15:35:52 +0000 |
commit | 87f272150c7bffd0166abd97b166e474f79109a9 (patch) | |
tree | f2a1a7f49aa4d537f72951da20f2b76c9466d12d /linux-2.6-xen-sparse | |
parent | d779bf952987735655c6e0c3e283d2bb347f02c6 (diff) | |
download | xen-87f272150c7bffd0166abd97b166e474f79109a9.tar.gz xen-87f272150c7bffd0166abd97b166e474f79109a9.tar.bz2 xen-87f272150c7bffd0166abd97b166e474f79109a9.zip |
linux: Add trivial forwarding of dma_{,un}map_page when not using highmem
Use non-trivial dma_{un,}map_page only when CONFIG_HIGHMEM, allowing
to not compile swiotlb_{un,}map_page in that case, which in neither
case need exporting.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'linux-2.6-xen-sparse')
4 files changed, 14 insertions, 10 deletions
diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c index e89d77f1bb..ccad7f0d1b 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c @@ -94,13 +94,7 @@ dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, } EXPORT_SYMBOL(dma_unmap_sg); -/* - * XXX This file is also used by xenLinux/ia64. - * "defined(__i386__) || defined (__x86_64__)" means "!defined(__ia64__)". - * This #if work around should be removed once this file is merbed back into - * i386' pci-dma or is moved to drivers/xen/core. - */ -#if defined(__i386__) || defined(__x86_64__) +#ifdef CONFIG_HIGHMEM dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) @@ -130,7 +124,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, swiotlb_unmap_page(dev, dma_address, size, direction); } EXPORT_SYMBOL(dma_unmap_page); -#endif /* defined(__i386__) || defined(__x86_64__) */ +#endif /* CONFIG_HIGHMEM */ int dma_mapping_error(dma_addr_t dma_addr) diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c index 643c0a3f2f..8738cfca7e 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c @@ -647,6 +647,8 @@ swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, sg->dma_length, dir); } +#ifdef CONFIG_HIGHMEM + dma_addr_t swiotlb_map_page(struct device *hwdev, struct page *page, unsigned long offset, size_t size, @@ -680,6 +682,8 @@ swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address, unmap_single(hwdev, bus_to_virt(dma_address), size, direction); } +#endif + int swiotlb_dma_mapping_error(dma_addr_t dma_addr) { @@ -707,7 +711,5 @@ EXPORT_SYMBOL(swiotlb_sync_single_for_cpu); EXPORT_SYMBOL(swiotlb_sync_single_for_device); EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu); EXPORT_SYMBOL(swiotlb_sync_sg_for_device); -EXPORT_SYMBOL(swiotlb_map_page); -EXPORT_SYMBOL(swiotlb_unmap_page); EXPORT_SYMBOL(swiotlb_dma_mapping_error); EXPORT_SYMBOL(swiotlb_dma_supported); diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/dma-mapping.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/dma-mapping.h index 17ef0c2afd..38befd4ed0 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/dma-mapping.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/dma-mapping.h @@ -53,6 +53,7 @@ extern int dma_map_sg(struct device *hwdev, struct scatterlist *sg, extern void dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction direction); +#ifdef CONFIG_HIGHMEM extern dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction); @@ -60,6 +61,11 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction); +#else +#define dma_map_page(dev, page, offset, size, dir) \ + dma_map_single(dev, page_address(page) + (offset), (size), (dir)) +#define dma_unmap_page dma_unmap_single +#endif extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/swiotlb.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/swiotlb.h index 74a0c21bbe..cf3efdeed6 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/swiotlb.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/swiotlb.h @@ -26,11 +26,13 @@ extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction); extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); +#ifdef CONFIG_HIGHMEM extern dma_addr_t swiotlb_map_page(struct device *hwdev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction); extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction); +#endif extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); extern void swiotlb_init(void); |