patch-2.1.34 linux/include/asm-m68k/atomic.h
Next file: linux/include/asm-m68k/errno.h
Previous file: linux/include/asm-i386/system.h
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Mon Apr 14 09:31:09 1997
- Orig file:
v2.1.33/linux/include/asm-m68k/atomic.h
- Orig date:
Mon May 6 02:44:32 1996
diff -u --recursive --new-file v2.1.33/linux/include/asm-m68k/atomic.h linux/include/asm-m68k/atomic.h
@@ -10,14 +10,18 @@
* We do not have SMP m68k systems, so we don't have to deal with that.
*/
-typedef int atomic_t;
+typedef struct { int counter; } atomic_t;
+#define ATOMIC_INIT { 0 }
-static __inline__ void atomic_add(atomic_t i, atomic_t *v)
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v) (((v)->counter) = i)
+
+static __inline__ void atomic_add(int i, atomic_t *v)
{
__asm__ __volatile__("addl %1,%0" : : "m" (*v), "id" (i));
}
-static __inline__ void atomic_sub(atomic_t i, atomic_t *v)
+static __inline__ void atomic_sub(int i, atomic_t *v)
{
__asm__ __volatile__("subl %1,%0" : : "m" (*v), "id" (i));
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov