patch-2.1.34 linux/include/asm-ppc/atomic.h

Next file: linux/include/asm-ppc/errno.h
Previous file: linux/include/asm-mips/processor.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/include/asm-ppc/atomic.h linux/include/asm-ppc/atomic.h
@@ -5,13 +5,18 @@
 #ifndef _ASM_PPC_ATOMIC_H_ 
 #define _ASM_PPC_ATOMIC_H_
 
-typedef int atomic_t;
+typedef struct { int counter; } atomic_t;
+#define ATOMIC_INIT	{ 0 }
+
 /*
  * Make sure gcc doesn't try to be clever and move things around
  * on us. We need to use _exactly_ the address the user gave us,
  * not some alias that contains the same information.
  */
 #define __atomic_fool_gcc(x) (*(struct { int a[100]; } *)x)
+
+#define atomic_read(v)		((v)->counter)
+#define atomic_set(v)		(((v)->counter) = i)
 
 #define atomic_dec_return(v) ({atomic_sub(1,(v));(v);})
 #define atomic_inc_return(v) ({atomic_add(1,(v));(v);})

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