Lines Matching refs:oldval

31 static inline int __kernel_cmpxchg(int oldval, int newval, int *ptr)  in __kernel_cmpxchg()  argument
33 return !l4_atomic_cmpxchg((long *)ptr, oldval, newval); in __kernel_cmpxchg()
41 typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr);
98 unsigned int mask, shift, oldval, newval; \
105 oldval = *wordptr; \
106 newval = ((PFX_OP (((oldval & mask) >> shift) \
108 newval |= oldval & ~mask; \
109 failure = __kernel_cmpxchg (oldval, newval, wordptr); \
115 SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval)
116 SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval)
117 SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval)
118 SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval)
119 SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval)
120 SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
122 SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval)
123 SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval)
124 SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval)
125 SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval)
126 SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval)
127 SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
165 __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) in __sync_val_compare_and_swap_4() argument
173 if (__builtin_expect (oldval != actual_oldval, 0)) in __sync_val_compare_and_swap_4()
179 return oldval; in __sync_val_compare_and_swap_4()
185 __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
199 (unsigned int) oldval, 0)) \
209 return oldval; \
219 __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval) in __sync_bool_compare_and_swap_4() argument
221 int failure = __kernel_cmpxchg (oldval, newval, ptr); in __sync_bool_compare_and_swap_4()
227 __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
231 = __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \
232 return (oldval == actual_oldval); \
247 int failure, oldval; in __sync_lock_test_and_set_4() local
250 oldval = *ptr; in __sync_lock_test_and_set_4()
251 failure = __kernel_cmpxchg (oldval, val, ptr); in __sync_lock_test_and_set_4()
254 return oldval; in __sync_lock_test_and_set_4()
262 unsigned int oldval, newval, shift, mask; \
269 oldval = *wordptr; \
270 newval = (oldval & ~mask) \
272 failure = __kernel_cmpxchg (oldval, newval, wordptr); \
275 return (oldval & mask) >> shift; \