summaryrefslogtreecommitdiffstats
path: root/kernel/dma.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1994-12-01 08:00:00 +0000
committer <ralf@linux-mips.org>1994-12-01 08:00:00 +0000
commit90ecc248e200fee448001248dde0ca540dd3ef64 (patch)
treea3fe89494ce63b4835f0f9cf5c45e74cde88252b /kernel/dma.c
parent1513ff9b7899ab588401c89db0e99903dbf5f886 (diff)
Import of Linux/MIPS 1.1.68
Diffstat (limited to 'kernel/dma.c')
-rw-r--r--kernel/dma.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/dma.c b/kernel/dma.c
index ce80c2fa6..799439ed6 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -5,6 +5,7 @@
#include <linux/kernel.h>
#include <linux/errno.h>
+#include <asm/system.h>
#include <asm/dma.h>
@@ -62,10 +63,18 @@ static __inline__ unsigned int mutex_atomic_swap(volatile unsigned int * p, unsi
* the swap may not be atomic.
*/
+#if 0
asm __volatile__ ("xchgl %2, %0\n"
: /* outputs: semval */ "=r" (semval)
: /* inputs: newval, p */ "0" (semval), "m" (*p)
); /* p is a var, containing an address */
+#else
+ /*
+ * RB: Try atomic exchange from include/asm/system.h
+ * This should be portable...
+ */
+ atomic_exchange(p,semval)
+#endif
return semval;
} /* mutex_atomic_swap */