From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: [PATCH 08/28] x86: move definition to pci-dma.c Date: Tue, 8 Apr 2008 13:20:50 -0300 Message-ID: <12076717261977-git-send-email-gcosta@redhat.com> References: <12076716702129-git-send-email-gcosta@redhat.com> Cc: akpm@linux-foundation.org, glommer@gmail.com, mingo@elte.hu, tglx@linutronix.de, kvm-devel@lists.sourceforge.net, amit.shah@qumranet.com, avi@qumranet.com, Glauber Costa To: linux-kernel@vger.kernel.org Return-path: In-Reply-To: <12076716702129-git-send-email-gcosta@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Move dma_ops structure definition to pci-dma.c, where it belongs. Signed-off-by: Glauber Costa --- arch/x86/kernel/pci-base_32.c | 11 ++++++++--- arch/x86/kernel/pci-dma.c | 3 +++ arch/x86/mm/init_64.c | 3 --- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/pci-base_32.c b/arch/x86/kernel/pci-base_32.c index 837bbe9..b44ea51 100644 --- a/arch/x86/kernel/pci-base_32.c +++ b/arch/x86/kernel/pci-base_32.c @@ -37,7 +37,7 @@ static int pci32_map_error(dma_addr_t dma_addr) return 0; } -static const struct dma_mapping_ops pci32_dma_ops = { +const struct dma_mapping_ops pci32_dma_ops = { .map_single = pci32_map_single, .unmap_single = NULL, .map_sg = pci32_dma_map_sg, @@ -51,5 +51,10 @@ static const struct dma_mapping_ops pci32_dma_ops = { .mapping_error = pci32_map_error, }; -const struct dma_mapping_ops *dma_ops = &pci32_dma_ops; -EXPORT_SYMBOL(dma_ops); +/* this is temporary */ +int __init no_iommu_init(void) +{ + dma_ops = &pci32_dma_ops; + return 0; +} +fs_initcall(no_iommu_init); diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index f1c24d8..1323cd8 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -1,5 +1,8 @@ #include +const struct dma_mapping_ops *dma_ops; +EXPORT_SYMBOL(dma_ops); + int dma_set_mask(struct device *dev, u64 mask) { if (!dev->dma_mask || !dma_supported(dev, mask)) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 8c989b8..f06a51e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -47,9 +47,6 @@ #include #include -const struct dma_mapping_ops *dma_ops; -EXPORT_SYMBOL(dma_ops); - static unsigned long dma_reserve __initdata; DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); -- 1.5.0.6