patch-2.1.36 linux/include/asm-m68k/atomic.h

Next file: linux/include/asm-m68k/bootinfo.h
Previous file: linux/include/asm-m68k/atariints.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.35/linux/include/asm-m68k/atomic.h linux/include/asm-m68k/atomic.h
@@ -14,7 +14,7 @@
 #define ATOMIC_INIT	{ 0 }
 
 #define atomic_read(v)		((v)->counter)
-#define atomic_set(v)		(((v)->counter) = i)
+#define atomic_set(v, i)	(((v)->counter) = i)
 
 static __inline__ void atomic_add(int i, atomic_t *v)
 {
@@ -26,21 +26,27 @@
 	__asm__ __volatile__("subl %1,%0" : : "m" (*v), "id" (i));
 }
 
-static __inline__ void atomic_inc(atomic_t *v)
+static __inline__ void atomic_inc(volatile atomic_t *v)
 {
 	__asm__ __volatile__("addql #1,%0" : : "m" (*v));
 }
 
-static __inline__ void atomic_dec(atomic_t *v)
+static __inline__ void atomic_dec(volatile atomic_t *v)
 {
 	__asm__ __volatile__("subql #1,%0" : : "m" (*v));
 }
 
-static __inline__ int atomic_dec_and_test(atomic_t *v)
+static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
 {
 	char c;
 	__asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c) : "m" (*v));
 	return c != 0;
 }
+
+#define atomic_clear_mask(mask, v) \
+	__asm__ __volatile__("andl %1,%0" : : "m" (*v), "id" (~(mask)))
+
+#define atomic_set_mask(mask, v) \
+	__asm__ __volatile__("orl %1,%0" : : "m" (*v), "id" (mask));
 
 #endif /* __ARCH_M68K_ATOMIC __ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov