summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorGlauber Costa2008-04-08 18:20:45 +0200
committerIngo Molnar2008-04-19 19:19:57 +0200
commit9f9ab46d557c32b9cad49c31d094d659ec3b59c0 (patch)
tree6b9d59110207b0b273c9bfbfca14aa9840bb6ec5 /arch/x86/kernel
parentx86: delete empty functions from pci-nommu_64.c (diff)
downloadkernel-qcow2-linux-9f9ab46d557c32b9cad49c31d094d659ec3b59c0.tar.gz
kernel-qcow2-linux-9f9ab46d557c32b9cad49c31d094d659ec3b59c0.tar.xz
kernel-qcow2-linux-9f9ab46d557c32b9cad49c31d094d659ec3b59c0.zip
x86: implement mapping_error in pci-nommu_64.c
This patch implements mapping_error for pci-nommu_64.c. It takes care to keep the same compatible behaviour it already had. Although this file is not (yet) used for i386, we introduce the i386 version here. Again, care is taken, even at the expense of an ifdef, to keep the same behaviour inconditionally. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/pci-nommu_64.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-nommu_64.c b/arch/x86/kernel/pci-nommu_64.c
index 90a7c40aa989..a4e8ccfae4cb 100644
--- a/arch/x86/kernel/pci-nommu_64.c
+++ b/arch/x86/kernel/pci-nommu_64.c
@@ -67,9 +67,21 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
return nents;
}
+/* Make sure we keep the same behaviour */
+static int nommu_mapping_error(dma_addr_t dma_addr)
+{
+#ifdef CONFIG_X86_32
+ return 0;
+#else
+ return (dma_addr == bad_dma_address);
+#endif
+}
+
+
const struct dma_mapping_ops nommu_dma_ops = {
.map_single = nommu_map_single,
.map_sg = nommu_map_sg,
+ .mapping_error = nommu_mapping_error,
.is_phys = 1,
};