[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1222107681-8185-4-git-send-email-joerg.roedel@amd.com>
Date: Mon, 22 Sep 2008 20:21:15 +0200
From: Joerg Roedel <joerg.roedel@....com>
To: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
iommu@...ts.linux-foundation.org
CC: David Woodhouse <dwmw2@...radead.org>,
Muli Ben-Yehuda <muli@...ibm.com>,
Amit Shah <amit.shah@...ranet.com>,
Ingo Molnar <mingo@...hat.com>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
Joerg Roedel <joerg.roedel@....com>
Subject: [PATCH 3/9] x86/iommu: change PCI-NOMMU to use dma_ops register interface
Signed-off-by: Joerg Roedel <joerg.roedel@....com>
---
arch/x86/kernel/pci-nommu.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
index 1c1c98a..0cbecb9 100644
--- a/arch/x86/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -115,16 +115,28 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
free_pages((unsigned long)vaddr, get_order(size));
}
+static int nommu_device_supported(struct device *dev)
+{
+ return 1;
+}
+
struct dma_mapping_ops nommu_dma_ops = {
.alloc_coherent = nommu_alloc_coherent,
.free_coherent = nommu_free_coherent,
.map_single = nommu_map_single,
.map_sg = nommu_map_sg,
+ .device_supported = nommu_device_supported,
.is_phys = 1,
};
void __init no_iommu_init(void)
{
+ /*
+ * we always want nommu to be the last fallback if no
+ * other dma_ops implementation feels responsible
+ */
+ x86_register_dma_ops(&nommu_dma_ops, DMA_OPS_TYPE_SOFT);
+
if (dma_ops)
return;
--
1.5.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists