patch-2.3.49 linux/arch/arm/mm/consistent.c

Next file: linux/arch/arm/mm/fault-armv.c
Previous file: linux/arch/arm/lib/strrchr.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/arch/arm/mm/consistent.c linux/arch/arm/mm/consistent.c
@@ -1,13 +1,14 @@
 /*
  * Dynamic DMA mapping support.
  */
-
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/vmalloc.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
+#include <linux/pci.h>
 
 #include <asm/io.h>
 #include <asm/pgalloc.h>
@@ -47,6 +48,22 @@
 no_page:
 	BUG();
 	return NULL;
+}
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handle)
+{
+	void *__ret;
+	int __gfp = GFP_KERNEL;
+
+#ifdef CONFIG_PCI
+	if ((hwdev) == NULL ||
+	    (hwdev)->dma_mask != 0xffffffff)
+#endif
+		__gfp |= GFP_DMA;
+
+	__ret = consistent_alloc(__gfp, (size),
+				 (handle));
+	return __ret;
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)