diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
commit | 78c388aed2b7184182c08428db1de6c872d815f5 (patch) | |
tree | 4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /include/asm-mips/dma.h | |
parent | eb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff) |
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'include/asm-mips/dma.h')
-rw-r--r-- | include/asm-mips/dma.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h index 320022c76..1432efa8e 100644 --- a/include/asm-mips/dma.h +++ b/include/asm-mips/dma.h @@ -1,4 +1,4 @@ -/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $ +/* $Id: dma.h,v 1.4 1998/11/15 03:25:44 ralf Exp $ * linux/include/asm/dma.h: Defines for using and allocating dma channels. * Written by Hennus Bergman, 1992. * High DMA channel support & info by Hannu Savolainen @@ -14,6 +14,9 @@ #include <linux/config.h> #include <asm/io.h> /* need byte IO */ +#include <asm/spinlock.h> /* And spinlocks */ +#include <linux/delay.h> +#include <asm/system.h> #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER @@ -143,6 +146,21 @@ #define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */ #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */ + +extern spinlock_t dma_spin_lock; + +static __inline__ unsigned long claim_dma_lock(void) +{ + unsigned long flags; + spin_lock_irqsave(&dma_spin_lock, flags); + return flags; +} + +static __inline__ void release_dma_lock(unsigned long flags) +{ + spin_unlock_irqrestore(&dma_spin_lock, flags); +} + /* enable/disable a specific DMA channel */ static __inline__ void enable_dma(unsigned int dmanr) { @@ -165,7 +183,7 @@ static __inline__ void disable_dma(unsigned int dmanr) * Use this once to initialize the FF to a known state. * After that, keep track of it. :-) * --- In order to do that, the DMA routines below should --- - * --- only be used while interrupts are disabled! --- + * --- only be used while holding the DMA lock ! --- */ static __inline__ void clear_dma_ff(unsigned int dmanr) { |