patch-2.4.22 linux-2.4.22/arch/arm/kernel/dma.c

Next file: linux-2.4.22/arch/arm/kernel/ecard.c
Previous file: linux-2.4.22/arch/arm/kernel/dma-rpc.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/arm/kernel/dma.c linux-2.4.22/arch/arm/kernel/dma.c
@@ -119,6 +119,10 @@
 {
 	dma_t *dma = dma_chan + channel;
 
+	if (dma->active)
+		printk(KERN_ERR "dma%d: altering DMA SG while "
+		       "DMA active\n", channel);
+
 	dma->sg = sg;
 	dma->sgcount = nr_sg;
 	dma->using_sg = 1;
@@ -217,6 +221,14 @@
 	BUG();
 }
 
+/*
+ * Is the specified DMA channel active?
+ */
+int dma_channel_active(dmach_t channel)
+{
+	return dma_chan[channel].active;
+}
+
 void set_dma_page(dmach_t channel, char pagenr)
 {
 	printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel);
@@ -272,6 +284,7 @@
 GLOBAL_ALIAS(set_dma_sg, get_dma_residue);
 GLOBAL_ALIAS(set_dma_speed, get_dma_residue);
 GLOBAL_ALIAS(init_dma, get_dma_residue);
+GLOBAL_ALIAS(dma_channel_active, get_dma_residue);
 
 #endif
 
@@ -286,3 +299,6 @@
 EXPORT_SYMBOL(get_dma_residue);
 EXPORT_SYMBOL(set_dma_sg);
 EXPORT_SYMBOL(set_dma_speed);
+EXPORT_SYMBOL(dma_channel_active);
+
+EXPORT_SYMBOL(dma_spin_lock);

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