]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/metag/include/asm/atomic_lock1.h
Merge remote-tracking branch 'pci/next'
[karo-tx-linux.git] / arch / metag / include / asm / atomic_lock1.h
index f5d5898c10201cb32a94044ec53a4e2d5ef3b01a..0295d9b8d5bf2730dc9fe3fed7ab523444b2354e 100644 (file)
@@ -10,7 +10,7 @@
 
 static inline int atomic_read(const atomic_t *v)
 {
-       return (v)->counter;
+       return READ_ONCE((v)->counter);
 }
 
 /*
@@ -68,31 +68,14 @@ static inline int atomic_##op##_return(int i, atomic_t *v)          \
 
 ATOMIC_OPS(add, +=)
 ATOMIC_OPS(sub, -=)
+ATOMIC_OP(and, &=)
+ATOMIC_OP(or, |=)
+ATOMIC_OP(xor, ^=)
 
 #undef ATOMIC_OPS
 #undef ATOMIC_OP_RETURN
 #undef ATOMIC_OP
 
-static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long flags;
-
-       __global_lock1(flags);
-       fence();
-       v->counter &= ~mask;
-       __global_unlock1(flags);
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long flags;
-
-       __global_lock1(flags);
-       fence();
-       v->counter |= mask;
-       __global_unlock1(flags);
-}
-
 static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 {
        int ret;