| /linux/arch/sh/include/asm/ |
| H A D | bitops-cas.h | 5 static inline unsigned __bo_cas(volatile unsigned *p, unsigned old, unsigned new) in __bo_cas() argument 9 : "r"(old), "z"(p) in __bo_cas() 16 unsigned mask, old; in set_bit() local 22 do old = *a; in set_bit() 23 while (__bo_cas(a, old, old|mask) != old); in set_bit() 28 unsigned mask, old; in clear_bit() local 34 do old = *a; in clear_bit() 35 while (__bo_cas(a, old, old&~mask) != old); in clear_bit() 40 unsigned mask, old; in change_bit() local 46 do old = *a; in change_bit() [all …]
|
| H A D | spinlock-cas.h | 13 static inline unsigned __sl_cas(volatile unsigned *p, unsigned old, unsigned new) in __sl_cas() argument 17 : "r"(old), "z"(p) in __sl_cas() 54 unsigned old; in arch_read_lock() local 55 do old = rw->lock; in arch_read_lock() 56 while (!old || __sl_cas(&rw->lock, old, old-1) != old); in arch_read_lock() 61 unsigned old; in arch_read_unlock() local 62 do old = rw->lock; in arch_read_unlock() 63 while (__sl_cas(&rw->lock, old, old+1) != old); in arch_read_unlock() 78 unsigned old; in arch_read_trylock() local 79 do old = rw->lock; in arch_read_trylock() [all …]
|
| /linux/security/safesetid/ |
| H A D | lsm.c | 145 * Check whether a caller with old credentials @old is allowed to switch to 148 static bool id_permitted_for_cred(const struct cred *old, kid_t new_id, enum setid_type new_type) in id_permitted_for_cred() argument 152 /* If our old creds already had this ID in it, it's fine. */ in id_permitted_for_cred() 154 if (uid_eq(new_id.uid, old->uid) || uid_eq(new_id.uid, old->euid) || in id_permitted_for_cred() 155 uid_eq(new_id.uid, old->suid)) in id_permitted_for_cred() 158 if (gid_eq(new_id.gid, old->gid) || gid_eq(new_id.gid, old->egid) || in id_permitted_for_cred() 159 gid_eq(new_id.gid, old->sgid)) in id_permitted_for_cred() 165 * Transitions to new UIDs require a check against the policy of the old in id_permitted_for_cred() 169 setid_policy_lookup((kid_t){.uid = old->uid}, new_id, new_type) != SIDPOL_CONSTRAINED; in id_permitted_for_cred() 174 __kuid_val(old->uid), __kuid_val(old->euid), in id_permitted_for_cred() [all …]
|
| /linux/arch/powerpc/include/asm/ |
| H A D | cmpxchg.h | 42 u32 __cmpxchg_##type##sfx(volatile void *p, u32 old, u32 new) \ 49 old <<= bitoff; \ 67 : "r" (p), "r" (old), "r" (new), "r" (prev_mask) \ 269 * Compare and exchange - if *p == old, set it to new, 270 * and return the old value of *p. 283 __cmpxchg_u8(volatile unsigned char *p, unsigned long old, unsigned long new) in __cmpxchg_u8() argument 298 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8() 305 __cmpxchg_u8_local(volatile unsigned char *p, unsigned long old, in __cmpxchg_u8_local() argument 318 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8_local() 325 __cmpxchg_u8_relaxed(u8 *p, unsigned long old, unsigned long new) in __cmpxchg_u8_relaxed() argument [all …]
|
| /linux/drivers/input/joystick/iforce/ |
| H A D | iforce-ff.c | 178 struct ff_effect *old, in need_condition_modifier() argument 191 ret |= old->u.condition[i].right_saturation != new->u.condition[i].right_saturation in need_condition_modifier() 192 || old->u.condition[i].left_saturation != new->u.condition[i].left_saturation in need_condition_modifier() 193 || old->u.condition[i].right_coeff != new->u.condition[i].right_coeff in need_condition_modifier() 194 || old->u.condition[i].left_coeff != new->u.condition[i].left_coeff in need_condition_modifier() 195 || old->u.condition[i].deadband != new->u.condition[i].deadband in need_condition_modifier() 196 || old->u.condition[i].center != new->u.condition[i].center; in need_condition_modifier() 206 struct ff_effect *old, in need_magnitude_modifier() argument 215 return old->u.constant.level != effect->u.constant.level; in need_magnitude_modifier() 222 static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old, in need_envelope_modifier() argument [all …]
|
| /linux/arch/sparc/kernel/ |
| H A D | ftrace.c | 26 static int ftrace_modify_code(unsigned long ip, u32 old, u32 new) in ftrace_modify_code() argument 32 "1: cas [%[ip]], %[old], %[new]\n" in ftrace_modify_code() 47 : [new] "0" (new), [old] "r" (old), [ip] "r" (ip) in ftrace_modify_code() 50 if (replaced != old && replaced != new) in ftrace_modify_code() 59 u32 old, new; in ftrace_make_nop() local 61 old = ftrace_call_replace(ip, addr); in ftrace_make_nop() 63 return ftrace_modify_code(ip, old, new); in ftrace_make_nop() 69 u32 old, new; in ftrace_make_call() local 71 old = ftrace_nop; in ftrace_make_call() 73 return ftrace_modify_code(ip, old, new); in ftrace_make_call() [all …]
|
| /linux/net/smc/ |
| H A D | smc_cdc.h | 146 /* calculate cursor difference between old and new, where old <= new and 150 union smc_host_cursor *old, in smc_curs_diff() argument 153 if (old->wrap != new->wrap) in smc_curs_diff() 155 ((size - old->count) + new->count)); in smc_curs_diff() 157 return max_t(int, 0, (new->count - old->count)); in smc_curs_diff() 160 /* calculate cursor difference between old and new - returns negative 161 * value in case old > new 164 union smc_host_cursor *old, in smc_curs_comp() argument 167 if (old->wrap > new->wrap || in smc_curs_comp() 168 (old->wrap == new->wrap && old->count > new->count)) in smc_curs_comp() [all …]
|
| /linux/tools/testing/selftests/bpf/libarena/src/ |
| H A D | bitmap.bpf.c | 60 u64 old, new, actual; in bmp_test_and_clear_bit() local 63 old = bmp->bits[idx]; in bmp_test_and_clear_bit() 65 if (!(old & val)) in bmp_test_and_clear_bit() 68 new = old & ~val; in bmp_test_and_clear_bit() 69 actual = cmpxchg(&bmp->bits[idx], old, new); in bmp_test_and_clear_bit() 71 if (actual == old) in bmp_test_and_clear_bit() 84 u64 old, new, actual; in bmp_test_and_set_bit() local 87 old = bmp->bits[idx]; in bmp_test_and_set_bit() 89 if ((old & val)) in bmp_test_and_set_bit() 92 new = old | val; in bmp_test_and_set_bit() [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | map_kptr_race.c | 44 struct prog_test_ref_kfunc *p, *old; in test_htab_leak() local 59 old = bpf_kptr_xchg(&v->ref_ptr, p); in test_htab_leak() 60 if (old) in test_htab_leak() 61 bpf_kfunc_call_test_release(old); in test_htab_leak() 68 old = bpf_kptr_xchg(&v->ref_ptr, p); in test_htab_leak() 69 if (old) in test_htab_leak() 70 bpf_kfunc_call_test_release(old); in test_htab_leak() 77 struct prog_test_ref_kfunc *p, *old; in fill_percpu_kptr() local 82 old = bpf_kptr_xchg(&v->ref_ptr, p); in fill_percpu_kptr() 83 if (old) in fill_percpu_kptr() [all …]
|
| /linux/arch/sparc/include/asm/ |
| H A D | cmpxchg_64.h | 11 __cmpxchg_u32(volatile int *m, int old, int new) in __cmpxchg_u32() argument 15 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u32() 78 /* Read the old value */ in xchg16() 106 * Atomic compare and exchange. Compare OLD with MEM, if identical, 108 * indicated by comparing RETURN with OLD. 115 __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) in __cmpxchg_u64() argument 119 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u64() 131 __cmpxchg_u8(volatile unsigned char *m, unsigned char old, unsigned char new) in __cmpxchg_u8() argument 142 old32 = (load32 & ~mask) | (old << bit_shift); in __cmpxchg_u8() 145 return old; in __cmpxchg_u8() [all …]
|
| H A D | cmpxchg_32.h | 41 u8 __cmpxchg_u8(volatile u8 *m, u8 old, u8 new_); 42 u16 __cmpxchg_u16(volatile u16 *m, u16 old, u16 new_); 43 u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); 47 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) in __cmpxchg() argument 50 size == 1 ? __cmpxchg_u8(ptr, old, new_) : in __cmpxchg() 51 size == 2 ? __cmpxchg_u16(ptr, old, new_) : in __cmpxchg() 52 size == 4 ? __cmpxchg_u32(ptr, old, new_) : in __cmpxchg() 53 (__cmpxchg_called_with_bad_pointer(), old); in __cmpxchg() 64 u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new); 65 #define arch_cmpxchg64(ptr, old, new) __cmpxchg_u64(ptr, old, new) argument
|
| /linux/Documentation/ |
| H A D | atomic_t.txt | 279 int atomic_cmpxchg(atomic_t *ptr, int old, int new); 287 int ret, old = *oldp; 288 ret = atomic_cmpxchg(ptr, old, new); 289 if (ret != old) 291 return ret == old; 296 int atomic_cmpxchg(atomic_t *ptr, int old, int new) 298 (void)atomic_try_cmpxchg(ptr, &old, new); 299 return old; 304 old = atomic_read(&v); old = atomic_read(&v); 306 new = func(old); new = func(old); [all …]
|
| /linux/arch/s390/include/asm/ |
| H A D | spinlock.h | 76 int old = 0; in arch_spin_trylock_once() local 79 return likely(arch_try_cmpxchg(&lp->lock, &old, spinlock_lockval())); in arch_spin_trylock_once() 126 int old; in arch_read_lock() local 128 old = __atomic_add(1, &rw->cnts); in arch_read_lock() 129 if (old & 0xffff0000) in arch_read_lock() 140 int old = 0; in arch_write_lock() local 142 if (!arch_try_cmpxchg(&rw->cnts, &old, 0x30000)) in arch_write_lock() 154 int old; in arch_read_trylock() local 156 old = READ_ONCE(rw->cnts); in arch_read_trylock() 157 return (!(old & 0xffff0000) && arch_try_cmpxchg(&rw->cnts, &old, old + 1)); in arch_read_trylock() [all …]
|
| H A D | atomic_ops.h | 66 op_type old; \ 69 op_string " %[old],%[val],%[ptr]" \ 71 : [old] "=d" (old), [ptr] "+QS" (*ptr) \ 73 return old; \ 117 int old, new; \ 120 "0: lr %[new],%[old]\n" \ 122 " cs %[old],%[new],%[ptr]\n" \ 124 : [old] "=d" (old), [new] "=&d" (new), [ptr] "+Q" (*ptr)\ 126 return old; \ 143 long old, new; \ [all …]
|
| /linux/arch/sparc/lib/ |
| H A D | atomic32.c | 83 int arch_atomic_cmpxchg(atomic_t *v, int old, int new) in arch_atomic_cmpxchg() argument 90 if (likely(ret == old)) in arch_atomic_cmpxchg() 125 unsigned long old, flags; in sp32___set_bit() local 128 old = *addr; in sp32___set_bit() 129 *addr = old | mask; in sp32___set_bit() 132 return old & mask; in sp32___set_bit() 138 unsigned long old, flags; in sp32___clear_bit() local 141 old = *addr; in sp32___clear_bit() 142 *addr = old & ~mask; in sp32___clear_bit() 145 return old & mask; in sp32___clear_bit() [all …]
|
| /linux/arch/alpha/include/asm/ |
| H A D | atomic.h | 205 int c, new, old; in ATOMIC_OPS() local 208 "1: ldl_l %[old],%[mem]\n" in ATOMIC_OPS() 209 " cmpeq %[old],%[u],%[c]\n" in ATOMIC_OPS() 210 " addl %[old],%[a],%[new]\n" in ATOMIC_OPS() 218 : [old] "=&r"(old), [new] "=&r"(new), [c] "=&r"(c) in ATOMIC_OPS() 222 return old; in ATOMIC_OPS() 228 s64 c, new, old; in arch_atomic64_fetch_add_unless() local 231 "1: ldq_l %[old],%[mem]\n" in arch_atomic64_fetch_add_unless() 232 " cmpeq %[old],%[u],%[c]\n" in arch_atomic64_fetch_add_unless() 233 " addq %[old],%[a],%[new]\n" in arch_atomic64_fetch_add_unless() [all …]
|
| /linux/arch/x86/include/asm/ |
| H A D | cmpxchg.h | 40 * returns the old value. 81 * Atomic compare and exchange. Compare OLD with MEM, if identical, 83 * indicated by comparing RETURN with OLD. 85 #define __raw_cmpxchg(ptr, old, new, size, lock) \ argument 88 __typeof__(*(ptr)) __old = (old); \ 133 #define __cmpxchg(ptr, old, new, size) \ argument 134 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX) 136 #define __sync_cmpxchg(ptr, old, new, size) \ argument 137 __raw_cmpxchg((ptr), (old), (new), (size), "lock ") 139 #define __cmpxchg_local(ptr, old, new, size) \ argument [all …]
|
| /linux/lib/ |
| H A D | errseq.c | 64 errseq_t cur, old; in errseq_set() local 73 old = READ_ONCE(*eseq); in errseq_set() 77 return old; in errseq_set() 83 new = (old & ~(ERRNO_MASK | ERRSEQ_SEEN)) | -err; in errseq_set() 86 if (old & ERRSEQ_SEEN) in errseq_set() 90 if (new == old) { in errseq_set() 96 cur = cmpxchg(eseq, old, new); in errseq_set() 102 if (likely(cur == old || cur == new)) in errseq_set() 106 old = cur; in errseq_set() 117 * If the error has been "seen", new callers will not see an old error. [all …]
|
| /linux/sound/soc/sof/ |
| H A D | ops.c | 19 unsigned int old, new; in snd_sof_pci_update_bits_unlocked() local 23 old = ret; in snd_sof_pci_update_bits_unlocked() 24 dev_dbg(sdev->dev, "Debug PCIR: %8.8x at %8.8x\n", old & mask, offset); in snd_sof_pci_update_bits_unlocked() 26 new = (old & ~mask) | (value & mask); in snd_sof_pci_update_bits_unlocked() 28 if (old == new) in snd_sof_pci_update_bits_unlocked() 49 unsigned int old, new; 54 old = ret; in snd_sof_dsp_update_bits_unlocked() local 55 new = (old & ~mask) | (value & mask); in snd_sof_dsp_update_bits_unlocked() 57 if (old == new) in snd_sof_dsp_update_bits_unlocked() 69 u64 old, ne in snd_sof_dsp_update_bits_unlocked() 74 u64 old, new; snd_sof_dsp_update_bits64_unlocked() local 122 unsigned int old, new; snd_sof_dsp_update_bits_forced_unlocked() local [all...] |
| /linux/rust/helpers/ |
| H A D | atomic.c | 399 rust_helper_atomic_cmpxchg(atomic_t *v, int old, int new) in rust_helper_atomic_xchg_relaxed() 401 return atomic_cmpxchg(v, old, new); in rust_helper_atomic_xchg_relaxed() 405 rust_helper_atomic_cmpxchg_acquire(atomic_t *v, int old, int new) in rust_helper_atomic_cmpxchg() 407 return atomic_cmpxchg_acquire(v, old, new); in rust_helper_atomic_cmpxchg() 411 rust_helper_atomic_cmpxchg_release(atomic_t *v, int old, int new) in rust_helper_atomic_cmpxchg_acquire() 413 return atomic_cmpxchg_release(v, old, new); in rust_helper_atomic_cmpxchg_acquire() 417 rust_helper_atomic_cmpxchg_relaxed(atomic_t *v, int old, int new) in rust_helper_atomic_cmpxchg_release() 419 return atomic_cmpxchg_relaxed(v, old, new); in rust_helper_atomic_cmpxchg_release() 423 rust_helper_atomic_try_cmpxchg(atomic_t *v, int *old, int new) in rust_helper_atomic_cmpxchg_relaxed() 425 return atomic_try_cmpxchg(v, old, ne in rust_helper_atomic_cmpxchg_relaxed() 404 rust_helper_atomic_cmpxchg(atomic_t * v,int old,int new) rust_helper_atomic_cmpxchg() argument 410 rust_helper_atomic_cmpxchg_acquire(atomic_t * v,int old,int new) rust_helper_atomic_cmpxchg_acquire() argument 416 rust_helper_atomic_cmpxchg_release(atomic_t * v,int old,int new) rust_helper_atomic_cmpxchg_release() argument 422 rust_helper_atomic_cmpxchg_relaxed(atomic_t * v,int old,int new) rust_helper_atomic_cmpxchg_relaxed() argument 428 rust_helper_atomic_try_cmpxchg(atomic_t * v,int * old,int new) rust_helper_atomic_try_cmpxchg() argument 434 rust_helper_atomic_try_cmpxchg_acquire(atomic_t * v,int * old,int new) rust_helper_atomic_try_cmpxchg_acquire() argument 440 rust_helper_atomic_try_cmpxchg_release(atomic_t * v,int * old,int new) rust_helper_atomic_try_cmpxchg_release() argument 446 rust_helper_atomic_try_cmpxchg_relaxed(atomic_t * v,int * old,int new) rust_helper_atomic_try_cmpxchg_relaxed() argument 914 rust_helper_atomic64_cmpxchg(atomic64_t * v,s64 old,s64 new) rust_helper_atomic64_cmpxchg() argument 920 rust_helper_atomic64_cmpxchg_acquire(atomic64_t * v,s64 old,s64 new) rust_helper_atomic64_cmpxchg_acquire() argument 926 rust_helper_atomic64_cmpxchg_release(atomic64_t * v,s64 old,s64 new) rust_helper_atomic64_cmpxchg_release() argument 932 rust_helper_atomic64_cmpxchg_relaxed(atomic64_t * v,s64 old,s64 new) rust_helper_atomic64_cmpxchg_relaxed() argument 938 rust_helper_atomic64_try_cmpxchg(atomic64_t * v,s64 * old,s64 new) rust_helper_atomic64_try_cmpxchg() argument 944 rust_helper_atomic64_try_cmpxchg_acquire(atomic64_t * v,s64 * old,s64 new) rust_helper_atomic64_try_cmpxchg_acquire() argument 950 rust_helper_atomic64_try_cmpxchg_release(atomic64_t * v,s64 * old,s64 new) rust_helper_atomic64_try_cmpxchg_release() argument 956 rust_helper_atomic64_try_cmpxchg_relaxed(atomic64_t * v,s64 * old,s64 new) rust_helper_atomic64_try_cmpxchg_relaxed() argument [all...] |
| /linux/arch/parisc/include/asm/ |
| H A D | cmpxchg.h | 60 extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_); 61 extern u16 __cmpxchg_u16(volatile u16 *ptr, u16 old, u16 new_); 62 extern u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); 63 extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_); 67 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) in __cmpxchg() argument 71 size == 8 ? __cmpxchg_u64(ptr, old, new_) : in __cmpxchg() 73 size == 4 ? __cmpxchg_u32(ptr, old, new_) : in __cmpxchg() 74 size == 2 ? __cmpxchg_u16(ptr, old, new_) : in __cmpxchg() 75 size == 1 ? __cmpxchg_u8(ptr, old, new_) : in __cmpxchg() 76 (__cmpxchg_called_with_bad_pointer(), old); in __cmpxchg() [all …]
|
| /linux/arch/xtensa/include/asm/ |
| H A D | cmpxchg.h | 25 __cmpxchg_u32(volatile int *p, int old, int new) in __cmpxchg_u32() argument 39 : [new] "a" (new), [addr] "a" (p), [cmp] "a" (old) in __cmpxchg_u32() 49 : [cmp] "a" (old) in __cmpxchg_u32() 57 " l32i %[old], %[mem]\n" in __cmpxchg_u32() 58 " bne %[old], %[cmp], 1f\n" in __cmpxchg_u32() 63 : [old] "=&a" (old), [mem] "+m" (*p) in __cmpxchg_u32() 64 : [cmp] "a" (old), [new] "r" (new) in __cmpxchg_u32() 66 return old; in __cmpxchg_u32() 75 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) in __cmpxchg() argument 78 case 1: return cmpxchg_emu_u8(ptr, old, new); in __cmpxchg() [all …]
|
| /linux/tools/verification/rvgen/rvgen/ |
| H A D | ltl2ba.py | 70 def __init__(self, incoming: set['GraphNode'], new, old, _next): 76 self.old = old.copy() 84 if nd.old == self.old and nd.next == self.next: 184 node.old.add(n) 188 node.new | ({n.op.left, n.op.right} - node.old), 189 node.old | {n}, 208 node.old |= {n} 212 node.new | ({n.op.left} - node.old), 72 __init__(self, incoming: set['GraphNode'], new, old, _next) global() argument [all...] |
| /linux/kernel/bpf/ |
| H A D | states.c | 301 /* check %cur's range satisfies %old's */ 302 static bool range_within(const struct bpf_reg_state *old, in range_within() argument 305 return cnum64_is_subset(old->r64, cur->r64) && in range_within() 306 cnum32_is_subset(old->r32, cur->r32); in range_within() 309 /* If in the old state two registers had the same id, then they need to have 311 * the old state, so we need to track the mapping from old to new ids. 312 * Once we have seen that, say, a reg with old id 5 had new id 9, any subsequent 313 * regs with old id 5 must also have new id 9 for the new state to be safe. But 314 * regs with a different old id could still have new id 9, we don't care about 316 * So we look through our idmap to see if this old id has been seen before. If [all …]
|
| /linux/include/asm-generic/bitops/ |
| H A D | atomic.h | 38 long old; in arch_test_and_set_bit() local 42 old = raw_atomic_long_fetch_or(mask, (atomic_long_t *)p); in arch_test_and_set_bit() 43 return !!(old & mask); in arch_test_and_set_bit() 49 long old; in arch_test_and_clear_bit() local 53 old = raw_atomic_long_fetch_andnot(mask, (atomic_long_t *)p); in arch_test_and_clear_bit() 54 return !!(old & mask); in arch_test_and_clear_bit() 60 long old; in arch_test_and_change_bit() local 64 old = raw_atomic_long_fetch_xor(mask, (atomic_long_t *)p); in arch_test_and_change_bit() 65 return !!(old & mask); in arch_test_and_change_bit()
|