[MIPS] SMP: Implement smp_call_function_mask().
[powerpc.git] / include / asm-i386 / atomic.h
index ff90c6e..437aac8 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/compiler.h>
 #include <asm/processor.h>
+#include <asm/cmpxchg.h>
 
 /*
  * Atomic operations that C can't guarantee us.  Useful for
@@ -51,7 +52,7 @@ static __inline__ void atomic_add(int i, atomic_t *v)
 }
 
 /**
- * atomic_sub - subtract the atomic variable
+ * atomic_sub - subtract integer from atomic variable
  * @i: integer value to subtract
  * @v: pointer of type atomic_t
  * 
@@ -170,7 +171,7 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
 }
 
 /**
- * atomic_add_return - add and return
+ * atomic_add_return - add integer and return
  * @v: pointer of type atomic_t
  * @i: integer value to add
  *
@@ -181,7 +182,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
        int __i;
 #ifdef CONFIG_M386
        unsigned long flags;
-       if(unlikely(boot_cpu_data.x86==3))
+       if(unlikely(boot_cpu_data.x86 <= 3))
                goto no_xadd;
 #endif
        /* Modern 486+ processor */
@@ -202,6 +203,13 @@ no_xadd: /* Legacy 386 processor */
 #endif
 }
 
+/**
+ * atomic_sub_return - subtract integer and return
+ * @v: pointer of type atomic_t
+ * @i: integer value to subtract
+ *
+ * Atomically subtracts @i from @v and returns @v - @i
+ */
 static __inline__ int atomic_sub_return(int i, atomic_t *v)
 {
        return atomic_add_return(-i,v);